[Lldb-commits] [lldb] r135114 - in /lldb/trunk: include/lldb/API/SBTarget.h scripts/Python/modify-python-lldb.py

Johnny Chen johnny.chen at apple.com
Wed Jul 13 17:17:49 PDT 2011


Author: johnny
Date: Wed Jul 13 19:17:49 2011
New Revision: 135114

URL: http://llvm.org/viewvc/llvm-project?rev=135114&view=rev
Log:
Add some more docstrings (includng example usages) to SBTarget.h.

Add logic to modify-python-lldb to correct swig's transformation of 'char **argv' and 'char **envp'
to 'char argv' and 'char envp' by morphing them into the 'list argv' and 'list envp' (as a list of
Python strings).

Modified:
    lldb/trunk/include/lldb/API/SBTarget.h
    lldb/trunk/scripts/Python/modify-python-lldb.py

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=135114&r1=135113&r2=135114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Wed Jul 13 19:17:49 2011
@@ -63,7 +63,7 @@
     GetProcess ();
 
 #ifdef SWIG
-    %feature("autodoc", "
+    %feature("docstring", "
 #endif
     //------------------------------------------------------------------
     /// Launch a new process.
@@ -122,6 +122,20 @@
     ///      A process object for the newly created process.
     //------------------------------------------------------------------
 #ifdef SWIG
+
+For example,
+
+    process = target.Launch(self.dbg.GetListener(), None, None,
+                            None, '/tmp/stdout.txt', None,
+                            None, 0, False, error)
+
+launches a new process by passing nothing for both the args and the envs
+and redirect the standard output of the inferior to the /tmp/stdout.txt
+file. It does not specify a working directory so that the debug server
+will use its idea of what the current working directory is for the
+inferior. Also, we ask the debugger not to stop the inferior at the
+entry point. If no breakpoint is specified for the inferior, it should
+run to completion if no user interaction is required.
     ") Launch;
 #endif
     lldb::SBProcess
@@ -138,7 +152,7 @@
             
     
 #ifdef SWIG
-    %feature("autodoc", "
+    %feature("docstring", "
 #endif
     //------------------------------------------------------------------
     /// Launch a new process with sensible defaults.
@@ -167,6 +181,13 @@
     ///      A process object for the newly created process.
     //------------------------------------------------------------------
 #ifdef SWIG
+
+For example,
+
+    process = target.LaunchSimple(['X', 'Y', 'Z'], None, os.getcwd())
+
+launches a new process by passing 'X', 'Y', 'Z' as the args to the
+executable.
     ") LaunchSimple;
 #endif
     lldb::SBProcess

Modified: lldb/trunk/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modify-python-lldb.py?rev=135114&r1=135113&r2=135114&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/modify-python-lldb.py (original)
+++ lldb/trunk/scripts/Python/modify-python-lldb.py Wed Jul 13 19:17:49 2011
@@ -47,6 +47,9 @@
     """This transforms the 'char', i.e, 'char *' to 'str', Python string."""
     line = line.replace(' char', ' str')
     line = line.replace('char ', 'str ')
+    # Special case handling of 'char **argv' and 'char **envp'.
+    line = line.replace('str argv', 'list argv')
+    line = line.replace('str envp', 'list envp')
     return line
 
 #





More information about the lldb-commits mailing list