Lines Matching full:command
26 lldb command interpreter (we refer to this for brevity as the embedded interpreter). Of course,
36 <p>The LLDB API is contained in a python module named <b>lldb</b> documented <a href="python_reference/index.html">here</a>. The documentation is also accessible in an interactive debugger session with the following command:</p>
86 easiest way is to use the lldb command <b>script</b> with no arguments at the lldb command prompt:</p>
96 <p>This drops you into the embedded python interpreter. When running under the <b>script</b> command,
116 Contains the debugger object whose <b>script</b> command was invoked.
117 The <b>lldb.SBDebugger</b> object owns the command interpreter
131 <b>file</b> or selected by the <b>target select <target-index></b> command.
159 A thread is always selected in the command interpreter when a target stops.
160 The <b>thread select <thread-index></b> command can be used to change the
176 A stack frame is always selected in the command interpreter when a target stops.
177 The <b>frame select <frame-index></b> command can be used to change the
192 run in a multithreaded environment, and another thread might call the "script" command, changing the value out
274 <p>Optionally, a Python breakpoint command can return a value. Returning False tells LLDB that you do not want to stop at the breakpoint.
291 command.
297 (lldb) <strong>breakpoint command add --script-type python 1</strong>
298 command(s). Type 'DONE' to end.
312 <p>The <b>breakpoint command add</b> command above attaches a python script to breakpoint 1.
313 To remove the breakpoint command:
314 <p><code>(lldb) <strong>breakpoint command delete 1</strong></code>
318 <h1 class ="postheader">Create a new LLDB command using a python function</h1>
321 <p>Python functions can be used to create new LLDB command interpreter commands, which will work
324 <p>To write a python function that implements a new LDB command define the function to take four arguments as follows:</p>
326 <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>internal_dict</b>):
330 Optionally, you can also provide a Python docstring, and LLDB will use it when providing help for your command, as in:
331 <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>internal_dict</b>):
332 <font color=green>"""This command takes a lot of options and does many fancy things"""</font>
356 <b>command</b>
362 A python string containing all arguments for your command. If you need to chop up the arguments
363 try using the <b>shlex</b> module's <code>shlex.split(command)</code> to properly extract the
375 A return object which encapsulates success/failure information for the command and output text
376 that needs to be printed as a result of the command. The plain Python "print" command also works but
394 <code><pre><tt>print >>result, "my command does lots of cool stuff"</tt></pre></code>
397 <p>One other handy convenience when defining lldb command-line commands is the command
398 <b>command script import</b> which will import a module specified by file path - so you
403 <font color=green># Command Initialization code goes here</font>
408 this function will only be run when using the LLDB comand <b>command script import</b>,
420 # can be run from the command line. When we run a script from
421 # the command line, we won't have any debugger object in
426 lldb.debugger.HandleCommand('command script add -f ls.ls ls')
427 print 'The "ls" python command has been installed and is ready for use.'
430 can be used by LLDB's python command code:</p>
439 def ls(debugger, command, result, internal_dict):
440 print >>result, (commands.getoutput('/bin/ls %s' % command))
444 debugger.HandleCommand('command script add -f ls.ls ls')
445 print 'The "ls" python command has been installed and is ready for use.'
449 (lldb) <strong>command script import ~/ls.py</strong>
450 The "ls" python command has been installed and is ready for use.
457 lldb command quickly:</p>
460 A commonly required facility is being able to create a command that does some token substitution, and then runs a different debugger command
477 you may want a pofoo X command, that equates po [ModifyString(X) capitalizedString].
482 >>> <b>def pofoo_funct(debugger, command, result, internal_dict):</b>
483 ... <b>cmd = "po [ModifyString(" + command + ") capitalizedString]"</b>
487 (lldb) <b>command script add pofoo -f pofoo_funct</b>
498 used by the <b>lldb</b> command line application. On Mac OS X this