[Lldb-commits] [lldb] r129791 - in /lldb/trunk/test/python_api/function_symbol: TestDisasmAPI.py TestSymbolAPI.py

Johnny Chen johnny.chen at apple.com
Tue Apr 19 12:44:26 PDT 2011


Author: johnny
Date: Tue Apr 19 14:44:26 2011
New Revision: 129791

URL: http://llvm.org/viewvc/llvm-project?rev=129791&view=rev
Log:
Converted to use SBProcess.LaunchSimple() API.
And use self.TraceOn() in order to print more debug output.

Modified:
    lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
    lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py

Modified: lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py?rev=129791&r1=129790&r2=129791&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py Tue Apr 19 14:44:26 2011
@@ -53,8 +53,7 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        error = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
         self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
@@ -74,7 +73,8 @@
         context1 = target.ResolveSymbolContextForAddress(address1, lldb.eSymbolContextEverything)
 
         self.assertTrue(context1.IsValid())
-        print "context1:", context1
+        if self.TraceOn():
+            print "context1:", context1
 
         # Continue the inferior, the breakpoint 2 should be hit.
         self.process.Continue()
@@ -90,11 +90,15 @@
         function = frame0.GetFunction()
         self.assertTrue(symbol.IsValid() and function.IsValid())
 
-        print "symbol:", symbol
-        print "disassembly=>\n", lldbutil.disassemble(target, symbol)
-
-        print "function:", function
-        print "disassembly=>\n", lldbutil.disassemble(target, function)
+        disasm_output = lldbutil.disassemble(target, symbol)
+        if self.TraceOn():
+            print "symbol:", symbol
+            print "disassembly=>\n", disasm_output
+
+        disasm_output = lldbutil.disassemble(target, function)
+        if self.TraceOn():
+            print "function:", function
+            print "disassembly=>\n", disasm_output
 
         sa1 = symbol.GetStartAddress()
         #print "sa1:", sa1

Modified: lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py?rev=129791&r1=129790&r2=129791&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py Tue Apr 19 14:44:26 2011
@@ -53,8 +53,7 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        error = lldb.SBError()
-        self.process = target.LaunchSimple (None, None, os.getcwd())
+        self.process = target.LaunchSimple(None, None, os.getcwd())
 
         self.process = target.GetProcess()
         self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
@@ -85,7 +84,8 @@
         self.assertTrue(addr_line2.GetSectionType() == lldb.eSectionTypeCode)
 
         # Now verify that both addresses point to the same module.
-        print "UUID:", addr_line1.GetModule().GetUUIDString()
+        if self.TraceOn():
+            print "UUID:", addr_line1.GetModule().GetUUIDString()
         self.assertTrue(addr_line1.GetModule().GetUUIDString() == addr_line2.GetModule().GetUUIDString())
 
         





More information about the lldb-commits mailing list