summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-06-25 15:19:22 +0000
committerTamas Berghammer <tberghammer@google.com>2015-06-25 15:19:22 +0000
commit09d74b714047cdcc3695af00b2bd51721a27885b (patch)
tree3059face5311d36c57845b82830767dae1f1b219 /lldb/test/python_api
parent13894c7f351ec5d912139b907cfd5a9bcf14eaa6 (diff)
downloadbcm5719-llvm-09d74b714047cdcc3695af00b2bd51721a27885b.tar.gz
bcm5719-llvm-09d74b714047cdcc3695af00b2bd51721a27885b.zip
Fix TestThreadAPI on Linux
On Linux malloc calls itself in some case. Change the test case to handle this scenario. llvm-svn: 240651
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r--lldb/test/python_api/thread/TestThreadAPI.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py
index 6a6d2d6a79a..706919e69ab 100644
--- a/lldb/test/python_api/thread/TestThreadAPI.py
+++ b/lldb/test/python_api/thread/TestThreadAPI.py
@@ -75,7 +75,6 @@ class ThreadAPITestCase(TestBase):
self.step_out_of_malloc_into_function_b(self.exe_name)
@expectedFailureFreeBSD # llvm.org/pr20476
- @expectedFailureLinux # need to 'thread step-out' twice to get out of malloc
@python_api_test
@dwarf_test
def test_step_out_of_malloc_into_function_b_with_dwarf(self):
@@ -175,7 +174,6 @@ class ThreadAPITestCase(TestBase):
breakpoint = target.BreakpointCreateByName('malloc')
self.assertTrue(breakpoint, VALID_BREAKPOINT)
- self.runCmd("breakpoint list")
# Launch the process, and do not stop at the entry point.
process = target.LaunchSimple (None, None, self.get_process_working_directory())
@@ -184,7 +182,6 @@ class ThreadAPITestCase(TestBase):
thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint")
caller_symbol = get_caller_symbol(thread)
- #print "caller symbol of malloc:", caller_symbol
if not caller_symbol:
self.fail("Test failed: could not locate the caller symbol of malloc")
@@ -198,13 +195,14 @@ class ThreadAPITestCase(TestBase):
if caller_symbol == "b(int)":
break
- #self.runCmd("thread backtrace")
- #self.runCmd("process status")
process.Continue()
+ # On Linux malloc calls itself in some case. Remove the breakpoint because we don't want
+ # to hit it during step-out.
+ target.BreakpointDelete(breakpoint.GetID())
+
thread.StepOut()
self.runCmd("thread backtrace")
- #self.runCmd("process status")
self.assertTrue(thread.GetFrameAtIndex(0).GetLineEntry().GetLine() == self.step_out_of_malloc,
"step out of malloc into function b is successful")
OpenPOWER on IntegriCloud