summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/DWARFExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/DWARFExpression.cpp')
-rw-r--r--lldb/source/Expression/DWARFExpression.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 4816b883bfa..52fa175b5dd 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -3029,7 +3029,9 @@ bool DWARFExpression::AddressRangeForLocationListEntry(
if (!debug_loc_data.ValidOffset(*offset_ptr))
return false;
- switch (dwarf_cu->GetSymbolFileDWARF()->GetLocationListFormat()) {
+ DWARFExpression::LocationListFormat format =
+ dwarf_cu->GetSymbolFileDWARF()->GetLocationListFormat();
+ switch (format) {
case NonLocationList:
return false;
case RegularLocationList:
@@ -3051,7 +3053,9 @@ bool DWARFExpression::AddressRangeForLocationListEntry(
case DW_LLE_startx_length: {
uint64_t index = debug_loc_data.GetULEB128(offset_ptr);
low_pc = ReadAddressFromDebugAddrSection(dwarf_cu, index);
- uint32_t length = debug_loc_data.GetU32(offset_ptr);
+ uint64_t length = (format == LocLists)
+ ? debug_loc_data.GetULEB128(offset_ptr)
+ : debug_loc_data.GetU32(offset_ptr);
high_pc = low_pc + length;
return true;
}
OpenPOWER on IntegriCloud