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

Fix non-standard implementation of DWARF 5 DW_FORM_line_strp (7.5.5) #357

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

zadewg
Copy link
Contributor

@zadewg zadewg commented Aug 17, 2023

The current implementation of DW_FORM_line_strp reads into .debug_str. This form was added in DWARF 5, and the standard specifies that the string is included in the .debug_line_str section instead.

This PR fixes #348.

@google-cla
Copy link

google-cla bot commented Aug 17, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@haberman
Copy link
Member

Thanks very much for the fix. Would you be able to add a yaml2obj unit test for this in https://github.com/google/bloaty/tree/main/tests/dwarf/debug_info?

@zadewg
Copy link
Contributor Author

zadewg commented Aug 21, 2023

Done. Interestingly, yaml2obj (at least Ubuntu LLVM version 15.0.7 ) is not happy with:

DWARF:
  debug_str:
    - fizz
  debug_line_str:        # <---- yaml2obj-15 "unknown key" error.
    - foo.c
  debug_abbrev:

I have not tried a trunk build. The alternative way of adding the section is borrowed from LLVM's own tests for DW_FORM_line_strp.

@haberman
Copy link
Member

As of #354 we are now using a much newer yaml2obj. Want to give it another try?

@zadewg
Copy link
Contributor Author

zadewg commented Aug 29, 2023

Sure, just did - yaml2obj from llvmorg-17.0.0-rc3 still fails to recognize debug_line_str as a valid key, the test should remain as is.

@haberman haberman merged commit 3925908 into google:main Aug 29, 2023
9 checks passed
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.

bloaty broken on ubuntu 22.04
2 participants