Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New built-in option b_debuginfo #5954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

agurtovoy
Copy link
Contributor

Controls the debug info format; defaults to from_buildtype with backward compatible behavior. In relation to #5183.

When using MSVC-like compilers, b_debuginfo=embedded will result in /Z7, b_debuginfo=standalone will result in /Zi, and b_debuginfo=edit-and-continue will result in /ZI. The option currently doesn't have any effect when using other compilers.

@ignatenkobrain
Copy link
Member

Flake8 detected 9 issues on ee323de
Visit https://sider.review/gh/repos/19784232/pulls/5954 to review the issues.

posted by Sider

@agurtovoy
Copy link
Contributor Author

It looks like VS tests are failing due to #5923.

Controls the debug info format; defaults to `from_buildtype` with backward compatible behavior.
@jpakkane
Copy link
Member

I'd rather there only be one option for deciding debug type, specifically debug. Having two is always confusing, especially when then conflict as is the case here.

@agurtovoy
Copy link
Contributor Author

@jpakkane Could you clarify what you mean? Debug info format is not the same as debug configuration, and there is no one to one correspondence between the two. In fact, it's a relatively widespread practice to generate standalone PDBs for release builds on Windows so that you can sanely debug production crashes etc.

On top of it, currently, Meson hard-wires /ZI ("Edit-and-continue" PDB) flag for MSVC's debug build type, presumably because this is the default MSVC setting for new projects created through IDE, but in practice "Edit-and-continue" is fickle and incompatible with enough libraries/configurations that you have to have an ability to turn it off. Manually overriding the flag with cpp_args is verbose and produces a warning for every source file in the project.

@jpakkane
Copy link
Member

There are unfortunately two slightly incompatible meanings for the phrase "debug build". The first one, which is used by all unixy compilers, is that "debug" implies creating debug information. In practice this means using -g. MSVC, on the other hand, says that "debug" means linking against the debug msvcrt runtime. Meson follows the former definition, whereas the debug runtime with MSVC is chosen with b_vscrt option.

Thus since debug currently means "debug info on or off", it makes sense to extend that to "choose the type of debug info, if any, you wish to have".

@agurtovoy
Copy link
Contributor Author

agurtovoy commented Oct 1, 2019

@jpakkane Thanks for clarifying; I didn't realize debug was supposed to regulate whether to generate debug info, since it currently has no effect on MSVC. I agree that another generic option to control the format of the debug info would be confusing. We could do something like this:

Option Default value Description Is per machine
debug {false, true, embedded, standalone, edit-and-continue} true Generate debug information in the compiler's default debug info format, unless specified otherwise no

or we can leave the debug option as-is and take the b_vscrt route:

Option Default value Description Is per machine
debug true Generate debug information no
Option Default value Possible values Description
b_vspdb from_buildtype none, embedded, standalone, edit-and-continue, from_buildtype VS PDB format to use (since 0.52.0)

Neither of these would be 100% backward compatible since currently debug is ignored on MSVC and no debug info is generated for any buildtype other than debug and debugoptimized, but that seems okay to me.

I don't have a strong preference between the two, let me know which one makes more sense to you or if you were thinking something different altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants