[Lldb-commits] [lldb] r232225 - Introduce documentation for Python command objects

Enrico Granata egranata at apple.com
Fri Mar 13 15:27:36 PDT 2015


Author: enrico
Date: Fri Mar 13 17:27:36 2015
New Revision: 232225

URL: http://llvm.org/viewvc/llvm-project?rev=232225&view=rev
Log:
Introduce documentation for Python command objects

Modified:
    lldb/trunk/www/python-reference.html

Modified: lldb/trunk/www/python-reference.html
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/python-reference.html?rev=232225&r1=232224&r2=232225&view=diff
==============================================================================
--- lldb/trunk/www/python-reference.html (original)
+++ lldb/trunk/www/python-reference.html Fri Mar 13 17:27:36 2015
@@ -411,6 +411,24 @@ Enter your Python command(s). Type 'DONE
             </td>
         </tr>
         </table>
+				
+				<p>Starting with SVN revision 232224, Python commands can also be implemented by means of a class
+					which should implement the following interface:</p>
+
+		<code>
+			<font color=blue>class</font> CommandObjectType:<br/>
+			    <font color=blue>def</font> __init__(self, debugger, session_dict):<br/>
+			        <i>this call should initialize the command with respect to the command interpeter for the passed-in debugger</i> <br/>
+			    <font color=blue>def</font> __call__(self, debugger, command, exe_ctx, result): <br/>
+			        <i>this is the actual bulk of the command, akin to Python command functions</i> <br/>
+			    <font color=blue>def</font> get_short_help(self): <br/>
+			        <i>this call should return the short help text for this command</i><sup>[1]</sup><br/>
+			    <font color=blue>def</font> get_long_help(self): <br/>
+			        <i>this call should return the long help text for this command</i><sup>[1]</sup><br/>
+		</code>
+				
+<sup>[1]</sup> This method is optional.
+
         <p>As a convenience, you can treat the result object as a Python file object, and say
         <code><pre><tt>print >>result, "my command does lots of cool stuff"</tt></pre></code>
         SBCommandReturnObject and SBStream





More information about the lldb-commits mailing list