Skip to content

[DWARF] Add accessor for NameIndex Offsets field. #88783

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
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

cmtice
Copy link
Contributor

@cmtice cmtice commented Apr 15, 2024

Add an accessor function to DWARFDebugNames::NameIndex to allow other classes to access the Offsets field within NameIndex. This will be used by LLD to create a merged .debug_names index (#86508)

Add an accessor function to DWARFDebugNames::NameIndex to allow
other classes to access the Offsets field within NameIndex.
@cmtice cmtice requested a review from dwblaikie April 15, 2024 19:37
@llvmbot
Copy link
Member

llvmbot commented Apr 15, 2024

@llvm/pr-subscribers-debuginfo

Author: None (cmtice)

Changes

Add an accessor function to DWARFDebugNames::NameIndex to allow other classes to access the Offsets field within NameIndex.


Full diff: https://github.com/llvm/llvm-project/pull/88783.diff

1 Files Affected:

  • (modified) llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h (+3)
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
index 9543b78ea61309..0d447a78cdc614 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
@@ -608,6 +608,9 @@ class DWARFDebugNames : public DWARFAcceleratorTable {
     /// Returns Hdr field
     Header getHeader() const { return Hdr; }
 
+    /// Returns Offsets field
+    DWARFDebugNamesOffsets getOffsets() const { return Offsets; }
+
     /// Reads offset of compilation unit CU. CU is 0-based.
     uint64_t getCUOffset(uint32_t CU) const;
     uint32_t getCUCount() const { return Hdr.CompUnitCount; }

Copy link
Collaborator

@dwblaikie dwblaikie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Maybe mention specifically the intent is to use this in the other pr and reference that or number.

@MaskRay
Copy link
Member

MaskRay commented Apr 15, 2024

LGTM. Perhaps the commit message (first comment) can be clarified to say that this will be used by ld.lld --debug-names?

BTW, most commit messages omit a full stop for the subject line.

@cmtice cmtice merged commit 9e485f4 into llvm:main Apr 15, 2024
aniplcc pushed a commit to aniplcc/llvm-project that referenced this pull request Apr 15, 2024
Add an accessor function to DWARFDebugNames::NameIndex to allow other
classes to access the Offsets field within NameIndex. This will be used
by LLD to create a merged .debug_names index
(llvm#86508)
@cmtice cmtice deleted the ni-offsets branch December 11, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants