Skip to content

Commit 1c0b39d

Browse files
authored
Merge pull request #2966 from jimingham/report-missing-breakpoint
Get more info if lldbutil.run_to_XXX_breakpoint doesn't hit the break…
2 parents d946ed9 + 5d72757 commit 1c0b39d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lldb/packages/Python/lldbsuite/test/lldbutil.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,19 @@ def run_to_breakpoint_do_run(test, target, bkpt, launch_info = None,
878878
test.assertFalse(error.Fail(),
879879
"Process launch failed: %s" % (error.GetCString()))
880880

881-
test.assertEqual(process.GetState(), lldb.eStateStopped)
881+
if process.GetState() == lldb.eStateRunning:
882+
# If we get here with eStateRunning, it means we missed the
883+
# initial breakpoint. Figure out where the process is
884+
# so we can report that:
885+
error = lldb.SBError()
886+
error = process.Stop()
887+
if not error.Success():
888+
test.fail("Failed to stop: %s"%(error.GetCString()))
889+
890+
error_string = "Failed to hit initial breakpoint:\n%s\n"%(print_stacktraces(process, True))
891+
test.fail(error_string)
892+
893+
test.assertEqual(process.GetState(), lldb.eStateStopped, error_string)
882894

883895
# Frame #0 should be at our breakpoint.
884896
threads = get_threads_stopped_at_breakpoint(

0 commit comments

Comments
 (0)