Skip to content

Commit 75f7d53

Browse files
authored
Fix DWARF locations when we have large .dwp files. (#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.
1 parent 2b0ab05 commit 75f7d53

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -3420,8 +3420,8 @@ static DWARFExpressionList GetExprListFromAtLocation(DWARFFormValue form_value,
34203420
if (DWARFFormValue::IsBlockForm(form_value.Form())) {
34213421
const DWARFDataExtractor &data = die.GetData();
34223422

3423-
uint32_t block_offset = form_value.BlockData() - data.GetDataStart();
3424-
uint32_t block_length = form_value.Unsigned();
3423+
uint64_t block_offset = form_value.BlockData() - data.GetDataStart();
3424+
uint64_t block_length = form_value.Unsigned();
34253425
return DWARFExpressionList(
34263426
module, DataExtractor(data, block_offset, block_length), die.GetCU());
34273427
}
@@ -3450,9 +3450,9 @@ GetExprListFromAtConstValue(DWARFFormValue form_value, ModuleSP module,
34503450
const DWARFDataExtractor &debug_info_data = die.GetData();
34513451
if (DWARFFormValue::IsBlockForm(form_value.Form())) {
34523452
// Retrieve the value as a block expression.
3453-
uint32_t block_offset =
3453+
uint64_t block_offset =
34543454
form_value.BlockData() - debug_info_data.GetDataStart();
3455-
uint32_t block_length = form_value.Unsigned();
3455+
uint64_t block_length = form_value.Unsigned();
34563456
return DWARFExpressionList(
34573457
module, DataExtractor(debug_info_data, block_offset, block_length),
34583458
die.GetCU());
@@ -4061,8 +4061,8 @@ CollectCallSiteParameters(ModuleSP module, DWARFDIE call_site_die) {
40614061
if (!DWARFFormValue::IsBlockForm(form_value.Form()))
40624062
return {};
40634063
auto data = child.GetData();
4064-
uint32_t block_offset = form_value.BlockData() - data.GetDataStart();
4065-
uint32_t block_length = form_value.Unsigned();
4064+
uint64_t block_offset = form_value.BlockData() - data.GetDataStart();
4065+
uint64_t block_length = form_value.Unsigned();
40664066
return DWARFExpressionList(
40674067
module, DataExtractor(data, block_offset, block_length),
40684068
child.GetCU());
@@ -4167,8 +4167,8 @@ SymbolFileDWARF::CollectCallEdges(ModuleSP module, DWARFDIE function_die) {
41674167
}
41684168

41694169
auto data = child.GetData();
4170-
uint32_t block_offset = form_value.BlockData() - data.GetDataStart();
4171-
uint32_t block_length = form_value.Unsigned();
4170+
uint64_t block_offset = form_value.BlockData() - data.GetDataStart();
4171+
uint64_t block_length = form_value.Unsigned();
41724172
call_target = DWARFExpressionList(
41734173
module, DataExtractor(data, block_offset, block_length),
41744174
child.GetCU());

0 commit comments

Comments
 (0)