From 8559a35508222875c5a413dd5ef5df82482bf74a Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Mon, 26 Nov 2012 23:52:18 +0000 Subject: The Function calling thread plan was replacing the stored stop info too soon, causing recursive entry into the breakpoint StopInfo's PerformAction, which is bad. Reworked this so that it is now correct. llvm-svn: 168634 --- lldb/source/Target/Process.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lldb/source/Target/Process.cpp') diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 3d78dc75338..02f78d4df56 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -4377,6 +4377,9 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, const uint64_t default_one_thread_timeout_usec = 250000; uint64_t computed_timeout = 0; + // This while loop must exit out the bottom, there's cleanup that we need to do when we are done. + // So don't call return anywhere within it. + while (1) { // We usually want to resume the process if we get to the top of the loop. @@ -4784,6 +4787,12 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, } + // Restore the thread state if we are going to discard the plan execution. + + if (return_value == eExecutionCompleted || discard_on_error) + { + thread_plan_sp->RestoreThreadState(); + } // Now do some processing on the results of the run: if (return_value == eExecutionInterrupted) -- cgit v1.2.3