Skip to content

Conversation

@fosterbrereton
Copy link
Contributor

Description

DWARF includes a debug_lines segment that includes file and line number information about each die present. Previously we assumed there was only one entry in that segment that corresponded to the one compilation unit the DWARF data being parsed represents. Well it turns out a single DWARF description can represent multiple compilation units, and each unit may have its own subsection of debug_lines.

If a compilation unit does use debug_lines, it will specify which subsection to reference based on the stmt_list attribute in its debug information entry (die). This PR looks for that specific attribute, and reads the debug_lines subsection that corresponds to the compilation unit in question to glean file declaration information.

Related Issue

Issue #67 - better debug_lines support.

Motivation and Context

This prevents a crash when die processing was using the wrong debug_lines table for file declaration derivation.

How Has This Been Tested?

I have a sample object file that was previously crashing, but is not anymore. Unfortunately it cannot be made public.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
@fosterbrereton fosterbrereton enabled auto-merge (squash) January 11, 2024 22:33
@fosterbrereton fosterbrereton merged commit 45c6bf1 into main Jan 11, 2024
@fosterbrereton fosterbrereton deleted the fosterbrereton/debug_lines_parsing branch January 11, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants