Move the codebase to use: DWARFCompileUnit -> DWARFUnit

Now the codebase can use the DWARFUnit superclass. It will make it later
seamlessly work also with DWARFPartialUnit for DWZ.

This patch is only a search-and-replace easily undone, nothing interesting
in it.

Differential revision: https://reviews.llvm.org/D42892

llvm-svn: 327810
This commit is contained in:
Jan Kratochvil 2018-03-18 20:11:02 +00:00
parent 2ccddfe3c6
commit c4d65751df
27 changed files with 222 additions and 222 deletions

View File

@ -18,7 +18,7 @@
#include "lldb/lldb-private.h" #include "lldb/lldb-private.h"
#include <functional> #include <functional>
class DWARFCompileUnit; class DWARFUnit;
namespace lldb_private { namespace lldb_private {
@ -46,7 +46,7 @@ public:
//------------------------------------------------------------------ //------------------------------------------------------------------
/// Constructor /// Constructor
//------------------------------------------------------------------ //------------------------------------------------------------------
explicit DWARFExpression(DWARFCompileUnit *dwarf_cu); explicit DWARFExpression(DWARFUnit *dwarf_cu);
//------------------------------------------------------------------ //------------------------------------------------------------------
/// Constructor /// Constructor
@ -62,7 +62,7 @@ public:
/// The byte length of the location expression. /// The byte length of the location expression.
//------------------------------------------------------------------ //------------------------------------------------------------------
DWARFExpression(lldb::ModuleSP module, const DataExtractor &data, DWARFExpression(lldb::ModuleSP module, const DataExtractor &data,
DWARFCompileUnit *dwarf_cu, lldb::offset_t data_offset, DWARFUnit *dwarf_cu, lldb::offset_t data_offset,
lldb::offset_t data_length); lldb::offset_t data_length);
//------------------------------------------------------------------ //------------------------------------------------------------------
@ -332,7 +332,7 @@ public:
//------------------------------------------------------------------ //------------------------------------------------------------------
static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes, lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes,
DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset, DWARFUnit *dwarf_cu, const lldb::offset_t offset,
const lldb::offset_t length, const lldb::offset_t length,
const lldb::RegisterKind reg_set, const lldb::RegisterKind reg_set,
const Value *initial_value_ptr, const Value *initial_value_ptr,
@ -348,7 +348,7 @@ public:
lldb::addr_t loclist_base_load_addr, lldb::addr_t loclist_base_load_addr,
lldb::addr_t address, ABI *abi); lldb::addr_t address, ABI *abi);
static size_t LocationListSize(const DWARFCompileUnit *dwarf_cu, static size_t LocationListSize(const DWARFUnit *dwarf_cu,
const DataExtractor &debug_loc_data, const DataExtractor &debug_loc_data,
lldb::offset_t offset); lldb::offset_t offset);
@ -356,7 +356,7 @@ public:
int address_size, int dwarf_ref_size, int address_size, int dwarf_ref_size,
bool location_expression); bool location_expression);
static void PrintDWARFLocationList(Stream &s, const DWARFCompileUnit *cu, static void PrintDWARFLocationList(Stream &s, const DWARFUnit *cu,
const DataExtractor &debug_loc_data, const DataExtractor &debug_loc_data,
lldb::offset_t offset); lldb::offset_t offset);
@ -389,7 +389,7 @@ protected:
lldb::offset_t &offset, lldb::offset_t &len); lldb::offset_t &offset, lldb::offset_t &len);
static bool AddressRangeForLocationListEntry( static bool AddressRangeForLocationListEntry(
const DWARFCompileUnit *dwarf_cu, const DataExtractor &debug_loc_data, const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data,
lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc); lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc);
bool GetOpAndEndOffsets(StackFrame &frame, lldb::offset_t &op_offset, bool GetOpAndEndOffsets(StackFrame &frame, lldb::offset_t &op_offset,
@ -401,7 +401,7 @@ protected:
lldb::ModuleWP m_module_wp; ///< Module which defined this expression. lldb::ModuleWP m_module_wp; ///< Module which defined this expression.
DataExtractor m_data; ///< A data extractor capable of reading opcode bytes DataExtractor m_data; ///< A data extractor capable of reading opcode bytes
DWARFCompileUnit *m_dwarf_cu; ///< The DWARF compile unit this expression DWARFUnit *m_dwarf_cu; ///< The DWARF compile unit this expression
///belongs to. It is used ///belongs to. It is used
///< to evaluate values indexing into the .debug_addr section (e.g. ///< to evaluate values indexing into the .debug_addr section (e.g.
///< DW_OP_GNU_addr_index, DW_OP_GNU_const_index) ///< DW_OP_GNU_addr_index, DW_OP_GNU_const_index)

View File

@ -37,13 +37,13 @@
#include "lldb/Target/StackID.h" #include "lldb/Target/StackID.h"
#include "lldb/Target/Thread.h" #include "lldb/Target/Thread.h"
#include "Plugins/SymbolFile/DWARF/DWARFCompileUnit.h" #include "Plugins/SymbolFile/DWARF/DWARFUnit.h"
using namespace lldb; using namespace lldb;
using namespace lldb_private; using namespace lldb_private;
static lldb::addr_t static lldb::addr_t
ReadAddressFromDebugAddrSection(const DWARFCompileUnit *dwarf_cu, ReadAddressFromDebugAddrSection(const DWARFUnit *dwarf_cu,
uint32_t index) { uint32_t index) {
uint32_t index_size = dwarf_cu->GetAddressByteSize(); uint32_t index_size = dwarf_cu->GetAddressByteSize();
dw_offset_t addr_base = dwarf_cu->GetAddrBase(); dw_offset_t addr_base = dwarf_cu->GetAddrBase();
@ -55,7 +55,7 @@ ReadAddressFromDebugAddrSection(const DWARFCompileUnit *dwarf_cu,
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// DWARFExpression constructor // DWARFExpression constructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
DWARFExpression::DWARFExpression(DWARFCompileUnit *dwarf_cu) DWARFExpression::DWARFExpression(DWARFUnit *dwarf_cu)
: m_module_wp(), m_data(), m_dwarf_cu(dwarf_cu), : m_module_wp(), m_data(), m_dwarf_cu(dwarf_cu),
m_reg_kind(eRegisterKindDWARF), m_loclist_slide(LLDB_INVALID_ADDRESS) {} m_reg_kind(eRegisterKindDWARF), m_loclist_slide(LLDB_INVALID_ADDRESS) {}
@ -66,7 +66,7 @@ DWARFExpression::DWARFExpression(const DWARFExpression &rhs)
DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp, DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp,
const DataExtractor &data, const DataExtractor &data,
DWARFCompileUnit *dwarf_cu, DWARFUnit *dwarf_cu,
lldb::offset_t data_offset, lldb::offset_t data_offset,
lldb::offset_t data_length) lldb::offset_t data_length)
: m_module_wp(), m_data(data, data_offset, data_length), : m_module_wp(), m_data(data, data_offset, data_length),
@ -1323,7 +1323,7 @@ bool DWARFExpression::Evaluate(ExecutionContext *exe_ctx,
bool DWARFExpression::Evaluate( bool DWARFExpression::Evaluate(
ExecutionContext *exe_ctx, RegisterContext *reg_ctx, ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP module_sp, const DataExtractor &opcodes, lldb::ModuleSP module_sp, const DataExtractor &opcodes,
DWARFCompileUnit *dwarf_cu, const lldb::offset_t opcodes_offset, DWARFUnit *dwarf_cu, const lldb::offset_t opcodes_offset,
const lldb::offset_t opcodes_length, const lldb::RegisterKind reg_kind, const lldb::offset_t opcodes_length, const lldb::RegisterKind reg_kind,
const Value *initial_value_ptr, const Value *object_address_ptr, const Value *initial_value_ptr, const Value *object_address_ptr,
Value &result, Status *error_ptr) { Value &result, Status *error_ptr) {
@ -2984,7 +2984,7 @@ bool DWARFExpression::Evaluate(
return true; // Return true on success return true; // Return true on success
} }
size_t DWARFExpression::LocationListSize(const DWARFCompileUnit *dwarf_cu, size_t DWARFExpression::LocationListSize(const DWARFUnit *dwarf_cu,
const DataExtractor &debug_loc_data, const DataExtractor &debug_loc_data,
lldb::offset_t offset) { lldb::offset_t offset) {
const lldb::offset_t debug_loc_offset = offset; const lldb::offset_t debug_loc_offset = offset;
@ -3008,7 +3008,7 @@ size_t DWARFExpression::LocationListSize(const DWARFCompileUnit *dwarf_cu,
} }
bool DWARFExpression::AddressRangeForLocationListEntry( bool DWARFExpression::AddressRangeForLocationListEntry(
const DWARFCompileUnit *dwarf_cu, const DataExtractor &debug_loc_data, const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data,
lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc) { lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc) {
if (!debug_loc_data.ValidOffset(*offset_ptr)) if (!debug_loc_data.ValidOffset(*offset_ptr))
return false; return false;
@ -3242,11 +3242,11 @@ bool DWARFExpression::PrintDWARFExpression(Stream &s, const DataExtractor &data,
} }
void DWARFExpression::PrintDWARFLocationList( void DWARFExpression::PrintDWARFLocationList(
Stream &s, const DWARFCompileUnit *cu, const DataExtractor &debug_loc_data, Stream &s, const DWARFUnit *cu, const DataExtractor &debug_loc_data,
lldb::offset_t offset) { lldb::offset_t offset) {
uint64_t start_addr, end_addr; uint64_t start_addr, end_addr;
uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu); uint32_t addr_size = DWARFUnit::GetAddressByteSize(cu);
s.SetAddressByteSize(DWARFCompileUnit::GetAddressByteSize(cu)); s.SetAddressByteSize(DWARFUnit::GetAddressByteSize(cu));
dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0; dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0;
while (debug_loc_data.ValidOffset(offset)) { while (debug_loc_data.ValidOffset(offset)) {
start_addr = debug_loc_data.GetMaxU64(&offset, addr_size); start_addr = debug_loc_data.GetMaxU64(&offset, addr_size);

View File

@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "DIERef.h" #include "DIERef.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDebugInfo.h" #include "DWARFDebugInfo.h"
#include "DWARFFormValue.h" #include "DWARFFormValue.h"
#include "SymbolFileDWARF.h" #include "SymbolFileDWARF.h"
@ -28,7 +28,7 @@ DIERef::DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf)
if (actual_dwarf) { if (actual_dwarf) {
DWARFDebugInfo *debug_info = actual_dwarf->DebugInfo(); DWARFDebugInfo *debug_info = actual_dwarf->DebugInfo();
if (debug_info) { if (debug_info) {
DWARFCompileUnit *dwarf_cu = DWARFUnit *dwarf_cu =
debug_info->GetCompileUnitContainingDIEOffset(die_offset); debug_info->GetCompileUnitContainingDIEOffset(die_offset);
if (dwarf_cu) { if (dwarf_cu) {
cu_offset = dwarf_cu->GetOffset(); cu_offset = dwarf_cu->GetOffset();
@ -45,7 +45,7 @@ DIERef::DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf)
DIERef::DIERef(const DWARFFormValue &form_value) DIERef::DIERef(const DWARFFormValue &form_value)
: cu_offset(DW_INVALID_OFFSET), die_offset(DW_INVALID_OFFSET) { : cu_offset(DW_INVALID_OFFSET), die_offset(DW_INVALID_OFFSET) {
if (form_value.IsValid()) { if (form_value.IsValid()) {
const DWARFCompileUnit *dwarf_cu = form_value.GetCompileUnit(); const DWARFUnit *dwarf_cu = form_value.GetCompileUnit();
if (dwarf_cu) { if (dwarf_cu) {
if (dwarf_cu->GetBaseObjOffset() != DW_INVALID_OFFSET) if (dwarf_cu->GetBaseObjOffset() != DW_INVALID_OFFSET)
cu_offset = dwarf_cu->GetBaseObjOffset(); cu_offset = dwarf_cu->GetBaseObjOffset();

View File

@ -9,7 +9,7 @@
#include "DWARFASTParserJava.h" #include "DWARFASTParserJava.h"
#include "DWARFAttribute.h" #include "DWARFAttribute.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDebugInfoEntry.h" #include "DWARFDebugInfoEntry.h"
#include "DWARFDebugInfoEntry.h" #include "DWARFDebugInfoEntry.h"
#include "DWARFDeclContext.h" #include "DWARFDeclContext.h"
@ -418,7 +418,7 @@ bool DWARFASTParserJava::CompleteTypeFromDWARF(
void DWARFASTParserJava::ParseChildMembers(const DWARFDIE &parent_die, void DWARFASTParserJava::ParseChildMembers(const DWARFDIE &parent_die,
CompilerType &compiler_type) { CompilerType &compiler_type) {
DWARFCompileUnit *dwarf_cu = parent_die.GetCU(); DWARFUnit *dwarf_cu = parent_die.GetCU();
for (DWARFDIE die = parent_die.GetFirstChild(); die.IsValid(); for (DWARFDIE die = parent_die.GetFirstChild(); die.IsValid();
die = die.GetSibling()) { die = die.GetSibling()) {
switch (die.Tag()) { switch (die.Tag()) {

View File

@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "DWARFAttribute.h" #include "DWARFAttribute.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDebugInfo.h" #include "DWARFDebugInfo.h"
DWARFAttributes::DWARFAttributes() : m_infos() {} DWARFAttributes::DWARFAttributes() : m_infos() {}
@ -26,7 +26,7 @@ uint32_t DWARFAttributes::FindAttributeIndex(dw_attr_t attr) const {
return UINT32_MAX; return UINT32_MAX;
} }
void DWARFAttributes::Append(const DWARFCompileUnit *cu, void DWARFAttributes::Append(const DWARFUnit *cu,
dw_offset_t attr_die_offset, dw_attr_t attr, dw_offset_t attr_die_offset, dw_attr_t attr,
dw_form_t form) { dw_form_t form) {
AttributeValue attr_value = {cu, attr_die_offset, {attr, form}}; AttributeValue attr_value = {cu, attr_die_offset, {attr, form}};
@ -48,7 +48,7 @@ bool DWARFAttributes::RemoveAttribute(dw_attr_t attr) {
bool DWARFAttributes::ExtractFormValueAtIndex( bool DWARFAttributes::ExtractFormValueAtIndex(
uint32_t i, DWARFFormValue &form_value) const { uint32_t i, DWARFFormValue &form_value) const {
const DWARFCompileUnit *cu = CompileUnitAtIndex(i); const DWARFUnit *cu = CompileUnitAtIndex(i);
form_value.SetCompileUnit(cu); form_value.SetCompileUnit(cu);
form_value.SetForm(FormAtIndex(i)); form_value.SetForm(FormAtIndex(i));
lldb::offset_t offset = DIEOffsetAtIndex(i); lldb::offset_t offset = DIEOffsetAtIndex(i);

View File

@ -14,7 +14,7 @@
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include <vector> #include <vector>
class DWARFCompileUnit; class DWARFUnit;
class DWARFFormValue; class DWARFFormValue;
class DWARFAttribute { class DWARFAttribute {
@ -50,9 +50,9 @@ public:
DWARFAttributes(); DWARFAttributes();
~DWARFAttributes(); ~DWARFAttributes();
void Append(const DWARFCompileUnit *cu, dw_offset_t attr_die_offset, void Append(const DWARFUnit *cu, dw_offset_t attr_die_offset,
dw_attr_t attr, dw_form_t form); dw_attr_t attr, dw_form_t form);
const DWARFCompileUnit *CompileUnitAtIndex(uint32_t i) const { const DWARFUnit *CompileUnitAtIndex(uint32_t i) const {
return m_infos[i].cu; return m_infos[i].cu;
} }
dw_offset_t DIEOffsetAtIndex(uint32_t i) const { dw_offset_t DIEOffsetAtIndex(uint32_t i) const {
@ -73,7 +73,7 @@ public:
protected: protected:
struct AttributeValue { struct AttributeValue {
const DWARFCompileUnit *cu; // Keep the compile unit with each attribute in const DWARFUnit *cu; // Keep the compile unit with each attribute in
// case we have DW_FORM_ref_addr values // case we have DW_FORM_ref_addr values
dw_offset_t die_offset; dw_offset_t die_offset;
DWARFAttribute attr; DWARFAttribute attr;

View File

@ -40,9 +40,10 @@ extern int g_verbose;
DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF *dwarf2Data) DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF *dwarf2Data)
: m_dwarf2Data(dwarf2Data) {} : m_dwarf2Data(dwarf2Data) {}
DWARFCompileUnitSP DWARFCompileUnit::Extract(SymbolFileDWARF *dwarf2Data, DWARFUnitSP DWARFCompileUnit::Extract(SymbolFileDWARF *dwarf2Data,
lldb::offset_t *offset_ptr) { lldb::offset_t *offset_ptr) {
DWARFCompileUnitSP cu_sp(new DWARFCompileUnit(dwarf2Data)); // std::make_shared would require the ctor to be public.
std::shared_ptr<DWARFCompileUnit> cu_sp(new DWARFCompileUnit(dwarf2Data));
// Out of memory? // Out of memory?
if (cu_sp.get() == NULL) if (cu_sp.get() == NULL)
return nullptr; return nullptr;
@ -249,7 +250,7 @@ size_t DWARFCompileUnit::ExtractDIEsIfNeeded(bool cu_die_only) {
if (!m_dwo_symbol_file) if (!m_dwo_symbol_file)
return m_die_array.size(); return m_die_array.size();
DWARFCompileUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit(); DWARFUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit();
size_t dwo_die_count = dwo_cu->ExtractDIEsIfNeeded(cu_die_only); size_t dwo_die_count = dwo_cu->ExtractDIEsIfNeeded(cu_die_only);
return m_die_array.size() + dwo_die_count - return m_die_array.size() + dwo_die_count -
1; // We have 2 CU die, but we want to count it only as one 1; // We have 2 CU die, but we want to count it only as one
@ -265,7 +266,7 @@ void DWARFCompileUnit::AddCompileUnitDIE(DWARFDebugInfoEntry &die) {
if (!dwo_symbol_file) if (!dwo_symbol_file)
return; return;
DWARFCompileUnit *dwo_cu = dwo_symbol_file->GetCompileUnit(); DWARFUnit *dwo_cu = dwo_symbol_file->GetCompileUnit();
if (!dwo_cu) if (!dwo_cu)
return; // Can't fetch the compile unit from the dwo file. return; // Can't fetch the compile unit from the dwo file.
@ -466,7 +467,7 @@ const DWARFDebugAranges &DWARFCompileUnit::GetFunctionAranges() {
m_func_aranges_ap.get()); m_func_aranges_ap.get());
if (m_dwo_symbol_file) { if (m_dwo_symbol_file) {
DWARFCompileUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit(); DWARFUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit();
const DWARFDebugInfoEntry *dwo_die = dwo_cu->DIEPtr(); const DWARFDebugInfoEntry *dwo_die = dwo_cu->DIEPtr();
if (dwo_die) if (dwo_die)
dwo_die->BuildFunctionAddressRangeTable(m_dwo_symbol_file.get(), dwo_cu, dwo_die->BuildFunctionAddressRangeTable(m_dwo_symbol_file.get(), dwo_cu,

View File

@ -12,13 +12,11 @@
#include "DWARFUnit.h" #include "DWARFUnit.h"
typedef std::shared_ptr<DWARFCompileUnit> DWARFCompileUnitSP;
class DWARFCompileUnit : public DWARFUnit { class DWARFCompileUnit : public DWARFUnit {
friend class DWARFUnit; friend class DWARFUnit;
public: public:
static DWARFCompileUnitSP Extract(SymbolFileDWARF *dwarf2Data, static DWARFUnitSP Extract(SymbolFileDWARF *dwarf2Data,
lldb::offset_t *offset_ptr); lldb::offset_t *offset_ptr);
size_t ExtractDIEsIfNeeded(bool cu_die_only); size_t ExtractDIEsIfNeeded(bool cu_die_only);

View File

@ -10,7 +10,7 @@
#include "DWARFDIE.h" #include "DWARFDIE.h"
#include "DWARFASTParser.h" #include "DWARFASTParser.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDIECollection.h" #include "DWARFDIECollection.h"
#include "DWARFDebugAbbrev.h" #include "DWARFDebugAbbrev.h"
#include "DWARFDebugAranges.h" #include "DWARFDebugAranges.h"
@ -121,7 +121,7 @@ int64_t DWARFDIE::GetAttributeValueAsSigned(const dw_attr_t attr,
DWARFDIE DWARFDIE
DWARFDIE::GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const { DWARFDIE::GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const {
if (IsValid()) { if (IsValid()) {
DWARFCompileUnit *cu = GetCU(); DWARFUnit *cu = GetCU();
SymbolFileDWARF *dwarf = cu->GetSymbolFileDWARF(); SymbolFileDWARF *dwarf = cu->GetSymbolFileDWARF();
const bool check_specification_or_abstract_origin = true; const bool check_specification_or_abstract_origin = true;
DWARFFormValue form_value; DWARFFormValue form_value;
@ -154,7 +154,7 @@ DWARFDIE
DWARFDIE::LookupDeepestBlock(lldb::addr_t file_addr) const { DWARFDIE::LookupDeepestBlock(lldb::addr_t file_addr) const {
if (IsValid()) { if (IsValid()) {
SymbolFileDWARF *dwarf = GetDWARF(); SymbolFileDWARF *dwarf = GetDWARF();
DWARFCompileUnit *cu = GetCU(); DWARFUnit *cu = GetCU();
DWARFDebugInfoEntry *function_die = nullptr; DWARFDebugInfoEntry *function_die = nullptr;
DWARFDebugInfoEntry *block_die = nullptr; DWARFDebugInfoEntry *block_die = nullptr;
if (m_die->LookupAddress(file_addr, dwarf, cu, &function_die, &block_die)) { if (m_die->LookupAddress(file_addr, dwarf, cu, &function_die, &block_die)) {

View File

@ -16,7 +16,7 @@
struct DIERef; struct DIERef;
class DWARFASTParser; class DWARFASTParser;
class DWARFAttributes; class DWARFAttributes;
class DWARFCompileUnit; class DWARFUnit;
class DWARFDebugInfoEntry; class DWARFDebugInfoEntry;
class DWARFDeclContext; class DWARFDeclContext;
class DWARFDIECollection; class DWARFDIECollection;
@ -26,17 +26,17 @@ class DWARFDIE {
public: public:
DWARFDIE() : m_cu(nullptr), m_die(nullptr) {} DWARFDIE() : m_cu(nullptr), m_die(nullptr) {}
DWARFDIE(DWARFCompileUnit *cu, DWARFDebugInfoEntry *die) DWARFDIE(DWARFUnit *cu, DWARFDebugInfoEntry *die)
: m_cu(cu), m_die(die) {} : m_cu(cu), m_die(die) {}
DWARFDIE(const DWARFCompileUnit *cu, DWARFDebugInfoEntry *die) DWARFDIE(const DWARFUnit *cu, DWARFDebugInfoEntry *die)
: m_cu(const_cast<DWARFCompileUnit *>(cu)), m_die(die) {} : m_cu(const_cast<DWARFUnit *>(cu)), m_die(die) {}
DWARFDIE(DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die) DWARFDIE(DWARFUnit *cu, const DWARFDebugInfoEntry *die)
: m_cu(cu), m_die(const_cast<DWARFDebugInfoEntry *>(die)) {} : m_cu(cu), m_die(const_cast<DWARFDebugInfoEntry *>(die)) {}
DWARFDIE(const DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die) DWARFDIE(const DWARFUnit *cu, const DWARFDebugInfoEntry *die)
: m_cu(const_cast<DWARFCompileUnit *>(cu)), : m_cu(const_cast<DWARFUnit *>(cu)),
m_die(const_cast<DWARFDebugInfoEntry *>(die)) {} m_die(const_cast<DWARFDebugInfoEntry *>(die)) {}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -57,7 +57,7 @@ public:
//---------------------------------------------------------------------- //----------------------------------------------------------------------
SymbolFileDWARF *GetDWARF() const; SymbolFileDWARF *GetDWARF() const;
DWARFCompileUnit *GetCU() const { return m_cu; } DWARFUnit *GetCU() const { return m_cu; }
DWARFDebugInfoEntry *GetDIE() const { return m_die; } DWARFDebugInfoEntry *GetDIE() const { return m_die; }
@ -67,7 +67,7 @@ public:
DWARFASTParser *GetDWARFParser() const; DWARFASTParser *GetDWARFParser() const;
void Set(DWARFCompileUnit *cu, DWARFDebugInfoEntry *die) { void Set(DWARFUnit *cu, DWARFDebugInfoEntry *die) {
if (cu && die) { if (cu && die) {
m_cu = cu; m_cu = cu;
m_die = die; m_die = die;
@ -211,7 +211,7 @@ public:
lldb_private::CompilerDeclContext GetContainingDeclContext() const; lldb_private::CompilerDeclContext GetContainingDeclContext() const;
protected: protected:
DWARFCompileUnit *m_cu; DWARFUnit *m_cu;
DWARFDebugInfoEntry *m_die; DWARFDebugInfoEntry *m_die;
}; };

View File

@ -18,7 +18,7 @@
#include "lldb/Utility/Stream.h" #include "lldb/Utility/Stream.h"
#include "lldb/Utility/Timer.h" #include "lldb/Utility/Timer.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDebugInfo.h" #include "DWARFDebugInfo.h"
#include "LogChannelDWARF.h" #include "LogChannelDWARF.h"
#include "SymbolFileDWARF.h" #include "SymbolFileDWARF.h"
@ -82,7 +82,7 @@ bool DWARFDebugAranges::Generate(SymbolFileDWARF *dwarf2Data) {
uint32_t cu_idx = 0; uint32_t cu_idx = 0;
const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits(); const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits();
for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) { for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
DWARFCompileUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx); DWARFUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (cu) if (cu)
cu->BuildAddressRangeTable(dwarf2Data, this); cu->BuildAddressRangeTable(dwarf2Data, this);
} }

View File

@ -72,7 +72,7 @@ DWARFDebugAranges &DWARFDebugInfo::GetCompileUnitAranges() {
bool printed = false; bool printed = false;
const size_t num_compile_units = GetNumCompileUnits(); const size_t num_compile_units = GetNumCompileUnits();
for (size_t idx = 0; idx < num_compile_units; ++idx) { for (size_t idx = 0; idx < num_compile_units; ++idx) {
DWARFCompileUnit *cu = GetCompileUnitAtIndex(idx); DWARFUnit *cu = GetCompileUnitAtIndex(idx);
dw_offset_t offset = cu->GetOffset(); dw_offset_t offset = cu->GetOffset();
if (cus_with_data.find(offset) == cus_with_data.end()) { if (cus_with_data.find(offset) == cus_with_data.end()) {
@ -97,7 +97,7 @@ void DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() {
if (m_compile_units.empty()) { if (m_compile_units.empty()) {
if (m_dwarf2Data != NULL) { if (m_dwarf2Data != NULL) {
lldb::offset_t offset = 0; lldb::offset_t offset = 0;
DWARFCompileUnitSP cu_sp; DWARFUnitSP cu_sp;
while ((cu_sp = DWARFCompileUnit::Extract(m_dwarf2Data, &offset))) { while ((cu_sp = DWARFCompileUnit::Extract(m_dwarf2Data, &offset))) {
m_compile_units.push_back(cu_sp); m_compile_units.push_back(cu_sp);
@ -112,14 +112,14 @@ size_t DWARFDebugInfo::GetNumCompileUnits() {
return m_compile_units.size(); return m_compile_units.size();
} }
DWARFCompileUnit *DWARFDebugInfo::GetCompileUnitAtIndex(uint32_t idx) { DWARFUnit *DWARFDebugInfo::GetCompileUnitAtIndex(uint32_t idx) {
DWARFCompileUnit *cu = NULL; DWARFUnit *cu = NULL;
if (idx < GetNumCompileUnits()) if (idx < GetNumCompileUnits())
cu = m_compile_units[idx].get(); cu = m_compile_units[idx].get();
return cu; return cu;
} }
bool DWARFDebugInfo::ContainsCompileUnit(const DWARFCompileUnit *cu) const { bool DWARFDebugInfo::ContainsCompileUnit(const DWARFUnit *cu) const {
// Not a verify efficient function, but it is handy for use in assertions // Not a verify efficient function, but it is handy for use in assertions
// to make sure that a compile unit comes from a debug information file. // to make sure that a compile unit comes from a debug information file.
CompileUnitColl::const_iterator end_pos = m_compile_units.end(); CompileUnitColl::const_iterator end_pos = m_compile_units.end();
@ -133,13 +133,13 @@ bool DWARFDebugInfo::ContainsCompileUnit(const DWARFCompileUnit *cu) const {
} }
bool DWARFDebugInfo::OffsetLessThanCompileUnitOffset( bool DWARFDebugInfo::OffsetLessThanCompileUnitOffset(
dw_offset_t offset, const DWARFCompileUnitSP &cu_sp) { dw_offset_t offset, const DWARFUnitSP &cu_sp) {
return offset < cu_sp->GetOffset(); return offset < cu_sp->GetOffset();
} }
DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset, DWARFUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset,
uint32_t *idx_ptr) { uint32_t *idx_ptr) {
DWARFCompileUnitSP cu_sp; DWARFUnitSP cu_sp;
uint32_t cu_idx = DW_INVALID_INDEX; uint32_t cu_idx = DW_INVALID_INDEX;
if (cu_offset != DW_INVALID_OFFSET) { if (cu_offset != DW_INVALID_OFFSET) {
ParseCompileUnitHeadersIfNeeded(); ParseCompileUnitHeadersIfNeeded();
@ -170,18 +170,18 @@ DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset,
return cu_sp.get(); return cu_sp.get();
} }
DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) { DWARFUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) {
if (die_ref.cu_offset == DW_INVALID_OFFSET) if (die_ref.cu_offset == DW_INVALID_OFFSET)
return GetCompileUnitContainingDIEOffset(die_ref.die_offset); return GetCompileUnitContainingDIEOffset(die_ref.die_offset);
else else
return GetCompileUnit(die_ref.cu_offset); return GetCompileUnit(die_ref.cu_offset);
} }
DWARFCompileUnit * DWARFUnit *
DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) { DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) {
ParseCompileUnitHeadersIfNeeded(); ParseCompileUnitHeadersIfNeeded();
DWARFCompileUnitSP cu_sp; DWARFUnitSP cu_sp;
// Watch out for single compile unit executable as they are pretty common // Watch out for single compile unit executable as they are pretty common
const size_t num_cus = m_compile_units.size(); const size_t num_cus = m_compile_units.size();
@ -205,7 +205,7 @@ DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) {
DWARFDIE DWARFDIE
DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) { DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) {
DWARFCompileUnit *cu = GetCompileUnitContainingDIEOffset(die_offset); DWARFUnit *cu = GetCompileUnitContainingDIEOffset(die_offset);
if (cu) if (cu)
return cu->GetDIE(die_offset); return cu->GetDIE(die_offset);
return DWARFDIE(); return DWARFDIE();
@ -218,7 +218,7 @@ DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
DWARFDIE DWARFDIE
DWARFDebugInfo::GetDIE(const DIERef &die_ref) { DWARFDebugInfo::GetDIE(const DIERef &die_ref) {
DWARFCompileUnit *cu = GetCompileUnit(die_ref); DWARFUnit *cu = GetCompileUnit(die_ref);
if (cu) if (cu)
return cu->GetDIE(die_ref.die_offset); return cu->GetDIE(die_ref.die_offset);
return DWARFDIE(); // Not found return DWARFDIE(); // Not found
@ -241,7 +241,7 @@ void DWARFDebugInfo::Parse(SymbolFileDWARF *dwarf2Data, Callback callback,
uint32_t depth = 0; uint32_t depth = 0;
DWARFDebugInfoEntry die; DWARFDebugInfoEntry die;
DWARFCompileUnitSP cu; DWARFUnitSP cu;
while ((cu = DWARFCompileUnit::Extract(dwarf2Data, &offset))) { while ((cu = DWARFCompileUnit::Extract(dwarf2Data, &offset))) {
const dw_offset_t next_cu_offset = cu->GetNextCompileUnitOffset(); const dw_offset_t next_cu_offset = cu->GetNextCompileUnitOffset();
@ -308,7 +308,7 @@ typedef struct DumpInfo {
// whether a single DIE is to be dumped (or all of the data). // whether a single DIE is to be dumped (or all of the data).
//---------------------------------------------------------------------- //----------------------------------------------------------------------
static dw_offset_t DumpCallback(SymbolFileDWARF *dwarf2Data, static dw_offset_t DumpCallback(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, DWARFDebugInfoEntry *die, DWARFUnit *cu, DWARFDebugInfoEntry *die,
const dw_offset_t next_offset, const dw_offset_t next_offset,
const uint32_t curr_depth, void *userData) { const uint32_t curr_depth, void *userData) {
DumpInfo *dumpInfo = (DumpInfo *)userData; DumpInfo *dumpInfo = (DumpInfo *)userData;
@ -482,7 +482,7 @@ void DWARFDebugInfo::Dump(Stream *s, const uint32_t die_offset,
uint32_t curr_depth = 0; uint32_t curr_depth = 0;
ParseCompileUnitHeadersIfNeeded(); ParseCompileUnitHeadersIfNeeded();
for (pos = m_compile_units.begin(); pos != m_compile_units.end(); ++pos) { for (pos = m_compile_units.begin(); pos != m_compile_units.end(); ++pos) {
DWARFCompileUnit *cu = pos->get(); DWARFUnit *cu = pos->get();
DumpCallback(m_dwarf2Data, cu, NULL, 0, curr_depth, &dumpInfo); DumpCallback(m_dwarf2Data, cu, NULL, 0, curr_depth, &dumpInfo);
const DWARFDIE die = cu->DIE(); const DWARFDIE die = cu->DIE();

View File

@ -13,7 +13,7 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDIE.h" #include "DWARFDIE.h"
#include "SymbolFileDWARF.h" #include "SymbolFileDWARF.h"
#include "lldb/Core/STLUtils.h" #include "lldb/Core/STLUtils.h"
@ -27,7 +27,7 @@ typedef CStringToDIEMap::const_iterator CStringToDIEMapConstIter;
class DWARFDebugInfo { class DWARFDebugInfo {
public: public:
typedef dw_offset_t (*Callback)(SymbolFileDWARF *dwarf2Data, typedef dw_offset_t (*Callback)(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, DWARFUnit *cu,
DWARFDebugInfoEntry *die, DWARFDebugInfoEntry *die,
const dw_offset_t next_offset, const dw_offset_t next_offset,
const uint32_t depth, void *userData); const uint32_t depth, void *userData);
@ -36,12 +36,11 @@ public:
void SetDwarfData(SymbolFileDWARF *dwarf2Data); void SetDwarfData(SymbolFileDWARF *dwarf2Data);
size_t GetNumCompileUnits(); size_t GetNumCompileUnits();
bool ContainsCompileUnit(const DWARFCompileUnit *cu) const; bool ContainsCompileUnit(const DWARFUnit *cu) const;
DWARFCompileUnit *GetCompileUnitAtIndex(uint32_t idx); DWARFUnit *GetCompileUnitAtIndex(uint32_t idx);
DWARFCompileUnit *GetCompileUnit(dw_offset_t cu_offset, DWARFUnit *GetCompileUnit(dw_offset_t cu_offset, uint32_t *idx_ptr = NULL);
uint32_t *idx_ptr = NULL); DWARFUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset);
DWARFCompileUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset); DWARFUnit *GetCompileUnit(const DIERef &die_ref);
DWARFCompileUnit *GetCompileUnit(const DIERef &die_ref);
DWARFDIE GetDIEForDIEOffset(dw_offset_t die_offset); DWARFDIE GetDIEForDIEOffset(dw_offset_t die_offset);
DWARFDIE GetDIE(const DIERef &die_ref); DWARFDIE GetDIE(const DIERef &die_ref);
@ -63,9 +62,9 @@ public:
protected: protected:
static bool OffsetLessThanCompileUnitOffset(dw_offset_t offset, static bool OffsetLessThanCompileUnitOffset(dw_offset_t offset,
const DWARFCompileUnitSP &cu_sp); const DWARFUnitSP &cu_sp);
typedef std::vector<DWARFCompileUnitSP> CompileUnitColl; typedef std::vector<DWARFUnitSP> CompileUnitColl;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Member variables // Member variables

View File

@ -18,7 +18,7 @@
#include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/Stream.h" #include "lldb/Utility/Stream.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDIECollection.h" #include "DWARFDIECollection.h"
#include "DWARFDebugAbbrev.h" #include "DWARFDebugAbbrev.h"
#include "DWARFDebugAranges.h" #include "DWARFDebugAranges.h"
@ -34,7 +34,7 @@ using namespace std;
extern int g_verbose; extern int g_verbose;
bool DWARFDebugInfoEntry::FastExtract( bool DWARFDebugInfoEntry::FastExtract(
const DWARFDataExtractor &debug_info_data, const DWARFCompileUnit *cu, const DWARFDataExtractor &debug_info_data, const DWARFUnit *cu,
const DWARFFormValue::FixedFormSizes &fixed_form_sizes, const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
lldb::offset_t *offset_ptr) { lldb::offset_t *offset_ptr) {
m_offset = *offset_ptr; m_offset = *offset_ptr;
@ -194,7 +194,7 @@ bool DWARFDebugInfoEntry::FastExtract(
// starting at the given offset // starting at the given offset
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data, bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
lldb::offset_t *offset_ptr) { lldb::offset_t *offset_ptr) {
const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data(); const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data();
// const DWARFDataExtractor& debug_str_data = // const DWARFDataExtractor& debug_str_data =
@ -220,7 +220,7 @@ bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
bool isCompileUnitTag = m_tag == DW_TAG_compile_unit; bool isCompileUnitTag = m_tag == DW_TAG_compile_unit;
if (cu && isCompileUnitTag) if (cu && isCompileUnitTag)
const_cast<DWARFCompileUnit *>(cu)->SetBaseAddress(0); const_cast<DWARFUnit *>(cu)->SetBaseAddress(0);
// Skip all data in the .debug_info for the attributes // Skip all data in the .debug_info for the attributes
const uint32_t numAttributes = abbrevDecl->NumAttributes(); const uint32_t numAttributes = abbrevDecl->NumAttributes();
@ -235,7 +235,7 @@ bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
DWARFFormValue form_value(cu, form); DWARFFormValue form_value(cu, form);
if (form_value.ExtractValue(debug_info_data, &offset)) { if (form_value.ExtractValue(debug_info_data, &offset)) {
if (attr == DW_AT_low_pc || attr == DW_AT_entry_pc) if (attr == DW_AT_low_pc || attr == DW_AT_entry_pc)
const_cast<DWARFCompileUnit *>(cu)->SetBaseAddress( const_cast<DWARFUnit *>(cu)->SetBaseAddress(
form_value.Address()); form_value.Address());
} }
} else { } else {
@ -360,7 +360,7 @@ bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
// all of it's attributes to the specified stream. // all of it's attributes to the specified stream.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void DWARFDebugInfoEntry::DumpAncestry(SymbolFileDWARF *dwarf2Data, void DWARFDebugInfoEntry::DumpAncestry(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
const DWARFDebugInfoEntry *oldest, const DWARFDebugInfoEntry *oldest,
Stream &s, Stream &s,
uint32_t recurse_depth) const { uint32_t recurse_depth) const {
@ -378,7 +378,7 @@ void DWARFDebugInfoEntry::DumpAncestry(SymbolFileDWARF *dwarf2Data,
// attributes. // attributes.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool DWARFDebugInfoEntry::GetDIENamesAndRanges( bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, const char *&name, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const char *&name,
const char *&mangled, DWARFRangeList &ranges, int &decl_file, const char *&mangled, DWARFRangeList &ranges, int &decl_file,
int &decl_line, int &decl_column, int &call_file, int &call_line, int &decl_line, int &decl_column, int &call_file, int &call_line,
int &call_column, DWARFExpression *frame_base) const { int &call_column, DWARFExpression *frame_base) const {
@ -586,7 +586,7 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
// specified stream. // specified stream.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, Stream &s, const DWARFUnit *cu, Stream &s,
uint32_t recurse_depth) const { uint32_t recurse_depth) const {
const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data(); const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data();
lldb::offset_t offset = m_offset; lldb::offset_t offset = m_offset;
@ -639,7 +639,7 @@ void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data,
} }
void DWARFDebugInfoEntry::DumpLocation(SymbolFileDWARF *dwarf2Data, void DWARFDebugInfoEntry::DumpLocation(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, Stream &s) const { DWARFUnit *cu, Stream &s) const {
const DWARFDIE cu_die = cu->GetCompileUnitDIEOnly(); const DWARFDIE cu_die = cu->GetCompileUnitDIEOnly();
const char *cu_name = NULL; const char *cu_name = NULL;
if (cu_die) if (cu_die)
@ -663,7 +663,7 @@ void DWARFDebugInfoEntry::DumpLocation(SymbolFileDWARF *dwarf2Data,
// show enumeration values for attributes, etc). // show enumeration values for attributes, etc).
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void DWARFDebugInfoEntry::DumpAttribute( void DWARFDebugInfoEntry::DumpAttribute(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr,
Stream &s, dw_attr_t attr, dw_form_t form) { Stream &s, dw_attr_t attr, dw_form_t form) {
bool show_form = s.GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm); bool show_form = s.GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm);
@ -714,7 +714,7 @@ void DWARFDebugInfoEntry::DumpAttribute(
(*offset_ptr) - form_value.Unsigned(), (*offset_ptr) - form_value.Unsigned(),
form_value.Unsigned()); form_value.Unsigned());
DWARFExpression::PrintDWARFExpression( DWARFExpression::PrintDWARFExpression(
s, locationData, DWARFCompileUnit::GetAddressByteSize(cu), 4, false); s, locationData, DWARFUnit::GetAddressByteSize(cu), 4, false);
} else { } else {
// We have a location list offset as the value that is // We have a location list offset as the value that is
// the offset into the .debug_loc section that describes // the offset into the .debug_loc section that describes
@ -764,7 +764,7 @@ void DWARFDebugInfoEntry::DumpAttribute(
// take precedence (this can happen for declaration attributes). // take precedence (this can happen for declaration attributes).
//---------------------------------------------------------------------- //----------------------------------------------------------------------
size_t DWARFDebugInfoEntry::GetAttributes( size_t DWARFDebugInfoEntry::GetAttributes(
const DWARFCompileUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes, const DWARFUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes,
DWARFAttributes &attributes, uint32_t curr_depth) const { DWARFAttributes &attributes, uint32_t curr_depth) const {
SymbolFileDWARF *dwarf2Data = nullptr; SymbolFileDWARF *dwarf2Data = nullptr;
const DWARFAbbreviationDeclaration *abbrevDecl = nullptr; const DWARFAbbreviationDeclaration *abbrevDecl = nullptr;
@ -819,7 +819,7 @@ size_t DWARFDebugInfoEntry::GetAttributes(
if (form_value.ExtractValue(debug_info_data, &offset)) { if (form_value.ExtractValue(debug_info_data, &offset)) {
dw_offset_t die_offset = form_value.Reference(); dw_offset_t die_offset = form_value.Reference();
DWARFDIE spec_die = DWARFDIE spec_die =
const_cast<DWARFCompileUnit *>(cu)->GetDIE(die_offset); const_cast<DWARFUnit *>(cu)->GetDIE(die_offset);
if (spec_die) if (spec_die)
spec_die.GetAttributes(attributes, curr_depth + 1); spec_die.GetAttributes(attributes, curr_depth + 1);
} }
@ -846,7 +846,7 @@ size_t DWARFDebugInfoEntry::GetAttributes(
// would be a compile unit header). // would be a compile unit header).
//---------------------------------------------------------------------- //----------------------------------------------------------------------
dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, DWARFFormValue &form_value, const dw_attr_t attr, DWARFFormValue &form_value,
dw_offset_t *end_attr_offset_ptr, dw_offset_t *end_attr_offset_ptr,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
@ -886,7 +886,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
if (check_specification_or_abstract_origin) { if (check_specification_or_abstract_origin) {
if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) { if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) {
DWARFDIE die = DWARFDIE die =
const_cast<DWARFCompileUnit *>(cu)->GetDIE(form_value.Reference()); const_cast<DWARFUnit *>(cu)->GetDIE(form_value.Reference());
if (die) { if (die) {
dw_offset_t die_offset = die.GetDIE()->GetAttributeValue( dw_offset_t die_offset = die.GetDIE()->GetAttributeValue(
die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr, die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr,
@ -898,7 +898,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
if (GetAttributeValue(dwarf2Data, cu, DW_AT_abstract_origin, form_value)) { if (GetAttributeValue(dwarf2Data, cu, DW_AT_abstract_origin, form_value)) {
DWARFDIE die = DWARFDIE die =
const_cast<DWARFCompileUnit *>(cu)->GetDIE(form_value.Reference()); const_cast<DWARFUnit *>(cu)->GetDIE(form_value.Reference());
if (die) { if (die) {
dw_offset_t die_offset = die.GetDIE()->GetAttributeValue( dw_offset_t die_offset = die.GetDIE()->GetAttributeValue(
die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr, die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr,
@ -912,7 +912,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
if (!dwo_symbol_file) if (!dwo_symbol_file)
return 0; return 0;
DWARFCompileUnit *dwo_cu = dwo_symbol_file->GetCompileUnit(); DWARFUnit *dwo_cu = dwo_symbol_file->GetCompileUnit();
if (!dwo_cu) if (!dwo_cu)
return 0; return 0;
@ -934,7 +934,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
// and it's content doesn't change. // and it's content doesn't change.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const char *DWARFDebugInfoEntry::GetAttributeValueAsString( const char *DWARFDebugInfoEntry::GetAttributeValueAsString(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, const char *fail_value, const dw_attr_t attr, const char *fail_value,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value; DWARFFormValue form_value;
@ -950,7 +950,7 @@ const char *DWARFDebugInfoEntry::GetAttributeValueAsString(
// Get the value of an attribute as unsigned and return it. // Get the value of an attribute as unsigned and return it.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value, const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value; DWARFFormValue form_value;
@ -966,7 +966,7 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(
// Get the value of an attribute a signed value and return it. // Get the value of an attribute a signed value and return it.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int64_t DWARFDebugInfoEntry::GetAttributeValueAsSigned( int64_t DWARFDebugInfoEntry::GetAttributeValueAsSigned(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, int64_t fail_value, const dw_attr_t attr, int64_t fail_value,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value; DWARFFormValue form_value;
@ -983,7 +983,7 @@ int64_t DWARFDebugInfoEntry::GetAttributeValueAsSigned(
// unit relative offsets as needed. // unit relative offsets as needed.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference( uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value, const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value; DWARFFormValue form_value;
@ -994,7 +994,7 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference(
} }
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress( uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value, const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value; DWARFFormValue form_value;
@ -1013,7 +1013,7 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress(
// Returns the hi_pc or fail_value. // Returns the hi_pc or fail_value.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t lo_pc, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t lo_pc,
uint64_t fail_value, bool check_specification_or_abstract_origin) const { uint64_t fail_value, bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value; DWARFFormValue form_value;
if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr, if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr,
@ -1037,7 +1037,7 @@ dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC(
// Returns true or sets lo_pc and hi_pc to fail_value. // Returns true or sets lo_pc and hi_pc to fail_value.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool DWARFDebugInfoEntry::GetAttributeAddressRange( bool DWARFDebugInfoEntry::GetAttributeAddressRange(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t &lo_pc, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc,
dw_addr_t &hi_pc, uint64_t fail_value, dw_addr_t &hi_pc, uint64_t fail_value,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
lo_pc = GetAttributeValueAsAddress(dwarf2Data, cu, DW_AT_low_pc, fail_value, lo_pc = GetAttributeValueAsAddress(dwarf2Data, cu, DW_AT_low_pc, fail_value,
@ -1054,7 +1054,7 @@ bool DWARFDebugInfoEntry::GetAttributeAddressRange(
} }
size_t DWARFDebugInfoEntry::GetAttributeAddressRanges( size_t DWARFDebugInfoEntry::GetAttributeAddressRanges(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFRangeList &ranges, bool check_hi_lo_pc, DWARFRangeList &ranges, bool check_hi_lo_pc,
bool check_specification_or_abstract_origin) const { bool check_specification_or_abstract_origin) const {
ranges.Clear(); ranges.Clear();
@ -1087,7 +1087,7 @@ size_t DWARFDebugInfoEntry::GetAttributeAddressRanges(
// else return NULL. // else return NULL.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu) const { const DWARFUnit *cu) const {
return GetAttributeValueAsString(dwarf2Data, cu, DW_AT_name, nullptr, true); return GetAttributeValueAsString(dwarf2Data, cu, DW_AT_name, nullptr, true);
} }
@ -1099,7 +1099,7 @@ const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data,
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const char * const char *
DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
bool substitute_name_allowed) const { bool substitute_name_allowed) const {
const char *name = nullptr; const char *name = nullptr;
@ -1127,7 +1127,7 @@ DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data,
// .debug_pubnames or .debug_pubtypes section. // .debug_pubnames or .debug_pubtypes section.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu) const { const DWARFUnit *cu) const {
const char *name = nullptr; const char *name = nullptr;
if (!dwarf2Data) if (!dwarf2Data)
return name; return name;
@ -1156,7 +1156,7 @@ const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data,
// then nothing is printed. // then nothing is printed.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
const dw_offset_t die_offset, Stream &s) { const dw_offset_t die_offset, Stream &s) {
if (dwarf2Data == NULL) { if (dwarf2Data == NULL) {
s.PutCString("NULL"); s.PutCString("NULL");
@ -1190,7 +1190,7 @@ bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data,
// a type identifier. // a type identifier.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
const dw_offset_t die_offset, const dw_offset_t die_offset,
Stream &s) { Stream &s) {
if (dwarf2Data == NULL) { if (dwarf2Data == NULL) {
@ -1318,7 +1318,7 @@ bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data,
// BuildAddressRangeTable // BuildAddressRangeTable
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void DWARFDebugInfoEntry::BuildAddressRangeTable( void DWARFDebugInfoEntry::BuildAddressRangeTable(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const { DWARFDebugAranges *debug_aranges) const {
if (m_tag) { if (m_tag) {
if (m_tag == DW_TAG_subprogram) { if (m_tag == DW_TAG_subprogram) {
@ -1349,7 +1349,7 @@ void DWARFDebugInfoEntry::BuildAddressRangeTable(
// standard .debug_aranges section does it). // standard .debug_aranges section does it).
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable( void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const { DWARFDebugAranges *debug_aranges) const {
if (m_tag) { if (m_tag) {
if (m_tag == DW_TAG_subprogram) { if (m_tag == DW_TAG_subprogram) {
@ -1372,14 +1372,14 @@ void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
} }
void DWARFDebugInfoEntry::GetDeclContextDIEs( void DWARFDebugInfoEntry::GetDeclContextDIEs(
DWARFCompileUnit *cu, DWARFDIECollection &decl_context_dies) const { DWARFUnit *cu, DWARFDIECollection &decl_context_dies) const {
DWARFDIE die(cu, const_cast<DWARFDebugInfoEntry *>(this)); DWARFDIE die(cu, const_cast<DWARFDebugInfoEntry *>(this));
die.GetDeclContextDIEs(decl_context_dies); die.GetDeclContextDIEs(decl_context_dies);
} }
void DWARFDebugInfoEntry::GetDWARFDeclContext( void DWARFDebugInfoEntry::GetDWARFDeclContext(
SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
DWARFDeclContext &dwarf_decl_ctx) const { DWARFDeclContext &dwarf_decl_ctx) const {
const dw_tag_t tag = Tag(); const dw_tag_t tag = Tag();
if (tag != DW_TAG_compile_unit) { if (tag != DW_TAG_compile_unit) {
@ -1395,7 +1395,7 @@ void DWARFDebugInfoEntry::GetDWARFDeclContext(
} }
bool DWARFDebugInfoEntry::MatchesDWARFDeclContext( bool DWARFDebugInfoEntry::MatchesDWARFDeclContext(
SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
const DWARFDeclContext &dwarf_decl_ctx) const { const DWARFDeclContext &dwarf_decl_ctx) const {
DWARFDeclContext this_dwarf_decl_ctx; DWARFDeclContext this_dwarf_decl_ctx;
@ -1405,7 +1405,7 @@ bool DWARFDebugInfoEntry::MatchesDWARFDeclContext(
DWARFDIE DWARFDIE
DWARFDebugInfoEntry::GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data, DWARFDebugInfoEntry::GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu) const { DWARFUnit *cu) const {
DWARFAttributes attributes; DWARFAttributes attributes;
GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes); GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes);
return GetParentDeclContextDIE(dwarf2Data, cu, attributes); return GetParentDeclContextDIE(dwarf2Data, cu, attributes);
@ -1413,7 +1413,7 @@ DWARFDebugInfoEntry::GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
DWARFDIE DWARFDIE
DWARFDebugInfoEntry::GetParentDeclContextDIE( DWARFDebugInfoEntry::GetParentDeclContextDIE(
SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
const DWARFAttributes &attributes) const { const DWARFAttributes &attributes) const {
DWARFDIE die(cu, const_cast<DWARFDebugInfoEntry *>(this)); DWARFDIE die(cu, const_cast<DWARFDebugInfoEntry *>(this));
@ -1465,7 +1465,7 @@ DWARFDebugInfoEntry::GetParentDeclContextDIE(
} }
const char *DWARFDebugInfoEntry::GetQualifiedName(SymbolFileDWARF *dwarf2Data, const char *DWARFDebugInfoEntry::GetQualifiedName(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, DWARFUnit *cu,
std::string &storage) const { std::string &storage) const {
DWARFAttributes attributes; DWARFAttributes attributes;
GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes); GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes);
@ -1473,7 +1473,7 @@ const char *DWARFDebugInfoEntry::GetQualifiedName(SymbolFileDWARF *dwarf2Data,
} }
const char *DWARFDebugInfoEntry::GetQualifiedName( const char *DWARFDebugInfoEntry::GetQualifiedName(
SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
const DWARFAttributes &attributes, std::string &storage) const { const DWARFAttributes &attributes, std::string &storage) const {
const char *name = GetName(dwarf2Data, cu); const char *name = GetName(dwarf2Data, cu);
@ -1529,7 +1529,7 @@ const char *DWARFDebugInfoEntry::GetQualifiedName(
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address, bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
SymbolFileDWARF *dwarf2Data, SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
DWARFDebugInfoEntry **function_die, DWARFDebugInfoEntry **function_die,
DWARFDebugInfoEntry **block_die) { DWARFDebugInfoEntry **block_die) {
bool found_address = false; bool found_address = false;
@ -1772,7 +1772,7 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
const DWARFAbbreviationDeclaration * const DWARFAbbreviationDeclaration *
DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr( DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
lldb::offset_t &offset) const { lldb::offset_t &offset) const {
if (dwarf2Data) { if (dwarf2Data) {
offset = GetOffset(); offset = GetOffset();

View File

@ -61,127 +61,127 @@ public:
m_tag(0) {} m_tag(0) {}
void BuildAddressRangeTable(SymbolFileDWARF *dwarf2Data, void BuildAddressRangeTable(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const; DWARFDebugAranges *debug_aranges) const;
void BuildFunctionAddressRangeTable(SymbolFileDWARF *dwarf2Data, void BuildFunctionAddressRangeTable(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const; DWARFDebugAranges *debug_aranges) const;
bool FastExtract(const lldb_private::DWARFDataExtractor &debug_info_data, bool FastExtract(const lldb_private::DWARFDataExtractor &debug_info_data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
const DWARFFormValue::FixedFormSizes &fixed_form_sizes, const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
lldb::offset_t *offset_ptr); lldb::offset_t *offset_ptr);
bool Extract(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, bool Extract(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
lldb::offset_t *offset_ptr); lldb::offset_t *offset_ptr);
bool LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data, bool LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
DWARFDebugInfoEntry **function_die, DWARFDebugInfoEntry **function_die,
DWARFDebugInfoEntry **block_die); DWARFDebugInfoEntry **block_die);
size_t GetAttributes(const DWARFCompileUnit *cu, size_t GetAttributes(const DWARFUnit *cu,
DWARFFormValue::FixedFormSizes fixed_form_sizes, DWARFFormValue::FixedFormSizes fixed_form_sizes,
DWARFAttributes &attrs, DWARFAttributes &attrs,
uint32_t curr_depth = 0) uint32_t curr_depth = 0)
const; // "curr_depth" for internal use only, don't set this yourself!!! const; // "curr_depth" for internal use only, don't set this yourself!!!
dw_offset_t dw_offset_t
GetAttributeValue(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, GetAttributeValue(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, DWARFFormValue &formValue, const dw_attr_t attr, DWARFFormValue &formValue,
dw_offset_t *end_attr_offset_ptr = nullptr, dw_offset_t *end_attr_offset_ptr = nullptr,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
const char *GetAttributeValueAsString( const char *GetAttributeValueAsString(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, const char *fail_value, const dw_attr_t attr, const char *fail_value,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
uint64_t GetAttributeValueAsUnsigned( uint64_t GetAttributeValueAsUnsigned(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value, const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
uint64_t GetAttributeValueAsReference( uint64_t GetAttributeValueAsReference(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value, const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
int64_t GetAttributeValueAsSigned( int64_t GetAttributeValueAsSigned(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, int64_t fail_value, const dw_attr_t attr, int64_t fail_value,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
uint64_t GetAttributeValueAsAddress( uint64_t GetAttributeValueAsAddress(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value, const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
dw_addr_t dw_addr_t
GetAttributeHighPC(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, GetAttributeHighPC(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
dw_addr_t lo_pc, uint64_t fail_value, dw_addr_t lo_pc, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
bool GetAttributeAddressRange( bool GetAttributeAddressRange(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t &lo_pc, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc,
dw_addr_t &hi_pc, uint64_t fail_value, dw_addr_t &hi_pc, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
size_t GetAttributeAddressRanges( size_t GetAttributeAddressRanges(
SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFRangeList &ranges, bool check_hi_lo_pc, DWARFRangeList &ranges, bool check_hi_lo_pc,
bool check_specification_or_abstract_origin = false) const; bool check_specification_or_abstract_origin = false) const;
const char *GetName(SymbolFileDWARF *dwarf2Data, const char *GetName(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu) const; const DWARFUnit *cu) const;
const char *GetMangledName(SymbolFileDWARF *dwarf2Data, const char *GetMangledName(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
bool substitute_name_allowed = true) const; bool substitute_name_allowed = true) const;
const char *GetPubname(SymbolFileDWARF *dwarf2Data, const char *GetPubname(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu) const; const DWARFUnit *cu) const;
static bool GetName(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, static bool GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_offset_t die_offset, lldb_private::Stream &s); const dw_offset_t die_offset, lldb_private::Stream &s);
static bool AppendTypeName(SymbolFileDWARF *dwarf2Data, static bool AppendTypeName(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
const dw_offset_t die_offset, const dw_offset_t die_offset,
lldb_private::Stream &s); lldb_private::Stream &s);
const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data, const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, DWARFUnit *cu,
std::string &storage) const; std::string &storage) const;
const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data, const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, DWARFUnit *cu,
const DWARFAttributes &attributes, const DWARFAttributes &attributes,
std::string &storage) const; std::string &storage) const;
static bool OffsetLessThan(const DWARFDebugInfoEntry &a, static bool OffsetLessThan(const DWARFDebugInfoEntry &a,
const DWARFDebugInfoEntry &b); const DWARFDebugInfoEntry &b);
void Dump(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, void Dump(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
lldb_private::Stream &s, uint32_t recurse_depth) const; lldb_private::Stream &s, uint32_t recurse_depth) const;
void DumpAncestry(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, void DumpAncestry(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const DWARFDebugInfoEntry *oldest, lldb_private::Stream &s, const DWARFDebugInfoEntry *oldest, lldb_private::Stream &s,
uint32_t recurse_depth) const; uint32_t recurse_depth) const;
static void static void
DumpAttribute(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, DumpAttribute(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const lldb_private::DWARFDataExtractor &debug_info_data, const lldb_private::DWARFDataExtractor &debug_info_data,
lldb::offset_t *offset_ptr, lldb_private::Stream &s, lldb::offset_t *offset_ptr, lldb_private::Stream &s,
dw_attr_t attr, dw_form_t form); dw_attr_t attr, dw_form_t form);
// This one dumps the comp unit name, objfile name and die offset for this die // This one dumps the comp unit name, objfile name and die offset for this die
// so the stream S. // so the stream S.
void DumpLocation(SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, void DumpLocation(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
lldb_private::Stream &s) const; lldb_private::Stream &s) const;
bool bool
GetDIENamesAndRanges(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, GetDIENamesAndRanges(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const char *&name, const char *&mangled, const char *&name, const char *&mangled,
DWARFRangeList &rangeList, int &decl_file, DWARFRangeList &rangeList, int &decl_file,
int &decl_line, int &decl_column, int &call_file, int &decl_line, int &decl_column, int &call_file,
@ -190,7 +190,7 @@ public:
const DWARFAbbreviationDeclaration * const DWARFAbbreviationDeclaration *
GetAbbreviationDeclarationPtr(SymbolFileDWARF *dwarf2Data, GetAbbreviationDeclarationPtr(SymbolFileDWARF *dwarf2Data,
const DWARFCompileUnit *cu, const DWARFUnit *cu,
lldb::offset_t &offset) const; lldb::offset_t &offset) const;
dw_tag_t Tag() const { return m_tag; } dw_tag_t Tag() const { return m_tag; }
@ -229,20 +229,20 @@ public:
return (HasChildren() && !m_empty_children) ? this + 1 : NULL; return (HasChildren() && !m_empty_children) ? this + 1 : NULL;
} }
void GetDeclContextDIEs(DWARFCompileUnit *cu, void GetDeclContextDIEs(DWARFUnit *cu,
DWARFDIECollection &decl_context_dies) const; DWARFDIECollection &decl_context_dies) const;
void GetDWARFDeclContext(SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu, void GetDWARFDeclContext(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
DWARFDeclContext &dwarf_decl_ctx) const; DWARFDeclContext &dwarf_decl_ctx) const;
bool MatchesDWARFDeclContext(SymbolFileDWARF *dwarf2Data, bool MatchesDWARFDeclContext(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, DWARFUnit *cu,
const DWARFDeclContext &dwarf_decl_ctx) const; const DWARFDeclContext &dwarf_decl_ctx) const;
DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data, DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu) const; DWARFUnit *cu) const;
DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data, DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
DWARFCompileUnit *cu, DWARFUnit *cu,
const DWARFAttributes &attributes) const; const DWARFAttributes &attributes) const;
void SetParent(DWARFDebugInfoEntry *parent) { void SetParent(DWARFDebugInfoEntry *parent) {

View File

@ -12,10 +12,10 @@
#include "lldb/Core/dwarf.h" #include "lldb/Core/dwarf.h"
#include "lldb/Utility/Stream.h" #include "lldb/Utility/Stream.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFFormValue.h" #include "DWARFFormValue.h"
class DWARFCompileUnit; class DWARFUnit;
using namespace lldb_private; using namespace lldb_private;
@ -154,7 +154,7 @@ DWARFFormValue::GetFixedFormSizesForAddressSize(uint8_t addr_size,
DWARFFormValue::DWARFFormValue() : m_cu(NULL), m_form(0), m_value() {} DWARFFormValue::DWARFFormValue() : m_cu(NULL), m_form(0), m_value() {}
DWARFFormValue::DWARFFormValue(const DWARFCompileUnit *cu, dw_form_t form) DWARFFormValue::DWARFFormValue(const DWARFUnit *cu, dw_form_t form)
: m_cu(cu), m_form(form), m_value() {} : m_cu(cu), m_form(form), m_value() {}
void DWARFFormValue::Clear() { void DWARFFormValue::Clear() {
@ -177,7 +177,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
case DW_FORM_addr: case DW_FORM_addr:
assert(m_cu); assert(m_cu);
m_value.value.uval = data.GetMaxU64( m_value.value.uval = data.GetMaxU64(
offset_ptr, DWARFCompileUnit::GetAddressByteSize(m_cu)); offset_ptr, DWARFUnit::GetAddressByteSize(m_cu));
break; break;
case DW_FORM_block2: case DW_FORM_block2:
m_value.value.uval = data.GetU16(offset_ptr); m_value.value.uval = data.GetU16(offset_ptr);
@ -220,7 +220,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
case DW_FORM_strp: case DW_FORM_strp:
assert(m_cu); assert(m_cu);
m_value.value.uval = m_value.value.uval =
data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4); data.GetMaxU64(offset_ptr, DWARFUnit::IsDWARF64(m_cu) ? 8 : 4);
break; break;
// case DW_FORM_APPLE_db_str: // case DW_FORM_APPLE_db_str:
case DW_FORM_udata: case DW_FORM_udata:
@ -258,7 +258,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
case DW_FORM_sec_offset: case DW_FORM_sec_offset:
assert(m_cu); assert(m_cu);
m_value.value.uval = m_value.value.uval =
data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4); data.GetMaxU64(offset_ptr, DWARFUnit::IsDWARF64(m_cu) ? 8 : 4);
break; break;
case DW_FORM_flag_present: case DW_FORM_flag_present:
m_value.value.uval = 1; m_value.value.uval = 1;
@ -296,7 +296,7 @@ bool DWARFFormValue::SkipValue(const DWARFDataExtractor &debug_info_data,
bool DWARFFormValue::SkipValue(dw_form_t form, bool DWARFFormValue::SkipValue(dw_form_t form,
const DWARFDataExtractor &debug_info_data, const DWARFDataExtractor &debug_info_data,
lldb::offset_t *offset_ptr, lldb::offset_t *offset_ptr,
const DWARFCompileUnit *cu) { const DWARFUnit *cu) {
uint8_t ref_addr_size; uint8_t ref_addr_size;
switch (form) { switch (form) {
// Blocks if inlined data that have a length field and the data bytes // Blocks if inlined data that have a length field and the data bytes
@ -330,7 +330,7 @@ bool DWARFFormValue::SkipValue(dw_form_t form,
// Compile unit address sized values // Compile unit address sized values
case DW_FORM_addr: case DW_FORM_addr:
*offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu); *offset_ptr += DWARFUnit::GetAddressByteSize(cu);
return true; return true;
case DW_FORM_ref_addr: case DW_FORM_ref_addr:

View File

@ -13,7 +13,7 @@
#include "DWARFDataExtractor.h" #include "DWARFDataExtractor.h"
#include <stddef.h> // for NULL #include <stddef.h> // for NULL
class DWARFCompileUnit; class DWARFUnit;
class DWARFFormValue { class DWARFFormValue {
public: public:
@ -55,9 +55,9 @@ public:
}; };
DWARFFormValue(); DWARFFormValue();
DWARFFormValue(const DWARFCompileUnit *cu, dw_form_t form); DWARFFormValue(const DWARFUnit *cu, dw_form_t form);
const DWARFCompileUnit *GetCompileUnit() const { return m_cu; } const DWARFUnit *GetCompileUnit() const { return m_cu; }
void SetCompileUnit(const DWARFCompileUnit *cu) { m_cu = cu; } void SetCompileUnit(const DWARFUnit *cu) { m_cu = cu; }
dw_form_t Form() const { return m_form; } dw_form_t Form() const { return m_form; }
void SetForm(dw_form_t form) { m_form = form; } void SetForm(dw_form_t form) { m_form = form; }
const ValueType &Value() const { return m_value; } const ValueType &Value() const { return m_value; }
@ -79,7 +79,7 @@ public:
lldb::offset_t *offset_ptr) const; lldb::offset_t *offset_ptr) const;
static bool SkipValue(const dw_form_t form, static bool SkipValue(const dw_form_t form,
const lldb_private::DWARFDataExtractor &debug_info_data, const lldb_private::DWARFDataExtractor &debug_info_data,
lldb::offset_t *offset_ptr, const DWARFCompileUnit *cu); lldb::offset_t *offset_ptr, const DWARFUnit *cu);
static bool IsBlockForm(const dw_form_t form); static bool IsBlockForm(const dw_form_t form);
static bool IsDataForm(const dw_form_t form); static bool IsDataForm(const dw_form_t form);
static FixedFormSizes GetFixedFormSizesForAddressSize(uint8_t addr_size, static FixedFormSizes GetFixedFormSizesForAddressSize(uint8_t addr_size,
@ -89,7 +89,7 @@ public:
static bool FormIsSupported(dw_form_t form); static bool FormIsSupported(dw_form_t form);
protected: protected:
const DWARFCompileUnit *m_cu; // Compile unit for this form const DWARFUnit *m_cu; // Compile unit for this form
dw_form_t m_form; // Form for this value dw_form_t m_form; // Form for this value
ValueType m_value; // Contains all data for the form ValueType m_value; // Contains all data for the form
}; };

View File

@ -154,7 +154,7 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) {
Data().m_die_array.begin(), end, die_offset, CompareDIEOffset); Data().m_die_array.begin(), end, die_offset, CompareDIEOffset);
if (pos != end) { if (pos != end) {
if (die_offset == (*pos).GetOffset()) if (die_offset == (*pos).GetOffset())
return DWARFDIE(&Data(), &(*pos)); return DWARFDIE(this, &(*pos));
} }
} else { } else {
// Don't specify the compile unit offset as we don't know it because the // Don't specify the compile unit offset as we don't know it because the
@ -364,7 +364,7 @@ void DWARFUnit::IndexPrivate(
DWARFFormValue specification_die_form; DWARFFormValue specification_die_form;
const size_t num_attributes = const size_t num_attributes =
die.GetAttributes(&dwarf_cu->Data(), fixed_form_sizes, attributes); die.GetAttributes(dwarf_cu, fixed_form_sizes, attributes);
if (num_attributes > 0) { if (num_attributes > 0) {
for (uint32_t i = 0; i < num_attributes; ++i) { for (uint32_t i = 0; i < num_attributes; ++i) {
dw_attr_t attr = attributes.AttributeAtIndex(i); dw_attr_t attr = attributes.AttributeAtIndex(i);

View File

@ -31,6 +31,8 @@ enum DWARFProducer {
}; };
class DWARFUnit { class DWARFUnit {
friend class DWARFCompileUnit;
public: public:
virtual ~DWARFUnit(); virtual ~DWARFUnit();

View File

@ -58,7 +58,7 @@
#include "DWARFASTParser.h" #include "DWARFASTParser.h"
#include "DWARFASTParserClang.h" #include "DWARFASTParserClang.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDIECollection.h" #include "DWARFDIECollection.h"
#include "DWARFDebugAbbrev.h" #include "DWARFDebugAbbrev.h"
#include "DWARFDebugAranges.h" #include "DWARFDebugAranges.h"
@ -208,7 +208,7 @@ static const char *resolveCompDir(const char *path_from_dwarf) {
return nullptr; return nullptr;
} }
DWARFCompileUnit *SymbolFileDWARF::GetBaseCompileUnit() { DWARFUnit *SymbolFileDWARF::GetBaseCompileUnit() {
return nullptr; return nullptr;
} }
@ -333,7 +333,7 @@ size_t SymbolFileDWARF::GetTypes(SymbolContextScope *sc_scope,
TypeSet type_set; TypeSet type_set;
CompileUnit *comp_unit = NULL; CompileUnit *comp_unit = NULL;
DWARFCompileUnit *dwarf_cu = NULL; DWARFUnit *dwarf_cu = NULL;
if (sc_scope) if (sc_scope)
comp_unit = sc_scope->CalculateSymbolContextCompileUnit(); comp_unit = sc_scope->CalculateSymbolContextCompileUnit();
@ -716,7 +716,7 @@ const DWARFDebugInfo *SymbolFileDWARF::DebugInfo() const {
return m_info.get(); return m_info.get();
} }
DWARFCompileUnit * DWARFUnit *
SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) { SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
if (!comp_unit) if (!comp_unit)
return nullptr; return nullptr;
@ -726,7 +726,7 @@ SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
// Just a normal DWARF file whose user ID for the compile unit is // Just a normal DWARF file whose user ID for the compile unit is
// the DWARF offset itself // the DWARF offset itself
DWARFCompileUnit *dwarf_cu = DWARFUnit *dwarf_cu =
info->GetCompileUnit((dw_offset_t)comp_unit->GetID()); info->GetCompileUnit((dw_offset_t)comp_unit->GetID());
if (dwarf_cu && dwarf_cu->GetUserData() == NULL) if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
dwarf_cu->SetUserData(comp_unit); dwarf_cu->SetUserData(comp_unit);
@ -753,7 +753,7 @@ const DWARFDebugRanges *SymbolFileDWARF::DebugRanges() const {
return m_ranges.get(); return m_ranges.get();
} }
lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFCompileUnit *dwarf_cu, lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) { uint32_t cu_idx) {
CompUnitSP cu_sp; CompUnitSP cu_sp;
if (dwarf_cu) { if (dwarf_cu) {
@ -792,7 +792,7 @@ lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
cu_file_spec.SetFile(remapped_file, false); cu_file_spec.SetFile(remapped_file, false);
} }
LanguageType cu_language = DWARFCompileUnit::LanguageTypeFromDWARF( LanguageType cu_language = DWARFUnit::LanguageTypeFromDWARF(
cu_die.GetAttributeValueAsUnsigned(DW_AT_language, 0)); cu_die.GetAttributeValueAsUnsigned(DW_AT_language, 0));
bool is_optimized = dwarf_cu->GetIsOptimized(); bool is_optimized = dwarf_cu->GetIsOptimized();
@ -843,7 +843,7 @@ CompUnitSP SymbolFileDWARF::ParseCompileUnitAtIndex(uint32_t cu_idx) {
CompUnitSP cu_sp; CompUnitSP cu_sp;
DWARFDebugInfo *info = DebugInfo(); DWARFDebugInfo *info = DebugInfo();
if (info) { if (info) {
DWARFCompileUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx); DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx);
if (dwarf_cu) if (dwarf_cu)
cu_sp = ParseCompileUnit(dwarf_cu, cu_idx); cu_sp = ParseCompileUnit(dwarf_cu, cu_idx);
} }
@ -876,7 +876,7 @@ bool SymbolFileDWARF::FixupAddress(Address &addr) {
lldb::LanguageType lldb::LanguageType
SymbolFileDWARF::ParseCompileUnitLanguage(const SymbolContext &sc) { SymbolFileDWARF::ParseCompileUnitLanguage(const SymbolContext &sc) {
assert(sc.comp_unit); assert(sc.comp_unit);
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) if (dwarf_cu)
return dwarf_cu->GetLanguageType(); return dwarf_cu->GetLanguageType();
else else
@ -886,7 +886,7 @@ SymbolFileDWARF::ParseCompileUnitLanguage(const SymbolContext &sc) {
size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) { size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) {
assert(sc.comp_unit); assert(sc.comp_unit);
size_t functions_added = 0; size_t functions_added = 0;
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) { if (dwarf_cu) {
DWARFDIECollection function_dies; DWARFDIECollection function_dies;
const size_t num_functions = const size_t num_functions =
@ -907,7 +907,7 @@ size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) {
bool SymbolFileDWARF::ParseCompileUnitSupportFiles( bool SymbolFileDWARF::ParseCompileUnitSupportFiles(
const SymbolContext &sc, FileSpecList &support_files) { const SymbolContext &sc, FileSpecList &support_files) {
assert(sc.comp_unit); assert(sc.comp_unit);
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) { if (dwarf_cu) {
const DWARFDIE cu_die = dwarf_cu->GetCompileUnitDIEOnly(); const DWARFDIE cu_die = dwarf_cu->GetCompileUnitDIEOnly();
@ -931,7 +931,7 @@ bool SymbolFileDWARF::ParseCompileUnitSupportFiles(
bool SymbolFileDWARF::ParseCompileUnitIsOptimized( bool SymbolFileDWARF::ParseCompileUnitIsOptimized(
const lldb_private::SymbolContext &sc) { const lldb_private::SymbolContext &sc) {
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) if (dwarf_cu)
return dwarf_cu->GetIsOptimized(); return dwarf_cu->GetIsOptimized();
return false; return false;
@ -941,7 +941,7 @@ bool SymbolFileDWARF::ParseImportedModules(
const lldb_private::SymbolContext &sc, const lldb_private::SymbolContext &sc,
std::vector<lldb_private::ConstString> &imported_modules) { std::vector<lldb_private::ConstString> &imported_modules) {
assert(sc.comp_unit); assert(sc.comp_unit);
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) { if (dwarf_cu) {
if (ClangModulesDeclVendor::LanguageSupportsClangModules( if (ClangModulesDeclVendor::LanguageSupportsClangModules(
sc.comp_unit->GetLanguage())) { sc.comp_unit->GetLanguage())) {
@ -1022,7 +1022,7 @@ bool SymbolFileDWARF::ParseCompileUnitLineTable(const SymbolContext &sc) {
if (sc.comp_unit->GetLineTable() != NULL) if (sc.comp_unit->GetLineTable() != NULL)
return true; return true;
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) { if (dwarf_cu) {
const DWARFDIE dwarf_cu_die = dwarf_cu->GetCompileUnitDIEOnly(); const DWARFDIE dwarf_cu_die = dwarf_cu->GetCompileUnitDIEOnly();
if (dwarf_cu_die) { if (dwarf_cu_die) {
@ -1105,7 +1105,7 @@ SymbolFileDWARF::ParseDebugMacros(lldb::offset_t *offset) {
bool SymbolFileDWARF::ParseCompileUnitDebugMacros(const SymbolContext &sc) { bool SymbolFileDWARF::ParseCompileUnitDebugMacros(const SymbolContext &sc) {
assert(sc.comp_unit); assert(sc.comp_unit);
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu == nullptr) if (dwarf_cu == nullptr)
return false; return false;
@ -1494,7 +1494,7 @@ Type *SymbolFileDWARF::ResolveType(const DWARFDIE &die,
} }
CompileUnit * CompileUnit *
SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu, SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) { uint32_t cu_idx) {
// Check if the symbol vendor already knows about this compile unit? // Check if the symbol vendor already knows about this compile unit?
if (dwarf_cu->GetUserData() == NULL) { if (dwarf_cu->GetUserData() == NULL) {
@ -1561,7 +1561,7 @@ SymbolFileDWARF::GetDIE(const DIERef &die_ref) {
std::unique_ptr<SymbolFileDWARFDwo> std::unique_ptr<SymbolFileDWARFDwo>
SymbolFileDWARF::GetDwoSymbolFileForCompileUnit( SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(
DWARFCompileUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) { DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) {
// If we are using a dSYM file, we never want the standard DWO files since // If we are using a dSYM file, we never want the standard DWO files since
// the -gmodules support uses the same DWO machanism to specify full debug // the -gmodules support uses the same DWO machanism to specify full debug
// info files for modules. // info files for modules.
@ -1618,7 +1618,7 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
const uint32_t num_compile_units = GetNumCompileUnits(); const uint32_t num_compile_units = GetNumCompileUnits();
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) { for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
const DWARFDIE die = dwarf_cu->GetCompileUnitDIEOnly(); const DWARFDIE die = dwarf_cu->GetCompileUnitDIEOnly();
if (die && die.HasChildren() == false) { if (die && die.HasChildren() == false) {
@ -1775,7 +1775,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
} }
} else { } else {
uint32_t cu_idx = DW_INVALID_INDEX; uint32_t cu_idx = DW_INVALID_INDEX;
DWARFCompileUnit *dwarf_cu = DWARFUnit *dwarf_cu =
debug_info->GetCompileUnit(cu_offset, &cu_idx); debug_info->GetCompileUnit(cu_offset, &cu_idx);
if (dwarf_cu) { if (dwarf_cu) {
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx); sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
@ -1877,7 +1877,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
DWARFDebugInfo *debug_info = DebugInfo(); DWARFDebugInfo *debug_info = DebugInfo();
if (debug_info) { if (debug_info) {
uint32_t cu_idx; uint32_t cu_idx;
DWARFCompileUnit *dwarf_cu = NULL; DWARFUnit *dwarf_cu = NULL;
for (cu_idx = 0; for (cu_idx = 0;
(dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx)) != NULL; (dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx)) != NULL;
@ -2024,7 +2024,7 @@ void SymbolFileDWARF::Index() {
&function_selector_index, &objc_class_selectors_index, &function_selector_index, &objc_class_selectors_index,
&global_index, &type_index, &global_index, &type_index,
&namespace_index](size_t cu_idx) { &namespace_index](size_t cu_idx) {
DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (dwarf_cu) { if (dwarf_cu) {
dwarf_cu->Index( dwarf_cu->Index(
function_basename_index[cu_idx], function_fullname_index[cu_idx], function_basename_index[cu_idx], function_fullname_index[cu_idx],
@ -2035,7 +2035,7 @@ void SymbolFileDWARF::Index() {
}; };
auto extract_fn = [debug_info, &clear_cu_dies](size_t cu_idx) { auto extract_fn = [debug_info, &clear_cu_dies](size_t cu_idx) {
DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (dwarf_cu) { if (dwarf_cu) {
// dwarf_cu->ExtractDIEsIfNeeded(false) will return zero if the // dwarf_cu->ExtractDIEsIfNeeded(false) will return zero if the
// DIEs for a compile unit have already been parsed. // DIEs for a compile unit have already been parsed.
@ -2787,7 +2787,7 @@ void SymbolFileDWARF::GetMangledNamesForFunction(
num_comp_units = info->GetNumCompileUnits(); num_comp_units = info->GetNumCompileUnits();
for (uint32_t i = 0; i < num_comp_units; i++) { for (uint32_t i = 0; i < num_comp_units; i++) {
DWARFCompileUnit *cu = info->GetCompileUnitAtIndex(i); DWARFUnit *cu = info->GetCompileUnitAtIndex(i);
if (cu == nullptr) if (cu == nullptr)
continue; continue;
@ -3167,7 +3167,7 @@ SymbolFileDWARF::GetObjCClassSymbol(const ConstString &objc_class_name) {
// DWARF file // DWARF file
// if we are doing darwin DWARF in .o file debugging. // if we are doing darwin DWARF in .o file debugging.
bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type( bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type(
DWARFCompileUnit *cu) { DWARFUnit *cu) {
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) { if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) {
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo; m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
if (cu && cu->Supports_DW_AT_APPLE_objc_complete_type()) if (cu && cu->Supports_DW_AT_APPLE_objc_complete_type())
@ -3176,7 +3176,7 @@ bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type(
DWARFDebugInfo *debug_info = DebugInfo(); DWARFDebugInfo *debug_info = DebugInfo();
const uint32_t num_compile_units = GetNumCompileUnits(); const uint32_t num_compile_units = GetNumCompileUnits();
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) { for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (dwarf_cu != cu && if (dwarf_cu != cu &&
dwarf_cu->Supports_DW_AT_APPLE_objc_complete_type()) { dwarf_cu->Supports_DW_AT_APPLE_objc_complete_type()) {
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes; m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
@ -3604,7 +3604,7 @@ size_t SymbolFileDWARF::ParseTypes(const SymbolContext &sc,
size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc) { size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc) {
assert(sc.comp_unit && sc.function); assert(sc.comp_unit && sc.function);
size_t functions_added = 0; size_t functions_added = 0;
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) { if (dwarf_cu) {
const dw_offset_t function_die_offset = sc.function->GetID(); const dw_offset_t function_die_offset = sc.function->GetID();
DWARFDIE function_die = dwarf_cu->GetDIE(function_die_offset); DWARFDIE function_die = dwarf_cu->GetDIE(function_die_offset);
@ -3621,7 +3621,7 @@ size_t SymbolFileDWARF::ParseTypes(const SymbolContext &sc) {
// At least a compile unit must be valid // At least a compile unit must be valid
assert(sc.comp_unit); assert(sc.comp_unit);
size_t types_added = 0; size_t types_added = 0;
DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit); DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) { if (dwarf_cu) {
if (sc.function) { if (sc.function) {
dw_offset_t function_die_offset = sc.function->GetID(); dw_offset_t function_die_offset = sc.function->GetID();
@ -3660,7 +3660,7 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
return num_variables; return num_variables;
} }
} else if (sc.comp_unit) { } else if (sc.comp_unit) {
DWARFCompileUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID()); DWARFUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID());
if (dwarf_cu == NULL) if (dwarf_cu == NULL)
return 0; return 0;

View File

@ -272,19 +272,19 @@ public:
HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type); HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type);
lldb_private::CompileUnit * lldb_private::CompileUnit *
GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu, GetCompUnitForDWARFCompUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx = UINT32_MAX); uint32_t cu_idx = UINT32_MAX);
virtual size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name, virtual size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name,
DIEArray &method_die_offsets); DIEArray &method_die_offsets);
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFCompileUnit *cu); bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu);
lldb_private::DebugMacrosSP ParseDebugMacros(lldb::offset_t *offset); lldb_private::DebugMacrosSP ParseDebugMacros(lldb::offset_t *offset);
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die); static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die);
virtual lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit *dwarf_cu, virtual lldb::CompUnitSP ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx); uint32_t cu_idx);
virtual lldb_private::DWARFExpression::LocationListFormat virtual lldb_private::DWARFExpression::LocationListFormat
@ -303,13 +303,13 @@ public:
virtual DWARFDIE GetDIE(const DIERef &die_ref); virtual DWARFDIE GetDIE(const DIERef &die_ref);
virtual std::unique_ptr<SymbolFileDWARFDwo> virtual std::unique_ptr<SymbolFileDWARFDwo>
GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu,
const DWARFDebugInfoEntry &cu_die); const DWARFDebugInfoEntry &cu_die);
// For regular SymbolFileDWARF instances the method returns nullptr, // For regular SymbolFileDWARF instances the method returns nullptr,
// for the instances of the subclass SymbolFileDWARFDwo // for the instances of the subclass SymbolFileDWARFDwo
// the method returns a pointer to the base compile unit. // the method returns a pointer to the base compile unit.
virtual DWARFCompileUnit *GetBaseCompileUnit(); virtual DWARFUnit *GetBaseCompileUnit();
protected: protected:
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *> typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
@ -342,10 +342,10 @@ protected:
DIEInDeclContext(const lldb_private::CompilerDeclContext *parent_decl_ctx, DIEInDeclContext(const lldb_private::CompilerDeclContext *parent_decl_ctx,
const DWARFDIE &die); const DWARFDIE &die);
virtual DWARFCompileUnit * virtual DWARFUnit *
GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit); GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit);
DWARFCompileUnit *GetNextUnparsedDWARFCompileUnit(DWARFCompileUnit *prev_cu); DWARFUnit *GetNextUnparsedDWARFCompileUnit(DWARFUnit *prev_cu);
bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc); bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc);

View File

@ -14,14 +14,14 @@
#include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/LLDBAssert.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDebugInfo.h" #include "DWARFDebugInfo.h"
using namespace lldb; using namespace lldb;
using namespace lldb_private; using namespace lldb_private;
SymbolFileDWARFDwo::SymbolFileDWARFDwo(ObjectFileSP objfile, SymbolFileDWARFDwo::SymbolFileDWARFDwo(ObjectFileSP objfile,
DWARFCompileUnit *dwarf_cu) DWARFUnit *dwarf_cu)
: SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile), : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile),
m_base_dwarf_cu(dwarf_cu) { m_base_dwarf_cu(dwarf_cu) {
SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32); SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32);
@ -52,7 +52,7 @@ void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type,
} }
lldb::CompUnitSP lldb::CompUnitSP
SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit *dwarf_cu, SymbolFileDWARFDwo::ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) { uint32_t cu_idx) {
assert(GetCompileUnit() == dwarf_cu && "SymbolFileDWARFDwo::ParseCompileUnit " assert(GetCompileUnit() == dwarf_cu && "SymbolFileDWARFDwo::ParseCompileUnit "
"called with incompatible compile " "called with incompatible compile "
@ -60,7 +60,7 @@ SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
return GetBaseSymbolFile()->ParseCompileUnit(m_base_dwarf_cu, UINT32_MAX); return GetBaseSymbolFile()->ParseCompileUnit(m_base_dwarf_cu, UINT32_MAX);
} }
DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() { DWARFUnit *SymbolFileDWARFDwo::GetCompileUnit() {
// A clang module is found via a skeleton CU, but is not a proper DWO. // A clang module is found via a skeleton CU, but is not a proper DWO.
// Clang modules have a .debug_info section instead of the *_dwo variant. // Clang modules have a .debug_info section instead of the *_dwo variant.
if (auto *section_list = m_obj_file->GetSectionList(false)) if (auto *section_list = m_obj_file->GetSectionList(false))
@ -76,7 +76,7 @@ DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() {
return nullptr; return nullptr;
} }
DWARFCompileUnit * DWARFUnit *
SymbolFileDWARFDwo::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) { SymbolFileDWARFDwo::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
return GetCompileUnit(); return GetCompileUnit();
} }
@ -122,7 +122,7 @@ lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
die, type_name, must_be_implementation); die, type_name, must_be_implementation);
} }
DWARFCompileUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() { DWARFUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() {
return m_base_dwarf_cu; return m_base_dwarf_cu;
} }

View File

@ -18,16 +18,16 @@
class SymbolFileDWARFDwo : public SymbolFileDWARF { class SymbolFileDWARFDwo : public SymbolFileDWARF {
public: public:
SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFCompileUnit *dwarf_cu); SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFUnit *dwarf_cu);
~SymbolFileDWARFDwo() override = default; ~SymbolFileDWARFDwo() override = default;
lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit *dwarf_cu, lldb::CompUnitSP ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) override; uint32_t cu_idx) override;
DWARFCompileUnit *GetCompileUnit(); DWARFUnit *GetCompileUnit();
DWARFCompileUnit * DWARFUnit *
GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override; GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override;
lldb_private::DWARFExpression::LocationListFormat lldb_private::DWARFExpression::LocationListFormat
@ -43,12 +43,12 @@ public:
GetDIE(const DIERef &die_ref) override; GetDIE(const DIERef &die_ref) override;
std::unique_ptr<SymbolFileDWARFDwo> std::unique_ptr<SymbolFileDWARFDwo>
GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu,
const DWARFDebugInfoEntry &cu_die) override { const DWARFDebugInfoEntry &cu_die) override {
return nullptr; return nullptr;
} }
DWARFCompileUnit *GetBaseCompileUnit() override; DWARFUnit *GetBaseCompileUnit() override;
protected: protected:
void LoadSectionData(lldb::SectionType sect_type, void LoadSectionData(lldb::SectionType sect_type,
@ -74,7 +74,7 @@ protected:
SymbolFileDWARF *GetBaseSymbolFile(); SymbolFileDWARF *GetBaseSymbolFile();
lldb::ObjectFileSP m_obj_file_sp; lldb::ObjectFileSP m_obj_file_sp;
DWARFCompileUnit *m_base_dwarf_cu; DWARFUnit *m_base_dwarf_cu;
}; };
#endif // SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_ #endif // SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_

View File

@ -14,7 +14,7 @@
#include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/LLDBAssert.h"
#include "DWARFCompileUnit.h" #include "DWARFUnit.h"
#include "DWARFDebugInfo.h" #include "DWARFDebugInfo.h"
using namespace lldb; using namespace lldb;
@ -22,7 +22,7 @@ using namespace lldb_private;
SymbolFileDWARFDwoDwp::SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile, SymbolFileDWARFDwoDwp::SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile,
ObjectFileSP objfile, ObjectFileSP objfile,
DWARFCompileUnit *dwarf_cu, DWARFUnit *dwarf_cu,
uint64_t dwo_id) uint64_t dwo_id)
: SymbolFileDWARFDwo(objfile, dwarf_cu), m_dwp_symfile(dwp_symfile), : SymbolFileDWARFDwo(objfile, dwarf_cu), m_dwp_symfile(dwp_symfile),
m_dwo_id(dwo_id) {} m_dwo_id(dwo_id) {}

View File

@ -20,7 +20,7 @@
class SymbolFileDWARFDwoDwp : public SymbolFileDWARFDwo { class SymbolFileDWARFDwoDwp : public SymbolFileDWARFDwo {
public: public:
SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile, SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile,
lldb::ObjectFileSP objfile, DWARFCompileUnit *dwarf_cu, lldb::ObjectFileSP objfile, DWARFUnit *dwarf_cu,
uint64_t dwo_id); uint64_t dwo_id);
protected: protected:

View File

@ -85,7 +85,7 @@ SymbolFileDWARFDwp::SymbolFileDWARFDwp(lldb::ModuleSP module_sp,
{} {}
std::unique_ptr<SymbolFileDWARFDwo> std::unique_ptr<SymbolFileDWARFDwo>
SymbolFileDWARFDwp::GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu, SymbolFileDWARFDwp::GetSymbolFileForDwoId(DWARFUnit *dwarf_cu,
uint64_t dwo_id) { uint64_t dwo_id) {
return std::unique_ptr<SymbolFileDWARFDwo>( return std::unique_ptr<SymbolFileDWARFDwo>(
new SymbolFileDWARFDwoDwp(this, m_obj_file, dwarf_cu, dwo_id)); new SymbolFileDWARFDwoDwp(this, m_obj_file, dwarf_cu, dwo_id));

View File

@ -29,7 +29,7 @@ public:
Create(lldb::ModuleSP module_sp, const lldb_private::FileSpec &file_spec); Create(lldb::ModuleSP module_sp, const lldb_private::FileSpec &file_spec);
std::unique_ptr<SymbolFileDWARFDwo> std::unique_ptr<SymbolFileDWARFDwo>
GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu, uint64_t dwo_id); GetSymbolFileForDwoId(DWARFUnit *dwarf_cu, uint64_t dwo_id);
bool LoadSectionData(uint64_t dwo_id, lldb::SectionType sect_type, bool LoadSectionData(uint64_t dwo_id, lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data); lldb_private::DWARFDataExtractor &data);