summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-12-04 02:22:16 +0000
committerGreg Clayton <gclayton@apple.com>2012-12-04 02:22:16 +0000
commite14e19253df64b750ced6da0948418f6c80da6c9 (patch)
tree1b41fd23856f63691ed4ec09cca23977dda7d446 /lldb/scripts/Python
parent15a2860b09c55e2531b1e70b69d7dc56a05060e9 (diff)
downloadbcm5719-llvm-e14e19253df64b750ced6da0948418f6c80da6c9.tar.gz
bcm5719-llvm-e14e19253df64b750ced6da0948418f6c80da6c9.zip
<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
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r--lldb/scripts/Python/interface/SBModule.i16
-rw-r--r--lldb/scripts/Python/interface/SBTarget.i3
2 files changed, 16 insertions, 3 deletions
diff --git a/lldb/scripts/Python/interface/SBModule.i b/lldb/scripts/Python/interface/SBModule.i
index ccfbed6b2db..b98afdecde9 100644
--- a/lldb/scripts/Python/interface/SBModule.i
+++ b/lldb/scripts/Python/interface/SBModule.i
@@ -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):
diff --git a/lldb/scripts/Python/interface/SBTarget.i b/lldb/scripts/Python/interface/SBTarget.i
index 8a304ee99c4..bc4c2289745 100644
--- a/lldb/scripts/Python/interface/SBTarget.i
+++ b/lldb/scripts/Python/interface/SBTarget.i
@@ -687,6 +687,9 @@ public:
lldb::SBInstructionList
GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t size);
+ lldb::SBSymbolContextList
+ FindSymbols (const char *name, lldb::SymbolType type = eSymbolTypeAny);
+
bool
GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
OpenPOWER on IntegriCloud