NonLocationList, // Not a location list
RegularLocationList, // Location list format used in non-split dwarf files
SplitDwarfLocationList, // Location list format used in split dwarf files
+ LocLists, // Location list format used in DWARF v5 (.debug_loclists).
};
//------------------------------------------------------------------
eSectionTypeOther,
eSectionTypeDWARFDebugLineStr, // DWARF v5 .debug_line_str
eSectionTypeDWARFDebugRngLists, // DWARF v5 .debug_rnglists
+ eSectionTypeDWARFDebugLocLists, // DWARF v5 .debug_loclists
};
FLAGS_ENUM(EmulateInstructionOptions){
return "dwarf-line-str";
case eSectionTypeDWARFDebugLoc:
return "dwarf-loc";
+ case eSectionTypeDWARFDebugLocLists:
+ return "dwarf-loclists";
case eSectionTypeDWARFDebugMacInfo:
return "dwarf-macinfo";
case eSectionTypeDWARFDebugMacro:
high_pc = debug_loc_data.GetAddress(offset_ptr);
return true;
case SplitDwarfLocationList:
+ case LocLists:
switch (debug_loc_data.GetU8(offset_ptr)) {
case DW_LLE_end_of_list:
return false;
high_pc = low_pc + length;
return true;
}
+ case DW_LLE_start_length: {
+ low_pc = debug_loc_data.GetAddress(offset_ptr);
+ high_pc = low_pc + debug_loc_data.GetULEB128(offset_ptr);
+ return true;
+ }
+ case DW_LLE_start_end: {
+ low_pc = debug_loc_data.GetAddress(offset_ptr);
+ high_pc = debug_loc_data.GetAddress(offset_ptr);
+ return true;
+ }
default:
// Not supported entry type
+ lldbassert(false && "Not supported location list type");
return false;
}
}
sect_type = lldb::eSectionTypeDWARFDebugLine;
else if (dwarf_name.equals("loc"))
sect_type = lldb::eSectionTypeDWARFDebugLoc;
+ else if (dwarf_name.equals("loclists"))
+ sect_type = lldb::eSectionTypeDWARFDebugLocLists;
break;
case 'm':
case lldb::eSectionTypeDWARFDebugInfo:
case lldb::eSectionTypeDWARFDebugLine:
case lldb::eSectionTypeDWARFDebugLoc:
+ case lldb::eSectionTypeDWARFDebugLocLists:
case lldb::eSectionTypeDWARFDebugMacInfo:
case lldb::eSectionTypeDWARFDebugPubNames:
case lldb::eSectionTypeDWARFDebugPubTypes:
static ConstString g_sect_name_dwarf_debug_line(".debug_line");
static ConstString g_sect_name_dwarf_debug_line_str(".debug_line_str");
static ConstString g_sect_name_dwarf_debug_loc(".debug_loc");
+ static ConstString g_sect_name_dwarf_debug_loclists(".debug_loclists");
static ConstString g_sect_name_dwarf_debug_macinfo(".debug_macinfo");
static ConstString g_sect_name_dwarf_debug_macro(".debug_macro");
static ConstString g_sect_name_dwarf_debug_names(".debug_names");
static ConstString g_sect_name_dwarf_debug_line_str_dwo(".debug_line_str.dwo");
static ConstString g_sect_name_dwarf_debug_macro_dwo(".debug_macro.dwo");
static ConstString g_sect_name_dwarf_debug_loc_dwo(".debug_loc.dwo");
+ static ConstString g_sect_name_dwarf_debug_loclists_dwo(".debug_loclists.dwo");
static ConstString g_sect_name_dwarf_debug_str_dwo(".debug_str.dwo");
static ConstString g_sect_name_dwarf_debug_str_offsets_dwo(
".debug_str_offsets.dwo");
sect_type = eSectionTypeDWARFDebugLineStr;
else if (name == g_sect_name_dwarf_debug_loc)
sect_type = eSectionTypeDWARFDebugLoc;
+ else if (name == g_sect_name_dwarf_debug_loclists)
+ sect_type = eSectionTypeDWARFDebugLocLists;
else if (name == g_sect_name_dwarf_debug_macinfo)
sect_type = eSectionTypeDWARFDebugMacInfo;
else if (name == g_sect_name_dwarf_debug_macro)
sect_type = eSectionTypeDWARFDebugMacro;
else if (name == g_sect_name_dwarf_debug_loc_dwo)
sect_type = eSectionTypeDWARFDebugLoc;
+ else if (name == g_sect_name_dwarf_debug_loclists_dwo)
+ sect_type = eSectionTypeDWARFDebugLocLists;
else if (name == g_sect_name_dwarf_debug_str_dwo)
sect_type = eSectionTypeDWARFDebugStr;
else if (name == g_sect_name_dwarf_debug_str_offsets_dwo)
case eSectionTypeDWARFDebugLine:
case eSectionTypeDWARFDebugLineStr:
case eSectionTypeDWARFDebugLoc:
+ case eSectionTypeDWARFDebugLocLists:
case eSectionTypeDWARFDebugMacInfo:
case eSectionTypeDWARFDebugMacro:
case eSectionTypeDWARFDebugNames:
static ConstString g_sect_name_dwarf_debug_info("__debug_info");
static ConstString g_sect_name_dwarf_debug_line("__debug_line");
static ConstString g_sect_name_dwarf_debug_loc("__debug_loc");
+ static ConstString g_sect_name_dwarf_debug_loclists("__debug_loclists");
static ConstString g_sect_name_dwarf_debug_macinfo("__debug_macinfo");
static ConstString g_sect_name_dwarf_debug_names("__debug_names");
static ConstString g_sect_name_dwarf_debug_pubnames("__debug_pubnames");
return eSectionTypeDWARFDebugLine;
if (section_name == g_sect_name_dwarf_debug_loc)
return eSectionTypeDWARFDebugLoc;
+ if (section_name == g_sect_name_dwarf_debug_loclists)
+ return eSectionTypeDWARFDebugLocLists;
if (section_name == g_sect_name_dwarf_debug_macinfo)
return eSectionTypeDWARFDebugMacInfo;
if (section_name == g_sect_name_dwarf_debug_names)
static ConstString g_sect_name_dwarf_debug_info(".debug_info");
static ConstString g_sect_name_dwarf_debug_line(".debug_line");
static ConstString g_sect_name_dwarf_debug_loc(".debug_loc");
+ static ConstString g_sect_name_dwarf_debug_loclists(".debug_loclists");
static ConstString g_sect_name_dwarf_debug_macinfo(".debug_macinfo");
static ConstString g_sect_name_dwarf_debug_names(".debug_names");
static ConstString g_sect_name_dwarf_debug_pubnames(".debug_pubnames");
section_type = eSectionTypeDWARFDebugLine;
else if (const_sect_name == g_sect_name_dwarf_debug_loc)
section_type = eSectionTypeDWARFDebugLoc;
+ else if (const_sect_name == g_sect_name_dwarf_debug_loclists)
+ section_type = eSectionTypeDWARFDebugLocLists;
else if (const_sect_name == g_sect_name_dwarf_debug_macinfo)
section_type = eSectionTypeDWARFDebugMacInfo;
else if (const_sect_name == g_sect_name_dwarf_debug_names)
block_length);
} else {
const DWARFDataExtractor &debug_loc_data =
- dwarf2Data->get_debug_loc_data();
+ dwarf2Data->DebugLocData();
const dw_offset_t debug_loc_offset = form_value.Unsigned();
size_t loc_list_length = DWARFExpression::LocationListSize(
uint64_t debug_loc_offset = form_value.Unsigned();
if (dwarf2Data) {
DWARFExpression::PrintDWARFLocationList(
- s, cu, dwarf2Data->get_debug_loc_data(), debug_loc_offset);
+ s, cu, dwarf2Data->DebugLocData(), debug_loc_offset);
}
}
} break;
return GetCachedSectionData(eSectionTypeDWARFDebugMacro, m_data_debug_macro);
}
+const DWARFDataExtractor &SymbolFileDWARF::DebugLocData() {
+ const DWARFDataExtractor &debugLocData = get_debug_loc_data();
+ if (debugLocData.GetByteSize() > 0)
+ return debugLocData;
+ return get_debug_loclists_data();
+}
+
const DWARFDataExtractor &SymbolFileDWARF::get_debug_loc_data() {
return GetCachedSectionData(eSectionTypeDWARFDebugLoc, m_data_debug_loc);
}
+const DWARFDataExtractor &SymbolFileDWARF::get_debug_loclists_data() {
+ return GetCachedSectionData(eSectionTypeDWARFDebugLocLists,
+ m_data_debug_loclists);
+}
+
const DWARFDataExtractor &SymbolFileDWARF::get_debug_ranges_data() {
return GetCachedSectionData(eSectionTypeDWARFDebugRanges,
m_data_debug_ranges);
uint32_t block_length = form_value.Unsigned();
location.CopyOpcodeData(module, data, block_offset, block_length);
} else {
- const DWARFDataExtractor &debug_loc_data = get_debug_loc_data();
+ const DWARFDataExtractor &debug_loc_data = DebugLocData();
const dw_offset_t debug_loc_offset = form_value.Unsigned();
size_t loc_list_length = DWARFExpression::LocationListSize(
DWARFExpression::LocationListFormat
SymbolFileDWARF::GetLocationListFormat() const {
+ if (m_data_debug_loclists.m_data.GetByteSize() > 0)
+ return DWARFExpression::LocLists;
return DWARFExpression::RegularLocationList;
}
const lldb_private::DWARFDataExtractor &get_debug_line_str_data();
const lldb_private::DWARFDataExtractor &get_debug_macro_data();
const lldb_private::DWARFDataExtractor &get_debug_loc_data();
+ const lldb_private::DWARFDataExtractor &get_debug_loclists_data();
const lldb_private::DWARFDataExtractor &get_debug_ranges_data();
const lldb_private::DWARFDataExtractor &get_debug_rnglists_data();
const lldb_private::DWARFDataExtractor &get_debug_str_data();
const DWARFDebugRanges *DebugRanges() const;
+ const lldb_private::DWARFDataExtractor &DebugLocData();
+
static bool SupportedVersion(uint16_t version);
DWARFDIE
DWARFDataSegment m_data_debug_line_str;
DWARFDataSegment m_data_debug_macro;
DWARFDataSegment m_data_debug_loc;
+ DWARFDataSegment m_data_debug_loclists;
DWARFDataSegment m_data_debug_ranges;
DWARFDataSegment m_data_debug_rnglists;
DWARFDataSegment m_data_debug_str;
case lldb::eSectionTypeDWARFDebugLine:
return llvm::DW_SECT_LINE;
case lldb::eSectionTypeDWARFDebugLoc:
- return llvm::DW_SECT_LOC;
+ return llvm::DW_SECT_LOC;
case lldb::eSectionTypeDWARFDebugStrOffsets:
return llvm::DW_SECT_STR_OFFSETS;
// case lldb::eSectionTypeDWARFDebugMacinfo:
case eSectionTypeDWARFDebugLine:
case eSectionTypeDWARFDebugLineStr:
case eSectionTypeDWARFDebugLoc:
+ case eSectionTypeDWARFDebugLocLists:
case eSectionTypeDWARFDebugMacInfo:
case eSectionTypeDWARFDebugMacro:
case eSectionTypeDWARFDebugNames: