-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Support arbitrary -gX debug options, and limit DWARF to line-tables-only #9872
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
Conversation
After looking at dwarf-splitting, I think we're going to want to make at least the compile-part of it a fully general passthrough, because the flag for splitting is |
This is also weird because |
Added arbitrary passthrough support, and made it limit debug info to what we can do for now, which is line tables. |
options.debug_level = validate_arg_level(requested_level, 4, 'Invalid debug level: ' + newargs[i]) | ||
# if we don't need to preserve LLVM debug info, do not keep this flag | ||
# for clang | ||
if options.debug_level < 3: |
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.
Doesn't this mean that you can never get g1
-level debug info from the frontend?
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.
Oh, does -g1
mean something useful for clang? clang --help
doesn't show anything.
Clang's options are not well documented. But the behavior tends to match
https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gcc/Debugging-Options.html#Debugging-Opti
…On Wed, Nov 20, 2019 at 12:51 PM Alon Zakai ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In emcc.py
<#9872 (comment)>
:
> options.requested_debug = newargs[i]
- newargs[i] = ''
+ requested_level = newargs[i][2:] or '3'
+ if is_int(requested_level):
+ # the -gX value is the debug level (-g1, -g2, etc.)
+ options.debug_level = validate_arg_level(requested_level, 4, 'Invalid debug level: ' + newargs[i])
+ # if we don't need to preserve LLVM debug info, do not keep this flag
+ # for clang
+ if options.debug_level < 3:
Oh, does -g1 mean something useful for clang? clang --help doesn't show
anything.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#9872?email_source=notifications&email_token=AAISEKGELJGCRKXRKYYEG2LQUWPLTA5CNFSM4JPLMMU2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCMLNVKI#discussion_r348738103>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAISEKH45W4PHQPHP65PDXTQUWPLTANCNFSM4JPLMMUQ>
.
|
I see. Then yes, |
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.
Anyway this is a functionality improvement for now without breaking the current model, although I think it does illustrate why I think we want to maybe split compile and link-time debug options more carefully. I think most of the interesting and/or weird and/or not-applicable-off-the-web functionality is done at link time.
True. Maybe that refactoring could be helped by @sbc100's planned refactoring of an emlink type tool, which separates the linking part completely. |
Fixes #9611
Sadly this adds some complexity, but I tried hard to keep
it all in one area, and not spread around.