summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp133
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp76
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h37
-rw-r--r--lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp7
4 files changed, 166 insertions, 87 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 2099a3bb5b4..3c41ebee84e 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -206,7 +206,7 @@ ObjectFileMachO::GetSymtab()
if (m_symtab_ap.get() == NULL)
{
m_symtab_ap.reset(new Symtab(this));
- ParseSymtab (false);
+ ParseSymtab (true);
}
return m_symtab_ap.get();
}
@@ -638,7 +638,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
// ...
assert (!"UNIMPLEMENTED: Swap all nlist entries");
}
- uint32_t N_SO_index = UINT_MAX;
+ uint32_t N_SO_index = UINT32_MAX;
MachSymtabSectionInfo section_info (section_list);
std::vector<uint32_t> N_FUN_indexes;
@@ -647,8 +647,12 @@ ObjectFileMachO::ParseSymtab (bool minimize)
std::vector<uint32_t> N_BRAC_indexes;
std::vector<uint32_t> N_COMM_indexes;
typedef std::map <uint64_t, uint32_t> ValueToSymbolIndexMap;
+ typedef std::map <uint32_t, uint32_t> IndexToIndexMap;
ValueToSymbolIndexMap N_FUN_addr_to_sym_idx;
ValueToSymbolIndexMap N_STSYM_addr_to_sym_idx;
+ // Any symbols that get merged into another will get an entry
+ // in this map so we know
+ IndexToIndexMap m_index_map;
uint32_t nlist_idx = 0;
Symbol *symbol_ptr = NULL;
@@ -693,21 +697,22 @@ ObjectFileMachO::ParseSymtab (bool minimize)
case StabGlobalSymbol:
// N_GSYM -- global symbol: name,,NO_SECT,type,0
// Sometimes the N_GSYM value contains the address.
+ sym[sym_idx].SetExternal(true);
if (nlist.n_value != 0)
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
- type = eSymbolTypeGlobal;
+ type = eSymbolTypeData;
break;
case StabFunctionName:
// N_FNAME -- procedure name (f77 kludge): name,,NO_SECT,0,0
- type = eSymbolTypeFunction;
+ type = eSymbolTypeCompiler;
break;
case StabFunction:
// N_FUN -- procedure: name,,n_sect,linenumber,address
if (symbol_name)
{
- type = eSymbolTypeFunction;
+ type = eSymbolTypeCode;
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
N_FUN_addr_to_sym_idx[nlist.n_value] = sym_idx;
@@ -717,7 +722,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
}
else
{
- type = eSymbolTypeFunctionEnd;
+ type = eSymbolTypeCompiler;
if ( !N_FUN_indexes.empty() )
{
@@ -738,7 +743,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
// N_STSYM -- static symbol: name,,n_sect,type,address
N_STSYM_addr_to_sym_idx[nlist.n_value] = sym_idx;
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
- type = eSymbolTypeStatic;
+ type = eSymbolTypeData;
break;
case StabLocalCommon:
@@ -814,20 +819,15 @@ ObjectFileMachO::ParseSymtab (bool minimize)
type = eSymbolTypeSourceFile;
if (symbol_name == NULL)
{
- if (N_SO_index == UINT_MAX)
- {
- // Skip the extra blank N_SO entries that happen when the entire
- // path is contained in the second consecutive N_SO STAB.
- if (minimize)
- add_nlist = false;
- }
- else
+ if (minimize)
+ add_nlist = false;
+ if (N_SO_index != UINT32_MAX)
{
// Set the size of the N_SO to the terminating index of this N_SO
// so that we can always skip the entire N_SO if we need to navigate
// more quickly at the source level when parsing STABS
symbol_ptr = symtab->SymbolAtIndex(N_SO_index);
- symbol_ptr->SetByteSize(sym_idx + 1);
+ symbol_ptr->SetByteSize(sym_idx + (minimize ? 0 : 1));
symbol_ptr->SetSizeIsSibling(true);
}
N_NSYM_indexes.clear();
@@ -835,14 +835,30 @@ ObjectFileMachO::ParseSymtab (bool minimize)
N_BRAC_indexes.clear();
N_COMM_indexes.clear();
N_FUN_indexes.clear();
- N_SO_index = UINT_MAX;
+ N_SO_index = UINT32_MAX;
}
- else if (symbol_name[0] == '/')
+ else
{
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
- N_SO_index = sym_idx;
+ if (symbol_name[0] == '/')
+ N_SO_index = sym_idx;
+ else if (minimize && (N_SO_index == sym_idx - 1))
+ {
+ const char *so_path = sym[sym_idx - 1].GetMangled().GetDemangledName().AsCString();
+ if (so_path && so_path[0])
+ {
+ std::string full_so_path (so_path);
+ if (*full_so_path.rbegin() != '/')
+ full_so_path += '/';
+ full_so_path += symbol_name;
+ sym[sym_idx - 1].GetMangled().SetValue(full_so_path.c_str(), false);
+ add_nlist = false;
+ m_index_map[nlist_idx] = sym_idx - 1;
+ }
+ }
}
+
break;
case StabObjectFileName:
@@ -1103,45 +1119,48 @@ ObjectFileMachO::ParseSymtab (bool minimize)
if (symbol_name)
sym[sym_idx].GetMangled().SetValue(symbol_name, symbol_name_is_mangled);
- if (type == eSymbolTypeCode)
+ if (is_debug == false)
{
- // See if we can find a N_FUN entry for any code symbols.
- // If we do find a match, and the name matches, then we
- // can merge the two into just the function symbol to avoid
- // duplicate entries in the symbol table
- ValueToSymbolIndexMap::const_iterator pos = N_FUN_addr_to_sym_idx.find (nlist.n_value);
- if (pos != N_FUN_addr_to_sym_idx.end())
+ if (type == eSymbolTypeCode)
{
- if ((symbol_name_is_mangled == true && sym[sym_idx].GetMangled().GetMangledName() == sym[pos->second].GetMangled().GetMangledName()) ||
- (symbol_name_is_mangled == false && sym[sym_idx].GetMangled().GetDemangledName() == sym[pos->second].GetMangled().GetDemangledName()))
+ // See if we can find a N_FUN entry for any code symbols.
+ // If we do find a match, and the name matches, then we
+ // can merge the two into just the function symbol to avoid
+ // duplicate entries in the symbol table
+ ValueToSymbolIndexMap::const_iterator pos = N_FUN_addr_to_sym_idx.find (nlist.n_value);
+ if (pos != N_FUN_addr_to_sym_idx.end())
{
-
- // We just need the flags from the linker symbol, so put these flags
- // into the N_FUN flags to avoid duplicate symbols in the symbol table
- sym[pos->second].SetFlags (nlist.n_type << 16 | nlist.n_desc);
- sym[sym_idx].GetMangled().Clear();
- continue;
+ if ((symbol_name_is_mangled == true && sym[sym_idx].GetMangled().GetMangledName() == sym[pos->second].GetMangled().GetMangledName()) ||
+ (symbol_name_is_mangled == false && sym[sym_idx].GetMangled().GetDemangledName() == sym[pos->second].GetMangled().GetDemangledName()))
+ {
+ m_index_map[nlist_idx] = pos->second;
+ // We just need the flags from the linker symbol, so put these flags
+ // into the N_FUN flags to avoid duplicate symbols in the symbol table
+ sym[pos->second].SetFlags (nlist.n_type << 16 | nlist.n_desc);
+ sym[sym_idx].Clear();
+ continue;
+ }
}
}
- }
- else if (type == eSymbolTypeData)
- {
- // See if we can find a N_STSYM entry for any data symbols.
- // If we do find a match, and the name matches, then we
- // can merge the two into just the Static symbol to avoid
- // duplicate entries in the symbol table
- ValueToSymbolIndexMap::const_iterator pos = N_STSYM_addr_to_sym_idx.find (nlist.n_value);
- if (pos != N_STSYM_addr_to_sym_idx.end())
+ else if (type == eSymbolTypeData)
{
- if ((symbol_name_is_mangled == true && sym[sym_idx].GetMangled().GetMangledName() == sym[pos->second].GetMangled().GetMangledName()) ||
- (symbol_name_is_mangled == false && sym[sym_idx].GetMangled().GetDemangledName() == sym[pos->second].GetMangled().GetDemangledName()))
+ // See if we can find a N_STSYM entry for any data symbols.
+ // If we do find a match, and the name matches, then we
+ // can merge the two into just the Static symbol to avoid
+ // duplicate entries in the symbol table
+ ValueToSymbolIndexMap::const_iterator pos = N_STSYM_addr_to_sym_idx.find (nlist.n_value);
+ if (pos != N_STSYM_addr_to_sym_idx.end())
{
-
- // We just need the flags from the linker symbol, so put these flags
- // into the N_STSYM flags to avoid duplicate symbols in the symbol table
- sym[pos->second].SetFlags (nlist.n_type << 16 | nlist.n_desc);
- sym[sym_idx].GetMangled().Clear();
- continue;
+ if ((symbol_name_is_mangled == true && sym[sym_idx].GetMangled().GetMangledName() == sym[pos->second].GetMangled().GetMangledName()) ||
+ (symbol_name_is_mangled == false && sym[sym_idx].GetMangled().GetDemangledName() == sym[pos->second].GetMangled().GetDemangledName()))
+ {
+ m_index_map[nlist_idx] = pos->second;
+ // We just need the flags from the linker symbol, so put these flags
+ // into the N_STSYM flags to avoid duplicate symbols in the symbol table
+ sym[pos->second].SetFlags (nlist.n_type << 16 | nlist.n_desc);
+ sym[sym_idx].Clear();
+ continue;
+ }
}
}
}
@@ -1171,13 +1190,13 @@ ObjectFileMachO::ParseSymtab (bool minimize)
Symbol *global_symbol = NULL;
for (nlist_idx = 0;
- nlist_idx < symtab_load_command.nsyms && (global_symbol = symtab->FindSymbolWithType(eSymbolTypeGlobal, nlist_idx)) != NULL;
+ nlist_idx < symtab_load_command.nsyms && (global_symbol = symtab->FindSymbolWithType (eSymbolTypeData, Symtab::eDebugYes, Symtab::eVisibilityAny, nlist_idx)) != NULL;
nlist_idx++)
{
if (global_symbol->GetValue().GetFileAddress() == 0)
{
std::vector<uint32_t> indexes;
- if (symtab->AppendSymbolIndexesWithName(global_symbol->GetMangled().GetName(), indexes) > 0)
+ if (symtab->AppendSymbolIndexesWithName (global_symbol->GetMangled().GetName(), indexes) > 0)
{
std::vector<uint32_t>::const_iterator pos;
std::vector<uint32_t>::const_iterator end = indexes.end();
@@ -1200,6 +1219,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
if (indirect_symbol_indexes_sp && indirect_symbol_indexes_sp->GetByteSize())
{
+ IndexToIndexMap::const_iterator end_index_pos = m_index_map.end();
DataExtractor indirect_symbol_index_data (indirect_symbol_indexes_sp, m_data.GetByteOrder(), m_data.GetAddressByteSize());
for (uint32_t sect_idx = 1; sect_idx < m_mach_sections.size(); ++sect_idx)
@@ -1224,7 +1244,12 @@ ObjectFileMachO::ParseSymtab (bool minimize)
uint32_t symbol_stub_offset = symbol_stub_index * 4;
if (indirect_symbol_index_data.ValidOffsetForDataOfSize(symbol_stub_offset, 4))
{
- const uint32_t symbol_index = indirect_symbol_index_data.GetU32 (&symbol_stub_offset);
+ uint32_t symbol_index = indirect_symbol_index_data.GetU32 (&symbol_stub_offset);
+
+ IndexToIndexMap::const_iterator index_pos = m_index_map.find (symbol_index);
+ assert (index_pos == end_index_pos); // TODO: remove this assert if it fires, else remove m_index_map
+ if (index_pos != end_index_pos)
+ symbol_index = index_pos->second;
Symbol *stub_symbol = symtab->FindSymbolByID (symbol_index);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 007cec97f3c..0140dd2dc70 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -91,8 +91,8 @@ SymbolFileDWARFDebugMap::InitOSO ()
std::vector<uint32_t> oso_indexes;
const uint32_t oso_index_count = symtab->AppendSymbolIndexesWithType(eSymbolTypeObjectFile, oso_indexes);
- symtab->AppendSymbolIndexesWithType(eSymbolTypeFunction, m_func_indexes);
- symtab->AppendSymbolIndexesWithType(eSymbolTypeGlobal, m_glob_indexes);
+ symtab->AppendSymbolIndexesWithType (eSymbolTypeCode, Symtab::eDebugYes, Symtab::eVisibilityAny, m_func_indexes);
+ symtab->AppendSymbolIndexesWithType (eSymbolTypeData, Symtab::eDebugYes, Symtab::eVisibilityAny, m_glob_indexes);
symtab->SortSymbolIndexesByValue(m_func_indexes, true);
symtab->SortSymbolIndexesByValue(m_glob_indexes, true);
@@ -109,6 +109,12 @@ SymbolFileDWARFDebugMap::InitOSO ()
if (m_compile_unit_infos[i].so_symbol->GetSiblingIndex() == 0)
m_compile_unit_infos[i].so_symbol = symtab->SymbolAtIndex(oso_indexes[i] - 2);
m_compile_unit_infos[i].oso_symbol = symtab->SymbolAtIndex(oso_indexes[i]);
+ uint32_t sibling_idx = m_compile_unit_infos[i].so_symbol->GetSiblingIndex();
+ assert (sibling_idx != 0);
+ assert (sibling_idx > i + 1);
+ m_compile_unit_infos[i].last_symbol = symtab->SymbolAtIndex (sibling_idx - 1);
+ m_compile_unit_infos[i].first_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].so_symbol);
+ m_compile_unit_infos[i].last_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].last_symbol);
}
}
}
@@ -243,7 +249,9 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit
//SectionList *oso_sections = oso_objfile->Sections();
// Now we need to make sections that map from zero based object
// file addresses to where things eneded up in the main executable.
- uint32_t oso_start_idx = comp_unit_info->oso_symbol->GetID() + 1;
+ uint32_t oso_start_idx = exe_symtab->GetIndexForSymbol (comp_unit_info->oso_symbol);
+ assert (oso_start_idx != UINT32_MAX);
+ oso_start_idx += 1;
const uint32_t oso_end_idx = comp_unit_info->so_symbol->GetSiblingIndex();
uint32_t sect_id = 0x10000;
for (uint32_t idx = oso_start_idx; idx < oso_end_idx; ++idx)
@@ -251,9 +259,12 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit
Symbol *exe_symbol = exe_symtab->SymbolAtIndex(idx);
if (exe_symbol)
{
+ if (exe_symbol->IsDebug() == false)
+ continue;
+
switch (exe_symbol->GetType())
{
- case eSymbolTypeFunction:
+ case eSymbolTypeCode:
{
// For each N_FUN, or function that we run into in the debug map
// we make a new section that we add to the sections found in the
@@ -265,7 +276,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit
// correctly to the new addresses in the main executable.
// First we find the original symbol in the .o file's symbol table
- Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeCode);
+ Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeCode, Symtab::eDebugNo, Symtab::eVisibilityAny);
if (oso_fun_symbol)
{
// If we found the symbol, then we
@@ -299,8 +310,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit
}
break;
- case eSymbolTypeGlobal:
- case eSymbolTypeStatic:
+ case eSymbolTypeData:
{
// For each N_GSYM we remap the address for the global by making
// a new section that we add to the sections found in the .o file.
@@ -317,7 +327,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit
#if 0
// First we find the non-stab entry that corresponds to the N_GSYM in the executable
- Symbol *exe_gsym_symbol = exe_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeData);
+ Symbol *exe_gsym_symbol = exe_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeData, Symtab::eDebugNo, Symtab::eVisibilityAny);
#else
// The mach-o object file parser already matches up the N_GSYM with with the non-stab
// entry, so we shouldn't have to do that. If this ever changes, enable the code above
@@ -325,7 +335,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit
Symbol *exe_gsym_symbol = exe_symbol;
#endif
// Next we find the non-stab entry that corresponds to the N_GSYM in the .o file
- Symbol *oso_gsym_symbol = oso_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeData);
+ Symbol *oso_gsym_symbol = oso_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeData, Symtab::eDebugNo, Symtab::eVisibilityAny);
if (exe_gsym_symbol && oso_gsym_symbol)
{
// If we found the symbol, then we
@@ -598,7 +608,7 @@ SymbolFileDWARFDebugMap::ResolveSymbolContext (const Address& exe_so_addr, uint3
resolved_flags |= eSymbolContextSymbol;
uint32_t oso_idx = 0;
- CompileUnitInfo* comp_unit_info = GetCompileUnitInfoForSymbolWithIndex (sc.symbol->GetID(), &oso_idx);
+ CompileUnitInfo* comp_unit_info = GetCompileUnitInfoForSymbolWithID (sc.symbol->GetID(), &oso_idx);
if (comp_unit_info)
{
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx);
@@ -709,7 +719,7 @@ SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, bool appe
if (symtab)
{
std::vector<uint32_t> indexes;
- const size_t match_count = m_obj_file->GetSymtab()->FindAllSymbolsWithNameAndType (name, eSymbolTypeGlobal, indexes);
+ const size_t match_count = m_obj_file->GetSymtab()->FindAllSymbolsWithNameAndType (name, eSymbolTypeData, Symtab::eDebugYes, Symtab::eVisibilityAny, indexes);
if (match_count)
{
PrivateFindGlobalVariables (name, indexes, max_matches, variables);
@@ -728,14 +738,29 @@ SymbolFileDWARFDebugMap::FindGlobalVariables (const RegularExpression& regex, bo
int
-SymbolFileDWARFDebugMap::SymbolContainsSymbolIndex (uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
+SymbolFileDWARFDebugMap::SymbolContainsSymbolWithIndex (uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
{
const uint32_t symbol_idx = *symbol_idx_ptr;
- if (symbol_idx < comp_unit_info->so_symbol->GetID())
+ if (symbol_idx < comp_unit_info->first_symbol_index)
+ return -1;
+
+ if (symbol_idx <= comp_unit_info->last_symbol_index)
+ return 0;
+
+ return 1;
+}
+
+
+int
+SymbolFileDWARFDebugMap::SymbolContainsSymbolWithID (user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
+{
+ const user_id_t symbol_id = *symbol_idx_ptr;
+
+ if (symbol_id < comp_unit_info->so_symbol->GetID())
return -1;
- if (symbol_idx < comp_unit_info->so_symbol->GetSiblingIndex())
+ if (symbol_id <= comp_unit_info->last_symbol->GetID())
return 0;
return 1;
@@ -749,7 +774,7 @@ SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex (uint32_t symbol_i
CompileUnitInfo *comp_unit_info = NULL;
if (oso_index_count)
{
- comp_unit_info = (CompileUnitInfo*)bsearch(&symbol_idx, &m_compile_unit_infos[0], m_compile_unit_infos.size(), sizeof(CompileUnitInfo), (comparison_function)SymbolContainsSymbolIndex);
+ comp_unit_info = (CompileUnitInfo*)bsearch(&symbol_idx, &m_compile_unit_infos[0], m_compile_unit_infos.size(), sizeof(CompileUnitInfo), (comparison_function)SymbolContainsSymbolWithIndex);
}
if (oso_idx_ptr)
@@ -762,6 +787,27 @@ SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex (uint32_t symbol_i
return comp_unit_info;
}
+SymbolFileDWARFDebugMap::CompileUnitInfo*
+SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID (user_id_t symbol_id, uint32_t *oso_idx_ptr)
+{
+ const uint32_t oso_index_count = m_compile_unit_infos.size();
+ CompileUnitInfo *comp_unit_info = NULL;
+ if (oso_index_count)
+ {
+ comp_unit_info = (CompileUnitInfo*)bsearch(&symbol_id, &m_compile_unit_infos[0], m_compile_unit_infos.size(), sizeof(CompileUnitInfo), (comparison_function)SymbolContainsSymbolWithID);
+ }
+
+ if (oso_idx_ptr)
+ {
+ if (comp_unit_info != NULL)
+ *oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
+ else
+ *oso_idx_ptr = UINT32_MAX;
+ }
+ return comp_unit_info;
+}
+
+
static void
RemoveFunctionsWithModuleNotEqualTo (Module *module, SymbolContextList &sc_list, uint32_t start_idx)
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
index a14943f74df..adb0ec5136d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -105,26 +105,29 @@ protected:
lldb_private::FileSpec so_file;
lldb_private::Symbol *so_symbol;
lldb_private::Symbol *oso_symbol;
+ lldb_private::Symbol *last_symbol;
+ uint32_t first_symbol_index;
+ uint32_t last_symbol_index;
lldb::ModuleSP oso_module_sp;
lldb::CompUnitSP oso_compile_unit_sp;
lldb_private::SymbolVendor *oso_symbol_vendor;
-// lldb_private::shared_ptr<SymbolFileDWARF> oso_dwarf_sp;
-// lldb_private::shared_ptr<SymbolVendor> oso_dwarf_sp;
std::vector<uint32_t> function_indexes;
std::vector<uint32_t> static_indexes;
lldb::SharedPtr<lldb_private::SectionList>::Type debug_map_sections_sp;
CompileUnitInfo() :
- so_file(),
- so_symbol(NULL),
- oso_symbol(NULL),
- oso_module_sp(),
- oso_compile_unit_sp(),
- oso_symbol_vendor(NULL),
-// oso_dwarf_sp(),
- function_indexes(),
- static_indexes(),
- debug_map_sections_sp()
+ so_file (),
+ so_symbol (NULL),
+ oso_symbol (NULL),
+ last_symbol (NULL),
+ first_symbol_index (UINT32_MAX),
+ last_symbol_index (UINT32_MAX),
+ oso_module_sp (),
+ oso_compile_unit_sp (),
+ oso_symbol_vendor (NULL),
+ function_indexes (),
+ static_indexes (),
+ debug_map_sections_sp ()
{
}
};
@@ -162,11 +165,17 @@ protected:
SymbolFileDWARF *
GetSymbolFileByOSOIndex (uint32_t oso_idx);
- CompileUnitInfo*
+ CompileUnitInfo *
GetCompileUnitInfoForSymbolWithIndex (uint32_t symbol_idx, uint32_t *oso_idx_ptr);
+
+ CompileUnitInfo *
+ GetCompileUnitInfoForSymbolWithID (lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr);
+
+ static int
+ SymbolContainsSymbolWithIndex (uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info);
static int
- SymbolContainsSymbolIndex (uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info);
+ SymbolContainsSymbolWithID (lldb::user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info);
uint32_t
PrivateFindGlobalVariables (const lldb_private::ConstString &name,
diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
index e7af0bdfa8b..91e4cd4ff0e 100644
--- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
+++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
@@ -90,14 +90,14 @@ SymbolFileSymtab::GetAbilities ()
{
abilities |= CompileUnits;
}
- symtab->AppendSymbolIndexesWithType(eSymbolTypeFunction, m_func_indexes);
+ symtab->AppendSymbolIndexesWithType(eSymbolTypeCode, Symtab::eDebugYes, Symtab::eVisibilityAny, m_func_indexes);
if (!m_func_indexes.empty())
{
symtab->SortSymbolIndexesByValue(m_func_indexes, true);
abilities |= Functions;
}
- symtab->AppendSymbolIndexesWithType(eSymbolTypeCode, m_code_indexes);
+ symtab->AppendSymbolIndexesWithType(eSymbolTypeCode, Symtab::eDebugNo, Symtab::eVisibilityAny, m_code_indexes);
if (!m_code_indexes.empty())
{
symtab->SortSymbolIndexesByValue(m_code_indexes, true);
@@ -319,8 +319,7 @@ SymbolFileSymtab::FindFunctions(const ConstString &name, uint32_t name_type_mask
{
const uint32_t start_size = sc_list.GetSize();
std::vector<uint32_t> symbol_indexes;
- symtab->FindAllSymbolsWithNameAndType (name, eSymbolTypeFunction, symbol_indexes);
- symtab->FindAllSymbolsWithNameAndType (name, eSymbolTypeCode, symbol_indexes);
+ symtab->FindAllSymbolsWithNameAndType (name, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
const uint32_t num_matches = symbol_indexes.size();
if (num_matches)
{
OpenPOWER on IntegriCloud