summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-01-23 21:26:30 +0000
committerGreg Clayton <gclayton@apple.com>2014-01-23 21:26:30 +0000
commit09effdacda27ef98292d8eb39d0ac1076cfb552c (patch)
tree0a3450d2c0d606fae52a349700e7916c9f4cd614 /lldb/examples/python
parent1e9d9b20fa9a1b2a07f126d2c92ac984523e9569 (diff)
downloadbcm5719-llvm-09effdacda27ef98292d8eb39d0ac1076cfb552c.tar.gz
bcm5719-llvm-09effdacda27ef98292d8eb39d0ac1076cfb552c.zip
Added a new lldb command that can parse all struct and class types for one or more shared libraries.
llvm-svn: 199937
Diffstat (limited to 'lldb/examples/python')
-rwxr-xr-xlldb/examples/python/types.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/examples/python/types.py b/lldb/examples/python/types.py
index 11f89401143..adf46e7af57 100755
--- a/lldb/examples/python/types.py
+++ b/lldb/examples/python/types.py
@@ -178,7 +178,20 @@ def check_padding_command (debugger, command, result, dict):
result.SetStatus (lldb.eReturnStatusFailed)
return "option parsing failed" # returning a string is the same as returning an error whose description is the string
verify_types(options, debugger.GetSelectedTarget(), command_args)
-
+
+@lldb.command("parse_all_struct_class_types")
+def parse_all_struct_class_types (debugger, command, result, dict):
+ command_args = shlex.split(command)
+ for f in command_args:
+ error = lldb.SBError()
+ target = debugger.CreateTarget (f, None, None, False, error)
+ module = target.GetModuleAtIndex(0)
+ print "Parsing all types in '%s'" % (module)
+ types = module.GetTypes(lldb.eTypeClassClass | lldb.eTypeClassStruct)
+ for t in types:
+ print t
+ print ""
+
def verify_types (target, options):
OpenPOWER on IntegriCloud