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 | |
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')
-rw-r--r-- | lldb/source/API/SBModule.cpp | 33 | ||||
-rw-r--r-- | lldb/source/API/SBSymbol.cpp | 7 |
2 files changed, 39 insertions, 1 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; +} diff --git a/lldb/source/API/SBSymbol.cpp b/lldb/source/API/SBSymbol.cpp index e8281a1b193..64416d0856f 100644 --- a/lldb/source/API/SBSymbol.cpp +++ b/lldb/source/API/SBSymbol.cpp @@ -41,12 +41,17 @@ SBSymbol::operator = (const SBSymbol &rhs) return *this; } - SBSymbol::~SBSymbol () { m_opaque_ptr = NULL; } +void +SBSymbol::SetSymbol (lldb_private::Symbol *lldb_object_ptr) +{ + m_opaque_ptr = lldb_object_ptr; +} + bool SBSymbol::IsValid () const { |