Skip to content

Add support for Dwarf 5 in MCCAS #7611

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

Conversation

rastogishubham
Copy link

MCCAS doesn't support DWARF 5 currently. Since we are switching to DWARF 5 on all platforms relatively soon, we need to have MCCAS support it as well.

Cherry-picked from #7584

To support reading and writing DW_FORM_implicit_const in MCCAS, there is
a need to be able to read a signed value of a DWARFFormValue and be able
to write a signed LEB128 value to a CASObject. This change adds those
two functions to their respective classes.

(cherry picked from commit 6c8cbe8)
In Dwarf 5, for proper UnitDIE extraction, the debug_str_offsets section
needs to be passed to the DWARFObject. This patch adds support for that.

(cherry picked from commit a7b359e)
This includes, parsing the Dwarf 5 Compile Unit header correctly
and correctly creating and materializing from the CAS with the larger
DWARFv5 header.

(cherry picked from commit 315c12b)
In DWARF 5, we can have padding after the debug_str section, so a
PaddingRef must be added after the CAS blocks for individual strings.

(cherry picked from commit a414c21)
In DWARF 5, there is a new form, DW_FORM_implicit_const, which encodes
the value of the attribute in the debug_abbrev section, as a signed
LEB128 number. This change adds support for being able to parse that
and write it into MCCAS, as well as read it from a CASObject.

(cherry picked from commit 1aa3ace)
@rastogishubham
Copy link
Author

@swift-ci please test llvm

(cherry picked from commit 32757fa)
@rastogishubham
Copy link
Author

@swift-ci please test llvm

@rastogishubham rastogishubham merged commit 9a9d449 into swiftlang:stable/20230725 Oct 16, 2023
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