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(debuginfo): Support debug_addr indexes in DWARF functions #326

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

jan-auer
Copy link
Member

The values of the DW_AT_low_pc and DW_AT_high_pc attributes can also contain
DW_FORM_addrx*. We did not support this and used to raise an unreachable
panic.

To handle this more gracefully, symbolic will now return an error. This error
matches what gimli's Dwarf::attr_addr returns in the same case.

Note that this will complicate debugging. The DwarfError struct does not carry
a backtrace yet, so we will no longer know which attribute causes the error.
Once backtraces are stable in the standard library, we can reintroduce this with
a feature flag.

@jan-auer jan-auer requested a review from a team February 17, 2021 10:59
@jan-auer
Copy link
Member Author

Note, I didn't use Dwarf::attr_address directly as this would require us to match twice in the high_pc case. Gimli itself does this in a strange way here:

https://github.com/gimli-rs/gimli/blob/36d1e2d41472cc48fe41df839c2059ba551fb329/src/read/dwarf.rs#L342-L350

@loewenheim loewenheim merged commit 125b504 into master Feb 17, 2021
@loewenheim loewenheim deleted the fix/low-pc-addr-index branch February 17, 2021 12:04
jan-auer added a commit that referenced this pull request Mar 1, 2021
* master:
  test: add similar-asserts' assert_eq (#333)
  release: 8.0.4
  meta: Changelog for 8.0.4
  build: Drop support for python 2.7 (#328)
  meta(vscode): Fix include paths for C++ (#331)
  doc(debuginfo): Add descriptions of records to breakpad.pest (#329)
  build: Replace virtualenv with venv
  doc(symcache): Symcache documentation
  fix(debuginfo): Support debug_addr indexes in DWARF functions (#326)
  fix(symcache): Fixed bug that caused functions to have len 0 (#324)
  ref(symcache): FuncRecord::len must be nonzero (#323)
  fix: Clippy 1.50 lints (#322)
  fix(symcache): Support lookup for public syms larger than 65k (#320)
  fix(symcache): Compute correct line offsets (#319)
  release: 8.0.3
  meta: Changelog
  build: Update goblin to 0.3.1 (#318)
  fix(elf): Consider sections of type SHT_MIPS_DWARF (#317)
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