[Lldb-commits] [lldb] r177807 - <rdar://problem/13312903>

Enrico Granata egranata at apple.com
Fri Mar 22 18:35:44 PDT 2013


Author: enrico
Date: Fri Mar 22 20:35:44 2013
New Revision: 177807

URL: http://llvm.org/viewvc/llvm-project?rev=177807&view=rev
Log:
<rdar://problem/13312903>

Exports write() and flush() from SBCommandReturnObject to enable file-like output from Python commands.
e.g.:
def ls(debugger, command, result, internal_dict):
    print >>result,”just “some output”

will produce
(lldb) ls
just “some output
(lldb) 

Modified:
    lldb/trunk/scripts/Python/python-extensions.swig

Modified: lldb/trunk/scripts/Python/python-extensions.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-extensions.swig?rev=177807&r1=177806&r2=177807&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-extensions.swig (original)
+++ lldb/trunk/scripts/Python/python-extensions.swig Fri Mar 22 20:35:44 2013
@@ -68,6 +68,13 @@
                 else
                     return PyString_FromString("");
         }
+        void lldb::SBCommandReturnObject::write (const char* str)
+        {
+            if (str)
+                $self->Printf("%s",str);
+        }
+        void lldb::SBCommandReturnObject::flush ()
+        {}
 }
 %extend lldb::SBCompileUnit {
         PyObject *lldb::SBCompileUnit::__str__ (){





More information about the lldb-commits mailing list