<rdar://problem/12750060>

Add the ability to get a symbol or symbols by name and type from a SBModule, and also the ability to get all symbols by name and type from SBTarget objects.

llvm-svn: 169205
This commit is contained in:
Greg Clayton
2012-12-04 02:22:16 +00:00
parent 15a2860b09
commit e14e19253d
6 changed files with 111 additions and 3 deletions

View File

@@ -177,6 +177,15 @@ public:
lldb::SBSymbol
GetSymbolAtIndex (size_t idx);
lldb::SBSymbol
FindSymbol (const char *name,
lldb::SymbolType type = eSymbolTypeAny);
lldb::SBSymbolContextList
FindSymbols (const char *name,
lldb::SymbolType type = eSymbolTypeAny);
size_t
GetNumSections ();
@@ -269,9 +278,10 @@ public:
return self.sbmodule.GetSymbolAtIndex(key)
elif type(key) is str:
matches = []
for idx in range(count):
symbol = self.sbmodule.GetSymbolAtIndex(idx)
if symbol.name == key or symbol.mangled == key:
sc_list = self.sbmodule.FindSymbols(key)
for sc in sc_list:
symbol = sc.symbol
if symbol:
matches.append(symbol)
return matches
elif isinstance(key, self.re_compile_type):