-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
Add 'Default', 'Dwarf' and 'SplitDwarf' arguments to 'debugformat' #1067
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks! Should we be adding the dwarf debug formats to _premake_init.lua
though to make them accessible to GCC, etc.?
I was not familiar with the debug formats that gcc handles, which is the only reason I did not put them in _premake_init.lua. I thought this would be better encapsulation for the module-specific parameters. After looking over the debug options for gcc though, it makes sense to emit |
Xcode uses Clang under the hood, so Clang must support them at least? |
36ef3a6
to
4c4c7b5
Compare
rebased onto master |
modules/xcode/_preload.lua
Outdated
@@ -40,6 +40,10 @@ | |||
} | |||
} | |||
|
|||
p.api.addAllowed("debugformat", { | |||
"dwarf-with-dsym", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a similar option on Linux that does the same thing, it's called something else though. Given that they're the same thing, but have different names, it would be good to use generic terminology - I believe dsym
is very much an Apple term, I only got macOS hits when I googled it the other night.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here was to not introduce a layer of mapping between premake values and what is generated in the xcode project file (ie: what you enter is what you get).
I (mistakenly) thought that by adding to debugformat
in the xcode action, those options would not be available outside of the module, whoops!
It looks like the equivalent gcc flag is be -gsplit-dwarf
. Ill make that the value instead.
Another option is to make "dwarf-with-dsym" an alias of "split-dwarf", or vice versa. |
4c4c7b5
to
3f5b1ff
Compare
@starkos I just squashed some commits just now to do that. Updating my copy of the documentation now... |
3f5b1ff
to
e99e2a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could generate bad makefiles if the premake script is also intended for windows, and the filter's aren't manual-enough.
src/tools/gcc.lua
Outdated
}, | ||
symbols = function(cfg, mappings) | ||
local debugformat = cfg.debugformat or "" | ||
return { On = "-g" .. debugformat } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does -gc7
mean?
I feel like there probably needs to be a |
e99e2a7
to
7acbd5f
Compare
Added 'Default', changed capitalization of values, added more tests for 'Default'. Did not change c7 to C7 - should be a separate PR to properly deprecate the flag. |
7acbd5f
to
95d1c02
Compare
src/tools/gcc.lua
Outdated
symbols = function(cfg, mappings) | ||
local values = gcc.getdebugformat(cfg) | ||
local debugformat = values[cfg.debugformat] or "" | ||
return { On = "-g" .. debugformat } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a supported feature that we return a table from this function?
I thought this function was just meant to return the options string (the value part)...?
Assuming this works, it should also support FastLink
and Full
values for symbols
. Docs allege that if they are undefined for a platform, they are a synonym for On
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning a table from this function is to preserve as much of the existing behavior prior to this change as possible.
The test for 'function' type and executing the function here is what triggers this logic to take place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. I see what you mean about FastLink
and Full
. Will add those in when I get home later.
Sorry to push back on this again, but |
95d1c02
to
9c07782
Compare
@TurkeyMan Next iteration ready to go! |
9c07782
to
4602d63
Compare
@TurkeyMan are you happy with the latest changes? |
4602d63
to
1f60a1f
Compare
I think all concerns @TurkeyMan had were addressed and this was not updated in a while. I think this is a nice addition and looking through the changes feels fine with merging. |
1f60a1f
to
a364392
Compare
@tdesveauxPKFX I'm happy for this to go in, I think we've let this PR stagnate for long enough. If there's problems, we can just address them as they pop up. |
a364392
to
85ed6bb
Compare
I'm just going to merge this now, thanks for fixing it up multiple times! Sorry it's taken so long to get this through. |
Thanks! |
Adds 'Default', 'Dwarf' and 'SplitDwarf' options to 'debugformat' when using the xcode, gmake or gmake2 modules.
Wiki updates are at: https://github.com/ratzlaff/premake-core/wiki/debugformat
wiki repo URL: https://github.com/ratzlaff/premake-core.wiki.git (branch: xcode_debugformat)