Added symbol table access through the module for now. We might need to expose

a SBSymtab class, but for now, we expose the symbols through the module.

llvm-svn: 121112
This commit is contained in:
Greg Clayton committed 2010-12-07 05:40:31 +00:00
1 parent 0d71c4f564
commit bbdabce2f7
4 files changed
+49 -1

No files matched your search

+33
View File
@@ -181,3 +181,36 @@ SBModule::GetDescription (SBStream &description)
return true;
}
size_t
SBModule::GetNumSymbols ()
{
if (m_opaque_sp)
{
ObjectFile *obj_file = m_opaque_sp->GetObjectFile();
if (obj_file)
{
Symtab *symtab = obj_file->GetSymtab();
if (symtab)
return symtab->GetNumSymbols();
}
}
return 0;
}
SBSymbol
SBModule::GetSymbolAtIndex (size_t idx)
{
SBSymbol sb_symbol;
if (m_opaque_sp)
{
ObjectFile *obj_file = m_opaque_sp->GetObjectFile();
if (obj_file)
{
Symtab *symtab = obj_file->GetSymtab();
if (symtab)
sb_symbol.SetSymbol(symtab->SymbolAtIndex (idx));
}
}
return sb_symbol;
}