diff options
author | Greg Clayton <gclayton@apple.com> | 2010-12-07 05:40:31 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-12-07 05:40:31 +0000 |
commit | bbdabce2f79af1334d2627c80c136b2a5bfb48b9 (patch) | |
tree | 8802a60eda6d0e6c6fd7e5d08e6680ac2ddb53f5 /lldb/source/API/SBModule.cpp | |
parent | 0d71c4f564fc0e6635b18d111e8a416d5efe4113 (diff) | |
download | bcm5719-llvm-bbdabce2f79af1334d2627c80c136b2a5bfb48b9.tar.gz bcm5719-llvm-bbdabce2f79af1334d2627c80c136b2a5bfb48b9.zip |
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
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r-- | lldb/source/API/SBModule.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 7120e590daa..0a5c8aaacc3 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -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; +} |