Finish renaming CompileUnit -> Unit

D42892 changed a lot of code to use superclass DWARFUnit instead of its
subclass DWARFCompileUnit.

Finish this change more thoroughly for any *CompileUnit* -> *Unit* names.
Later patch will introduce DWARFTypeUnit which needs to be sometimes different
from DWARFCompileUnit and it would be confusing without this renaming.

Differential Revision: https://reviews.llvm.org/D61501

llvm-svn: 360443
This commit is contained in:
Jan Kratochvil 2019-05-10 17:14:37 +00:00
parent 9529c563eb
commit 605627374e
12 changed files with 85 additions and 93 deletions

View File

@ -74,8 +74,8 @@ void AppleDWARFIndex::GetGlobalVariables(const DWARFUnit &cu,
return;
DWARFMappedHash::DIEInfoArray hash_data;
if (m_apple_names_up->AppendAllDIEsInRange(
cu.GetOffset(), cu.GetNextCompileUnitOffset(), hash_data))
if (m_apple_names_up->AppendAllDIEsInRange(cu.GetOffset(),
cu.GetNextUnitOffset(), hash_data))
DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
}

View File

@ -52,8 +52,7 @@ llvm::Expected<DWARFUnitSP> DWARFCompileUnit::extract(
cu_sp->m_addr_size = debug_info.GetU8(offset_ptr);
}
bool length_OK =
debug_info.ValidOffset(cu_sp->GetNextCompileUnitOffset() - 1);
bool length_OK = debug_info.ValidOffset(cu_sp->GetNextUnitOffset() - 1);
bool version_OK = SymbolFileDWARF::SupportedVersion(cu_sp->m_version);
bool abbr_offset_OK =
dwarf2Data->get_debug_abbrev_data().ValidOffset(abbr_offset);
@ -85,7 +84,7 @@ void DWARFCompileUnit::Dump(Stream *s) const {
"abbr_offset = 0x%8.8x, addr_size = 0x%2.2x (next CU at "
"{0x%8.8x})\n",
m_offset, m_length, m_version, GetAbbrevOffset(), m_addr_size,
GetNextCompileUnitOffset());
GetNextUnitOffset());
}
uint32_t DWARFCompileUnit::GetHeaderByteSize() const {

View File

@ -154,7 +154,7 @@ DWARFDIE::LookupDeepestBlock(lldb::addr_t file_addr) const {
if (cu->ContainsDIEOffset(block_die->GetOffset()))
return DWARFDIE(cu, block_die);
else
return DWARFDIE(dwarf->DebugInfo()->GetCompileUnit(
return DWARFDIE(dwarf->DebugInfo()->GetUnit(
DIERef(cu->GetOffset(), block_die->GetOffset())),
block_die);
}

View File

@ -29,13 +29,12 @@ using namespace std;
// Constructor
DWARFDebugInfo::DWARFDebugInfo(lldb_private::DWARFContext &context)
: m_dwarf2Data(NULL), m_context(context), m_compile_units(),
m_cu_aranges_up() {}
: m_dwarf2Data(NULL), m_context(context), m_units(), m_cu_aranges_up() {}
// SetDwarfData
void DWARFDebugInfo::SetDwarfData(SymbolFileDWARF *dwarf2Data) {
m_dwarf2Data = dwarf2Data;
m_compile_units.clear();
m_units.clear();
}
llvm::Expected<DWARFDebugAranges &> DWARFDebugInfo::GetCompileUnitAranges() {
@ -63,9 +62,9 @@ llvm::Expected<DWARFDebugAranges &> DWARFDebugInfo::GetCompileUnitAranges() {
// Manually build arange data for everything that wasn't in the
// .debug_aranges table.
const size_t num_compile_units = GetNumCompileUnits();
for (size_t idx = 0; idx < num_compile_units; ++idx) {
DWARFUnit *cu = GetCompileUnitAtIndex(idx);
const size_t num_units = GetNumUnits();
for (size_t idx = 0; idx < num_units; ++idx) {
DWARFUnit *cu = GetUnitAtIndex(idx);
dw_offset_t offset = cu->GetOffset();
if (cus_with_data.find(offset) == cus_with_data.end())
@ -77,8 +76,8 @@ llvm::Expected<DWARFDebugAranges &> DWARFDebugInfo::GetCompileUnitAranges() {
return *m_cu_aranges_up;
}
void DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() {
if (!m_compile_units.empty())
void DWARFDebugInfo::ParseUnitHeadersIfNeeded() {
if (!m_units.empty())
return;
if (!m_dwarf2Data)
return;
@ -88,7 +87,7 @@ void DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() {
while (debug_info_data.ValidOffset(offset)) {
llvm::Expected<DWARFUnitSP> cu_sp = DWARFCompileUnit::extract(
m_dwarf2Data, m_compile_units.size(), debug_info_data, &offset);
m_dwarf2Data, m_units.size(), debug_info_data, &offset);
if (!cu_sp) {
// FIXME: Propagate this error up.
@ -96,50 +95,48 @@ void DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() {
return;
}
// If it didn't return an error, then it should be returning a valid
// CompileUnit.
// If it didn't return an error, then it should be returning a valid Unit.
assert(*cu_sp);
m_compile_units.push_back(*cu_sp);
m_units.push_back(*cu_sp);
offset = (*cu_sp)->GetNextCompileUnitOffset();
offset = (*cu_sp)->GetNextUnitOffset();
}
}
size_t DWARFDebugInfo::GetNumCompileUnits() {
ParseCompileUnitHeadersIfNeeded();
return m_compile_units.size();
size_t DWARFDebugInfo::GetNumUnits() {
ParseUnitHeadersIfNeeded();
return m_units.size();
}
DWARFUnit *DWARFDebugInfo::GetCompileUnitAtIndex(user_id_t idx) {
DWARFUnit *DWARFDebugInfo::GetUnitAtIndex(user_id_t idx) {
DWARFUnit *cu = NULL;
if (idx < GetNumCompileUnits())
cu = m_compile_units[idx].get();
if (idx < GetNumUnits())
cu = m_units[idx].get();
return cu;
}
bool DWARFDebugInfo::OffsetLessThanCompileUnitOffset(
dw_offset_t offset, const DWARFUnitSP &cu_sp) {
bool DWARFDebugInfo::OffsetLessThanUnitOffset(dw_offset_t offset,
const DWARFUnitSP &cu_sp) {
return offset < cu_sp->GetOffset();
}
uint32_t DWARFDebugInfo::FindCompileUnitIndex(dw_offset_t offset) {
ParseCompileUnitHeadersIfNeeded();
uint32_t DWARFDebugInfo::FindUnitIndex(dw_offset_t offset) {
ParseUnitHeadersIfNeeded();
// llvm::lower_bound is not used as for DIE offsets it would still return
// index +1 and GetOffset() returning index itself would be a special case.
auto pos = llvm::upper_bound(m_compile_units, offset,
OffsetLessThanCompileUnitOffset);
uint32_t idx = std::distance(m_compile_units.begin(), pos);
auto pos = llvm::upper_bound(m_units, offset, OffsetLessThanUnitOffset);
uint32_t idx = std::distance(m_units.begin(), pos);
if (idx == 0)
return DW_INVALID_OFFSET;
return idx - 1;
}
DWARFUnit *DWARFDebugInfo::GetCompileUnitAtOffset(dw_offset_t cu_offset,
uint32_t *idx_ptr) {
uint32_t idx = FindCompileUnitIndex(cu_offset);
DWARFUnit *result = GetCompileUnitAtIndex(idx);
DWARFUnit *DWARFDebugInfo::GetUnitAtOffset(dw_offset_t cu_offset,
uint32_t *idx_ptr) {
uint32_t idx = FindUnitIndex(cu_offset);
DWARFUnit *result = GetUnitAtIndex(idx);
if (result && result->GetOffset() != cu_offset) {
result = nullptr;
idx = DW_INVALID_INDEX;
@ -149,17 +146,16 @@ DWARFUnit *DWARFDebugInfo::GetCompileUnitAtOffset(dw_offset_t cu_offset,
return result;
}
DWARFUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) {
DWARFUnit *DWARFDebugInfo::GetUnit(const DIERef &die_ref) {
if (die_ref.cu_offset == DW_INVALID_OFFSET)
return GetCompileUnitContainingDIEOffset(die_ref.die_offset);
return GetUnitContainingDIEOffset(die_ref.die_offset);
else
return GetCompileUnitAtOffset(die_ref.cu_offset);
return GetUnitAtOffset(die_ref.cu_offset);
}
DWARFUnit *
DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) {
uint32_t idx = FindCompileUnitIndex(die_offset);
DWARFUnit *result = GetCompileUnitAtIndex(idx);
DWARFUnit *DWARFDebugInfo::GetUnitContainingDIEOffset(dw_offset_t die_offset) {
uint32_t idx = FindUnitIndex(die_offset);
DWARFUnit *result = GetUnitAtIndex(idx);
if (result && !result->ContainsDIEOffset(die_offset))
return nullptr;
return result;
@ -167,7 +163,7 @@ DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) {
DWARFDIE
DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) {
DWARFUnit *cu = GetCompileUnitContainingDIEOffset(die_offset);
DWARFUnit *cu = GetUnitContainingDIEOffset(die_offset);
if (cu)
return cu->GetDIE(die_offset);
return DWARFDIE();
@ -178,7 +174,7 @@ DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) {
// Get the DIE (Debug Information Entry) with the specified offset.
DWARFDIE
DWARFDebugInfo::GetDIE(const DIERef &die_ref) {
DWARFUnit *cu = GetCompileUnit(die_ref);
DWARFUnit *cu = GetUnit(die_ref);
if (cu)
return cu->GetDIE(die_ref.die_offset);
return DWARFDIE(); // Not found

View File

@ -39,12 +39,11 @@ public:
explicit DWARFDebugInfo(lldb_private::DWARFContext &context);
void SetDwarfData(SymbolFileDWARF *dwarf2Data);
size_t GetNumCompileUnits();
DWARFUnit *GetCompileUnitAtIndex(lldb::user_id_t idx);
DWARFUnit *GetCompileUnitAtOffset(dw_offset_t cu_offset,
uint32_t *idx_ptr = NULL);
DWARFUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset);
DWARFUnit *GetCompileUnit(const DIERef &die_ref);
size_t GetNumUnits();
DWARFUnit *GetUnitAtIndex(lldb::user_id_t idx);
DWARFUnit *GetUnitAtOffset(dw_offset_t cu_offset, uint32_t *idx_ptr = NULL);
DWARFUnit *GetUnitContainingDIEOffset(dw_offset_t die_offset);
DWARFUnit *GetUnit(const DIERef &die_ref);
DWARFDIE GetDIEForDIEOffset(dw_offset_t die_offset);
DWARFDIE GetDIE(const DIERef &die_ref);
@ -58,24 +57,24 @@ public:
llvm::Expected<DWARFDebugAranges &> GetCompileUnitAranges();
protected:
static bool OffsetLessThanCompileUnitOffset(dw_offset_t offset,
const DWARFUnitSP &cu_sp);
static bool OffsetLessThanUnitOffset(dw_offset_t offset,
const DWARFUnitSP &cu_sp);
typedef std::vector<DWARFUnitSP> CompileUnitColl;
typedef std::vector<DWARFUnitSP> UnitColl;
// Member variables
SymbolFileDWARF *m_dwarf2Data;
lldb_private::DWARFContext &m_context;
CompileUnitColl m_compile_units;
UnitColl m_units;
std::unique_ptr<DWARFDebugAranges>
m_cu_aranges_up; // A quick address to compile unit table
private:
// All parsing needs to be done partially any managed by this class as
// accessors are called.
void ParseCompileUnitHeadersIfNeeded();
void ParseUnitHeadersIfNeeded();
uint32_t FindCompileUnitIndex(dw_offset_t offset);
uint32_t FindUnitIndex(dw_offset_t offset);
DISALLOW_COPY_AND_ASSIGN(DWARFDebugInfo);
};

View File

@ -209,7 +209,7 @@ bool DWARFDebugInfoEntry::Extract(const DWARFUnit *cu,
const DWARFDataExtractor &debug_info_data = cu->GetData();
// const DWARFDataExtractor& debug_str_data =
// dwarf2Data->get_debug_str_data();
const uint32_t cu_end_offset = cu->GetNextCompileUnitOffset();
const uint32_t cu_end_offset = cu->GetNextUnitOffset();
lldb::offset_t offset = *offset_ptr;
// if (offset >= cu_end_offset)
// Log::Status("DIE at offset 0x%8.8x is beyond the end of the current

View File

@ -58,7 +58,7 @@ void DWARFUnit::ExtractUnitDIEIfNeeded() {
const DWARFDataExtractor &data = GetData();
DWARFFormValue::FixedFormSizes fixed_form_sizes =
DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize());
if (offset < GetNextCompileUnitOffset() &&
if (offset < GetNextUnitOffset() &&
m_first_die.FastExtract(data, this, fixed_form_sizes, &offset)) {
AddUnitDIE(m_first_die);
return;
@ -151,7 +151,7 @@ void DWARFUnit::ExtractDIEsRWLocked() {
// Set the offset to that of the first DIE and calculate the start of the
// next compilation unit header.
lldb::offset_t offset = GetFirstDIEOffset();
lldb::offset_t next_cu_offset = GetNextCompileUnitOffset();
lldb::offset_t next_cu_offset = GetNextUnitOffset();
DWARFDebugInfoEntry die;
@ -366,7 +366,7 @@ size_t DWARFUnit::AppendDIEsWithTag(const dw_tag_t tag,
return dies.size() - old_size;
}
dw_offset_t DWARFUnit::GetNextCompileUnitOffset() const {
dw_offset_t DWARFUnit::GetNextUnitOffset() const {
return m_offset + GetLengthByteSize() + GetLength();
}

View File

@ -84,12 +84,12 @@ public:
bool ContainsDIEOffset(dw_offset_t die_offset) const {
return die_offset >= GetFirstDIEOffset() &&
die_offset < GetNextCompileUnitOffset();
die_offset < GetNextUnitOffset();
}
dw_offset_t GetFirstDIEOffset() const {
return m_offset + GetHeaderByteSize();
}
dw_offset_t GetNextCompileUnitOffset() const;
dw_offset_t GetNextUnitOffset() const;
// Size of the CU data (without initial length and without header).
size_t GetDebugInfoSize() const;
// Size of the CU data incl. header but without initial length.

View File

@ -55,7 +55,7 @@ DIERef DebugNamesDWARFIndex::ToDIERef(const DebugNames::Entry &entry) {
if (!cu_offset)
return DIERef();
DWARFUnit *cu = m_debug_info.GetCompileUnitAtOffset(*cu_offset);
DWARFUnit *cu = m_debug_info.GetUnitAtOffset(*cu_offset);
if (!cu)
return DIERef();
@ -164,7 +164,7 @@ void DebugNamesDWARFIndex::GetCompleteObjCClass(ConstString class_name,
if (!ref)
continue;
DWARFUnit *cu = m_debug_info.GetCompileUnitAtOffset(ref.cu_offset);
DWARFUnit *cu = m_debug_info.GetUnitAtOffset(ref.cu_offset);
if (!cu || !cu->Supports_DW_AT_APPLE_objc_complete_type()) {
incomplete_types.push_back(ref);
continue;

View File

@ -32,9 +32,9 @@ void ManualDWARFIndex::Index() {
Timer scoped_timer(func_cat, "%p", static_cast<void *>(&debug_info));
std::vector<DWARFUnit *> units_to_index;
units_to_index.reserve(debug_info.GetNumCompileUnits());
for (size_t U = 0; U < debug_info.GetNumCompileUnits(); ++U) {
DWARFUnit *unit = debug_info.GetCompileUnitAtIndex(U);
units_to_index.reserve(debug_info.GetNumUnits());
for (size_t U = 0; U < debug_info.GetNumUnits(); ++U) {
DWARFUnit *unit = debug_info.GetUnitAtIndex(U);
if (unit && m_units_to_avoid.count(unit->GetOffset()) == 0)
units_to_index.push_back(unit);
}
@ -43,8 +43,8 @@ void ManualDWARFIndex::Index() {
std::vector<IndexSet> sets(units_to_index.size());
// Keep memory down by clearing DIEs for any compile units if indexing
// caused us to load the compile unit's DIEs.
// Keep memory down by clearing DIEs for any units if indexing
// caused us to load the unit's DIEs.
std::vector<llvm::Optional<DWARFUnit::ScopedExtractDIEs>> clear_cu_dies(
units_to_index.size());
auto parser_fn = [&](size_t cu_idx) {
@ -55,17 +55,17 @@ void ManualDWARFIndex::Index() {
clear_cu_dies[cu_idx] = units_to_index[cu_idx]->ExtractDIEsScoped();
};
// Create a task runner that extracts dies for each DWARF compile unit in a
// Create a task runner that extracts dies for each DWARF unit in a
// separate thread
// First figure out which compile units didn't have their DIEs already
// First figure out which units didn't have their DIEs already
// parsed and remember this. If no DIEs were parsed prior to this index
// function call, we are going to want to clear the CU dies after we are
// done indexing to make sure we don't pull in all DWARF dies, but we need
// to wait until all compile units have been indexed in case a DIE in one
// compile unit refers to another and the indexes accesses those DIEs.
// to wait until all units have been indexed in case a DIE in one
// unit refers to another and the indexes accesses those DIEs.
TaskMapOverInt(0, units_to_index.size(), extract_fn);
// Now create a task runner that can index each DWARF compile unit in a
// Now create a task runner that can index each DWARF unit in a
// separate thread so we can index quickly.
TaskMapOverInt(0, units_to_index.size(), parser_fn);
@ -95,7 +95,7 @@ void ManualDWARFIndex::IndexUnit(DWARFUnit &unit, IndexSet &set) {
if (log) {
m_module.LogMessage(
log, "ManualDWARFIndex::IndexUnit for compile unit at .debug_info[0x%8.8x]",
log, "ManualDWARFIndex::IndexUnit for unit at .debug_info[0x%8.8x]",
unit.GetOffset());
}
@ -213,7 +213,7 @@ void ManualDWARFIndex::IndexUnitImpl(
// if (block_data) {
// uint32_t block_length = form_value.Unsigned();
// if (block_length == 1 +
// attributes.CompileUnitAtIndex(i)->GetAddressByteSize()) {
// attributes.UnitAtIndex(i)->GetAddressByteSize()) {
// if (block_data[0] == DW_OP_addr)
// add_die = true;
// }

View File

@ -301,13 +301,13 @@ size_t SymbolFileDWARF::GetTypes(SymbolContextScope *sc_scope,
if (dwarf_cu == 0)
return 0;
GetTypes(dwarf_cu->DIE(), dwarf_cu->GetOffset(),
dwarf_cu->GetNextCompileUnitOffset(), type_mask, type_set);
dwarf_cu->GetNextUnitOffset(), type_mask, type_set);
} else {
DWARFDebugInfo *info = DebugInfo();
if (info) {
const size_t num_cus = info->GetNumCompileUnits();
const size_t num_cus = info->GetNumUnits();
for (size_t cu_idx = 0; cu_idx < num_cus; ++cu_idx) {
dwarf_cu = info->GetCompileUnitAtIndex(cu_idx);
dwarf_cu = info->GetUnitAtIndex(cu_idx);
if (dwarf_cu) {
GetTypes(dwarf_cu->DIE(), 0, UINT32_MAX, type_mask, type_set);
}
@ -690,7 +690,7 @@ SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
DWARFDebugInfo *info = DebugInfo();
if (info) {
// The compile unit ID is the index of the DWARF unit.
DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(comp_unit->GetID());
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(comp_unit->GetID());
if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
dwarf_cu->SetUserData(comp_unit);
return dwarf_cu;
@ -794,7 +794,7 @@ lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t SymbolFileDWARF::GetNumCompileUnits() {
DWARFDebugInfo *info = DebugInfo();
if (info)
return info->GetNumCompileUnits();
return info->GetNumUnits();
return 0;
}
@ -803,7 +803,7 @@ CompUnitSP SymbolFileDWARF::ParseCompileUnitAtIndex(uint32_t cu_idx) {
CompUnitSP cu_sp;
DWARFDebugInfo *info = DebugInfo();
if (info) {
DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx);
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(cu_idx);
if (dwarf_cu)
cu_sp = ParseCompileUnit(dwarf_cu, cu_idx);
}
@ -1588,7 +1588,7 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
const uint32_t num_compile_units = GetNumCompileUnits();
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
DWARFUnit *dwarf_cu = debug_info->GetUnitAtIndex(cu_idx);
const DWARFBaseDIE die = dwarf_cu->GetUnitDIEOnly();
if (die && !die.HasChildren()) {
@ -1752,8 +1752,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
}
} else {
uint32_t cu_idx = DW_INVALID_INDEX;
DWARFUnit *dwarf_cu =
debug_info->GetCompileUnitAtOffset(cu_offset, &cu_idx);
DWARFUnit *dwarf_cu = debug_info->GetUnitAtOffset(cu_offset, &cu_idx);
if (dwarf_cu) {
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
if (sc.comp_unit) {
@ -1853,8 +1852,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
uint32_t cu_idx;
DWARFUnit *dwarf_cu = NULL;
for (cu_idx = 0;
(dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx)) != NULL;
for (cu_idx = 0; (dwarf_cu = debug_info->GetUnitAtIndex(cu_idx)) != NULL;
++cu_idx) {
CompileUnit *dc_cu = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
const bool full_match = (bool)file_spec.GetDirectory();
@ -2343,10 +2341,10 @@ void SymbolFileDWARF::GetMangledNamesForFunction(
DWARFDebugInfo *info = DebugInfo();
uint32_t num_comp_units = 0;
if (info)
num_comp_units = info->GetNumCompileUnits();
num_comp_units = info->GetNumUnits();
for (uint32_t i = 0; i < num_comp_units; i++) {
DWARFUnit *cu = info->GetCompileUnitAtIndex(i);
DWARFUnit *cu = info->GetUnitAtIndex(i);
if (cu == nullptr)
continue;
@ -2685,7 +2683,7 @@ bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type(
DWARFDebugInfo *debug_info = DebugInfo();
const uint32_t num_compile_units = GetNumCompileUnits();
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
DWARFUnit *dwarf_cu = debug_info->GetUnitAtIndex(cu_idx);
if (dwarf_cu != cu &&
dwarf_cu->Supports_DW_AT_APPLE_objc_complete_type()) {
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
@ -3110,7 +3108,7 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
return num_variables;
}
} else if (sc.comp_unit) {
DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(sc.comp_unit->GetID());
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(sc.comp_unit->GetID());
if (dwarf_cu == NULL)
return 0;

View File

@ -56,7 +56,7 @@ SymbolFileDWARFDwo::ParseCompileUnit(DWARFUnit *dwarf_cu,
DWARFUnit *SymbolFileDWARFDwo::GetCompileUnit() {
// Only dwo files with 1 compile unit is supported
if (GetNumCompileUnits() == 1)
return DebugInfo()->GetCompileUnitAtIndex(0);
return DebugInfo()->GetUnitAtIndex(0);
else
return nullptr;
}