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

Refactored the DWARF parser #280

Merged
merged 11 commits into from
Aug 8, 2021
Merged

Refactored the DWARF parser #280

merged 11 commits into from
Aug 8, 2021

Conversation

haberman
Copy link
Member

@haberman haberman commented Aug 8, 2021

This refactoring achieves two main goals:

  1. It splits up src/dwarf.cc, which had grown very large, into several smaller files.
  2. It refactors the main .debug_info parsing classes into better abstractions. The DIEReader class was too large and the control flow was convoluted. The new classes InfoReader, CUIter, CU, and DIEReader have both simpler implementations and better interfaces.

haberman added 11 commits May 23, 2021 20:18
As a monolith it was getting unmanageable
DWARF5 introduced new representations for location lists and range
lists.  The index processing is dependent on the form, with
`DW_FORM_sec_offset` and `DW_FORM_loclistx`.  Process the
`DW_FORM_locklistx` when processing the DWARF though we still only
read the `DW_FORM_sec_offset` representation of the location.
Explicitly check the encoding type before getting the location to avoid
spurious warnings.

Ported from e2ee0c8
The offset computation needs to account for the stride (4-bytes by
default in DWARF).  Account for the difference in stride width for
DWARF64, which uses a 8-byte stride.

Applied from 2151c24
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.

1 participant