Fixed globals not showing up for any but the first compile unit due to a

mismatch: I was using the compile unit user ID (the compile unit offset in
the DWARF) as the compile unit index.

llvm-svn: 117948
This commit is contained in:
Greg Clayton 2010-11-01 20:32:12 +00:00
parent 57bbc6ecc6
commit 4b3dc10e65
1 changed files with 7 additions and 3 deletions

View File

@ -3447,7 +3447,12 @@ SymbolFileDWARF::ParseVariablesForContext (const SymbolContext& sc)
{
if (sc.comp_unit != NULL)
{
DWARFCompileUnit* dwarf_cu = GetDWARFCompileUnitForUID(sc.comp_unit->GetID());
DWARFDebugInfo* info = DebugInfo();
if (info == NULL)
return 0;
uint32_t cu_idx = UINT32_MAX;
DWARFCompileUnit* dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID(), &cu_idx).get();
if (dwarf_cu == NULL)
return 0;
@ -3476,9 +3481,8 @@ SymbolFileDWARF::ParseVariablesForContext (const SymbolContext& sc)
if (!m_indexed)
Index ();
std::vector<NameToDIE::Info> global_die_info_array;
const size_t num_globals = m_global_index.FindAllEntriesForCompileUnitWithIndex (sc.comp_unit->GetID(), global_die_info_array);
const size_t num_globals = m_global_index.FindAllEntriesForCompileUnitWithIndex (cu_idx, global_die_info_array);
for (size_t idx=0; idx<num_globals; ++idx)
{
VariableSP var_sp (ParseVariableDIE(sc, dwarf_cu, dwarf_cu->GetDIEAtIndexUnchecked(global_die_info_array[idx].die_idx), LLDB_INVALID_ADDRESS));