Skip to content

Fix some source map and name section behavior #23182

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

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

dschuff
Copy link
Member

@dschuff dschuff commented Dec 16, 2024

  1. This causes -g0 to fullyl override -gsource-map (removing the name section)
    when it comes later on the command line

  2. -gsplit-dwarf and -gsource-map work together resulting in dwarf, source
    maps and name section together.

1) This causes -g0 to fullyl override -gsource-map (removing the name section)
when it comes later on the command line

2) -gsplit-dwarf and -gsource-map work together resulting in dwarf, source
maps and name section together.
@dschuff dschuff requested a review from sbc100 December 16, 2024 20:35
@dschuff dschuff enabled auto-merge (squash) December 16, 2024 20:36
@@ -3105,7 +3104,7 @@ def test_dwarf_sourcemap_names(self):
(['-sASYNCIFY=1', '-gsource-map'], False, True, True),
(['-g', '-gsource-map'], True, True, True),
(['-g2', '-gsource-map'], False, True, True),
# (['-gsplit-dwarf', '-gsource-map'], True, True, True), TODO this currently fails!
(['-gsplit-dwarf', '-gsource-map'], True, True, True),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see these TODOs fixed!

building.strip(infile, outfile, debug=not settings.GENERATE_DWARF,
sections=sections)
sections=strip_sections)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code gives me a headache! LGTM though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the possible combinations of debug options is pretty bad. But I think this (and the previous change, which added all those tests in test_other) is an improvement because it's now more explicit in the emscripten code rather than part of the behavior being implicit with Binaryen.

@dschuff dschuff merged commit d766ef1 into emscripten-core:main Dec 16, 2024
28 checks passed
@kripken
Copy link
Member

kripken commented Dec 17, 2024

Part 1 is maybe worth a changelog mention?

hedwigz pushed a commit to hedwigz/emscripten that referenced this pull request Dec 18, 2024
1) This causes -g0 to fullyl override -gsource-map (removing the name
section)
when it comes later on the command line

2) -gsplit-dwarf and -gsource-map work together resulting in dwarf,
source
maps and name section together.
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