[Lldb-commits] [lldb] Fix an integer trunctation issues for the DW_AT_frame_base DWARF loca… (PR #110388)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Sat Sep 28 15:31:40 PDT 2024


https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/110388

…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.

>From 499ca2180159b5a93634763feed626af6b070552 Mon Sep 17 00:00:00 2001
From: Greg Clayton <clayborg at gmail.com>
Date: Sat, 28 Sep 2024 15:28:01 -0700
Subject: [PATCH] Fix an integer trunctation issues for the DW_AT_frame_base
 DWARF location 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.
---
 lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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(



More information about the lldb-commits mailing list