mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
Added mutex protection to the Symtab class.
Added a new SortOrder enumeration and hooked it up to the "image dump symtab" command so we can dump symbol tables in the original order, sorted by address, or sorted by name. llvm-svn: 116049
This commit is contained in:
@@ -647,6 +647,8 @@ ObjectFileELF::GetSymtab()
|
||||
Symtab *symbol_table = new Symtab(this);
|
||||
m_symtab_ap.reset(symbol_table);
|
||||
|
||||
Mutex::Locker locker (symbol_table->GetMutex ());
|
||||
|
||||
if (!(ParseSectionHeaders() && GetSectionHeaderStringTable()))
|
||||
return symbol_table;
|
||||
|
||||
@@ -658,7 +660,7 @@ ObjectFileELF::GetSymtab()
|
||||
{
|
||||
const ELFSectionHeader &symtab_section = *I;
|
||||
user_id_t section_id = SectionIndex(I);
|
||||
ParseSymbolTable(symbol_table, symtab_section, section_id);
|
||||
ParseSymbolTable (symbol_table, symtab_section, section_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +687,7 @@ ObjectFileELF::Dump(Stream *s)
|
||||
section_list->Dump(s, NULL, true);
|
||||
Symtab *symtab = GetSymtab();
|
||||
if (symtab)
|
||||
symtab->Dump(s, NULL);
|
||||
symtab->Dump(s, NULL, lldb::eSortOrderNone);
|
||||
s->EOL();
|
||||
DumpDependentModules(s);
|
||||
s->EOL();
|
||||
|
||||
@@ -206,6 +206,7 @@ ObjectFileMachO::GetSymtab()
|
||||
if (m_symtab_ap.get() == NULL)
|
||||
{
|
||||
m_symtab_ap.reset(new Symtab(this));
|
||||
Mutex::Locker locker (m_symtab_ap->GetMutex());
|
||||
ParseSymtab (true);
|
||||
}
|
||||
return m_symtab_ap.get();
|
||||
@@ -1348,7 +1349,7 @@ ObjectFileMachO::Dump (Stream *s)
|
||||
m_sections_ap->Dump(s, NULL, true);
|
||||
|
||||
if (m_symtab_ap.get())
|
||||
m_symtab_ap->Dump(s, NULL);
|
||||
m_symtab_ap->Dump(s, NULL, eSortOrderNone);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user