summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python/cmdtemplate.py
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-01-24 02:40:42 +0000
committerJim Ingham <jingham@apple.com>2012-01-24 02:40:42 +0000
commit87a593687cd4a67801149e4cc7aa6727f3fd41df (patch)
tree5734574824122f2b8185f388fab03189d50a4289 /lldb/examples/python/cmdtemplate.py
parent7a8c477f2a24ddc32e480e2e2f58de76486df5b2 (diff)
downloadbcm5719-llvm-87a593687cd4a67801149e4cc7aa6727f3fd41df.tar.gz
bcm5719-llvm-87a593687cd4a67801149e4cc7aa6727f3fd41df.zip
Proof-reading the python docs.
llvm-svn: 148768
Diffstat (limited to 'lldb/examples/python/cmdtemplate.py')
-rw-r--r--lldb/examples/python/cmdtemplate.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lldb/examples/python/cmdtemplate.py b/lldb/examples/python/cmdtemplate.py
index 12192e9b916..b7ad0a373de 100644
--- a/lldb/examples/python/cmdtemplate.py
+++ b/lldb/examples/python/cmdtemplate.py
@@ -33,17 +33,18 @@ def ls(debugger, command, result, dict):
for arg in args:
if options.verbose:
- print commands.getoutput('/bin/ls "%s"' % arg)
+ result.PutCString(commands.getoutput('/bin/ls "%s"' % arg))
else:
- print commands.getoutput('/bin/ls -lAF "%s"' % arg)
+ result.PutCString(commands.getoutput('/bin/ls -lAF "%s"' % arg))
if __name__ == '__main__':
# This script is being run from the command line, create a debugger in case we are
# going to use any debugger functions in our function.
lldb.debugger = lldb.SBDebugger.Create()
ls (sys.argv)
-elif lldb.debugger:
- # This script is being run from LLDB in the emabedded command interpreter
+
+def __lldb_init_module (debugger, dict):
+ # This initializer is being run from LLDB in the embedded command interpreter
# Add any commands contained in this module to LLDB
- lldb.debugger.HandleCommand('command script add -f cmdtemplate.ls ls')
+ debugger.HandleCommand('command script add -f cmdtemplate.ls ls')
print '"ls" command installed, type "ls --help" for detailed help'
OpenPOWER on IntegriCloud