From 9efcb0ec4d19a655a2698a83f5c70f7b622d655a Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Tue, 19 Apr 2011 19:44:26 +0000 Subject: [PATCH] Converted to use SBProcess.LaunchSimple() API. And use self.TraceOn() in order to print more debug output. llvm-svn: 129791 --- .../function_symbol/TestDisasmAPI.py | 18 +++++++++++------- .../function_symbol/TestSymbolAPI.py | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py index 39e6c64cccb7..0f36cd854c3a 100644 --- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py +++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py @@ -53,8 +53,7 @@ class DisasmAPITestCase(TestBase): 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 @@ class DisasmAPITestCase(TestBase): 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 @@ class DisasmAPITestCase(TestBase): function = frame0.GetFunction() self.assertTrue(symbol.IsValid() and function.IsValid()) - print "symbol:", symbol - print "disassembly=>\n", lldbutil.disassemble(target, symbol) + disasm_output = lldbutil.disassemble(target, symbol) + if self.TraceOn(): + print "symbol:", symbol + print "disassembly=>\n", disasm_output - print "function:", function - print "disassembly=>\n", lldbutil.disassemble(target, function) + disasm_output = lldbutil.disassemble(target, function) + if self.TraceOn(): + print "function:", function + print "disassembly=>\n", disasm_output sa1 = symbol.GetStartAddress() #print "sa1:", sa1 diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py index 353bd31b3bee..df3759d436c0 100644 --- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py +++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py @@ -53,8 +53,7 @@ class SymbolAPITestCase(TestBase): 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 @@ class SymbolAPITestCase(TestBase): 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())