Skip to content

Conversation

kripken
Copy link
Member

@kripken kripken commented Nov 20, 2019

Fixes #9611

Sadly this adds some complexity, but I tried hard to keep
it all in one area, and not spread around.

@kripken kripken requested a review from dschuff November 20, 2019 00:40
@dschuff
Copy link
Member

dschuff commented Nov 20, 2019

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 -gsplit-dwarf[=single]

@dschuff
Copy link
Member

dschuff commented Nov 20, 2019

This is also weird because g1 is more debug info than line-tables-only but we are modeling it as level 3.
Also we may want the ability to control generation of source maps independently from names sections and dwarf sections.
Maybe we need to make a complete separation between flags used at compile time and link time, where we pass through at compile times and accept a different set of flags at link time. It's probably already the case that users are doing special things for link anyway because build systems don't pass -g at link time by default.

@kripken
Copy link
Member Author

kripken commented Nov 20, 2019

Added arbitrary passthrough support, and made it limit debug info to what we can do for now, which is line tables.

@kripken kripken changed the title Support -gline-tables-only Support arbitrary -gX debug options, and limit DWARF to line-tables-only Nov 20, 2019
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:
Copy link
Member

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?

Copy link
Member Author

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.

@dschuff
Copy link
Member

dschuff commented Nov 20, 2019 via email

@kripken
Copy link
Member Author

kripken commented Nov 20, 2019

I see. Then yes, -g1 in emcc is different from gcc/clang, and we've not supported the gcc/clang meaning. This PR doesn't change that, but yeah, that's unfortunate.

Copy link
Member

@dschuff dschuff left a 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.

@kripken
Copy link
Member Author

kripken commented Nov 20, 2019

True. Maybe that refactoring could be helped by @sbc100's planned refactoring of an emlink type tool, which separates the linking part completely.

@kripken kripken merged commit dd1fd6a into incoming Nov 20, 2019
@delete-merged-branch delete-merged-branch bot deleted the dtab branch November 20, 2019 23:12
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
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.

support -gline-tables-only

2 participants