summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanStepInRange.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-05-01 18:38:37 +0000
committerJim Ingham <jingham@apple.com>2012-05-01 18:38:37 +0000
commitfbbfe6ecf0a400b26e6b6839a8d06bd8be46ad2a (patch)
tree77ba25a38fe31094ffaedcfcd976c855896b2822 /lldb/source/Target/ThreadPlanStepInRange.cpp
parent758e0cc94af7e146c948aadaf81e2667287c777b (diff)
downloadbcm5719-llvm-fbbfe6ecf0a400b26e6b6839a8d06bd8be46ad2a.tar.gz
bcm5719-llvm-fbbfe6ecf0a400b26e6b6839a8d06bd8be46ad2a.zip
Fix reporting of stop reasons when the StepOver & StepIn plans stop because of a crash or breakpoint. Added the ability for a plan to say it is done but doesn't want to be the reason for the stop.
llvm-svn: 155927
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepInRange.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanStepInRange.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp
index 9fbca6b03f7..0db23a114b8 100644
--- a/lldb/source/Target/ThreadPlanStepInRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepInRange.cpp
@@ -295,3 +295,41 @@ ThreadPlanStepInRange::DefaultShouldStopHereCallback (ThreadPlan *current_plan,
return NULL;
}
+
+bool
+ThreadPlanStepInRange::PlanExplainsStop ()
+{
+ // We always explain a stop. Either we've just done a single step, in which
+ // case we'll do our ordinary processing, or we stopped for some
+ // reason that isn't handled by our sub-plans, in which case we want to just stop right
+ // away.
+ // We also set ourselves complete when we stop for this sort of unintended reason, but mark
+ // success as false so we don't end up being the reason for the stop.
+ //
+ // The only variation is that if we are doing "step by running to next branch" in which case
+ // if we hit our branch breakpoint we don't set the plan to complete.
+
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
+ StopInfoSP stop_info_sp = GetPrivateStopReason();
+ if (stop_info_sp)
+ {
+ StopReason reason = stop_info_sp->GetStopReason();
+
+ switch (reason)
+ {
+ case eStopReasonBreakpoint:
+ if (NextRangeBreakpointExplainsStop(stop_info_sp))
+ return true;
+ case eStopReasonWatchpoint:
+ case eStopReasonSignal:
+ case eStopReasonException:
+ if (log)
+ log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step.");
+ SetPlanComplete(false);
+ break;
+ default:
+ break;
+ }
+ }
+ return true;
+}
OpenPOWER on IntegriCloud