Skip to content

Conversation

@clayborg
Copy link
Collaborator

…tion expression.

This patch allows offsets to the DW_AT_frame_base to exceed 4GB. Prior to this, for any .debug_info.dwo offset that exceeded 4GB, we would truncate the offset to the DW_AT_frame_base expression bytes to be 32 bit only. Changing the offset to 64 bits restores correct functionality.

No test for this as we don't want to create a .dwp file that has a .debug_info.dwo size that is over 4GB.

…tion expression.

This patch allows offsets to the DW_AT_frame_base to exceed 4GB. Prior to this, for any .debug_info.dwo offset that exceeded 4GB, we would truncate the offset to the DW_AT_frame_base expression bytes to be 32 bit only. Changing the offset to 64 bits restores correct functionality.

No test for this as we don't want to create a .dwp file that has a .debug_info.dwo size that is over 4GB.
@llvmbot
Copy link
Member

llvmbot commented Sep 28, 2024

@llvm/pr-subscribers-lldb

Author: Greg Clayton (clayborg)

Changes

…tion expression.

This patch allows offsets to the DW_AT_frame_base to exceed 4GB. Prior to this, for any .debug_info.dwo offset that exceeded 4GB, we would truncate the offset to the DW_AT_frame_base expression bytes to be 32 bit only. Changing the offset to 64 bits restores correct functionality.

No test for this as we don't want to create a .dwp file that has a .debug_info.dwo size that is over 4GB.


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

1 Files Affected:

  • (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (+2-2)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index 77ef59d605c9c4..66d0bc4b90cb52 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -229,9 +229,9 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
         case DW_AT_frame_base:
           if (frame_base) {
             if (form_value.BlockData()) {
-              uint32_t block_offset =
+              uint64_t block_offset =
                   form_value.BlockData() - data.GetDataStart();
-              uint32_t block_length = form_value.Unsigned();
+              uint64_t block_length = form_value.Unsigned();
               *frame_base =
                   DWARFExpressionList(module,
                                       DWARFExpression(DataExtractor(

@clayborg
Copy link
Collaborator Author

Since .dwp files can get large, it is ok for the .debug_info.dwo section to exceed 4GB as we can parse the linked list of dwarf units in the .debug_info.dwo and ignore the CU and TU indexes which are limited to 4GB. We have work arounds already checked into LLVM's DWARF code that detects this issues and reconstructs the CU and TU index to be 64 bit safe. So this fix allows variables to show correctly when they have a DW_AT_frame_base attribute on the DW_TAG_subprogram were the .debug_info.dwo offset of the DW_TAG_subprogram is over 4GB.

@clayborg clayborg merged commit b086f75 into llvm:main Sep 30, 2024
6 checks passed
@clayborg clayborg deleted the large-dwp-frame-base branch September 30, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants