[Lldb-commits] [lldb] Fix DWARF locations when we have large .dwp files. (PR #87164)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Sat Mar 30 10:59:53 PDT 2024
https://github.com/clayborg created https://github.com/llvm/llvm-project/pull/87164
We have the ability to load .dwp files with a .debug_info.dwo section that exceeds 4GB. There were 4 locations that were using 32 bit offsets and lengths to extract variable locations, and if a DIE was over the 4GB barrier, we would truncate the block offset for the variable locations and the variable expression would be garbage. This fixes the issues. It isn't possible to add a test for this as we don't want to create a 4GB .dwp file on test machines.
>From 91b6bea2668426393f9d1ae7564c869b3438f603 Mon Sep 17 00:00:00 2001
From: Greg Clayton <clayborg at gmail.com>
Date: Sat, 30 Mar 2024 10:56:39 -0700
Subject: [PATCH] Fix DWARF locations when we have large .dwp files.
We have the ability to load .dwp files with a .debug_info.dwo section that exceeds 4GB. There were 4 locations that were using 32 bit offsets and lengths to extract variable locations, and if a DIE was over the 4GB barrier, we would truncate the block offset for the variable locations and the variable expression would be garbage. This fixes the issues. It isn't possible to add a test for this as we don't want to create a 4GB .dwp file on test machines.
---
.../Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 1164bc62682a9a..49f13d2c89e380 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3420,8 +3420,8 @@ static DWARFExpressionList GetExprListFromAtLocation(DWARFFormValue form_value,
if (DWARFFormValue::IsBlockForm(form_value.Form())) {
const DWARFDataExtractor &data = die.GetData();
- uint32_t block_offset = form_value.BlockData() - data.GetDataStart();
- uint32_t block_length = form_value.Unsigned();
+ uint64_t block_offset = form_value.BlockData() - data.GetDataStart();
+ uint64_t block_length = form_value.Unsigned();
return DWARFExpressionList(
module, DataExtractor(data, block_offset, block_length), die.GetCU());
}
@@ -3450,9 +3450,9 @@ GetExprListFromAtConstValue(DWARFFormValue form_value, ModuleSP module,
const DWARFDataExtractor &debug_info_data = die.GetData();
if (DWARFFormValue::IsBlockForm(form_value.Form())) {
// Retrieve the value as a block expression.
- uint32_t block_offset =
+ uint64_t block_offset =
form_value.BlockData() - debug_info_data.GetDataStart();
- uint32_t block_length = form_value.Unsigned();
+ uint64_t block_length = form_value.Unsigned();
return DWARFExpressionList(
module, DataExtractor(debug_info_data, block_offset, block_length),
die.GetCU());
@@ -4061,8 +4061,8 @@ CollectCallSiteParameters(ModuleSP module, DWARFDIE call_site_die) {
if (!DWARFFormValue::IsBlockForm(form_value.Form()))
return {};
auto data = child.GetData();
- uint32_t block_offset = form_value.BlockData() - data.GetDataStart();
- uint32_t block_length = form_value.Unsigned();
+ uint64_t block_offset = form_value.BlockData() - data.GetDataStart();
+ uint64_t block_length = form_value.Unsigned();
return DWARFExpressionList(
module, DataExtractor(data, block_offset, block_length),
child.GetCU());
@@ -4167,8 +4167,8 @@ SymbolFileDWARF::CollectCallEdges(ModuleSP module, DWARFDIE function_die) {
}
auto data = child.GetData();
- uint32_t block_offset = form_value.BlockData() - data.GetDataStart();
- uint32_t block_length = form_value.Unsigned();
+ uint64_t block_offset = form_value.BlockData() - data.GetDataStart();
+ uint64_t block_length = form_value.Unsigned();
call_target = DWARFExpressionList(
module, DataExtractor(data, block_offset, block_length),
child.GetCU());
More information about the lldb-commits
mailing list