diff options
-rw-r--r-- | lldb/include/lldb/Target/ThreadPlan.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/Target/ThreadPlanCallFunction.h | 7 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanBase.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanCallFunction.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanCallUserExpression.cpp | 14 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepInRange.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepInstruction.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOut.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOverRange.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepUntil.cpp | 4 |
11 files changed, 29 insertions, 20 deletions
diff --git a/lldb/include/lldb/Target/ThreadPlan.h b/lldb/include/lldb/Target/ThreadPlan.h index 9c4259dff51..3d95a0924a1 100644 --- a/lldb/include/lldb/Target/ThreadPlan.h +++ b/lldb/include/lldb/Target/ThreadPlan.h @@ -544,11 +544,11 @@ protected: return m_thread.GetPreviousPlan (this); } - // This forwards the private Thread::GetPrivateStopReason which is generally what + // This forwards the private Thread::GetPrivateStopInfo which is generally what // ThreadPlan's need to know. lldb::StopInfoSP - GetPrivateStopReason() + GetPrivateStopInfo() { return m_thread.GetPrivateStopInfo (); } diff --git a/lldb/include/lldb/Target/ThreadPlanCallFunction.h b/lldb/include/lldb/Target/ThreadPlanCallFunction.h index 2c1d142a98b..d747706c639 100644 --- a/lldb/include/lldb/Target/ThreadPlanCallFunction.h +++ b/lldb/include/lldb/Target/ThreadPlanCallFunction.h @@ -115,12 +115,17 @@ public: // If the thread plan stops mid-course, this will be the stop reason that interrupted us. // Once DoTakedown is called, this will be the real stop reason at the end of the function call. + // If it hasn't been set for one or the other of these reasons, we'll return the PrivateStopReason. // This is needed because we want the CallFunction thread plans not to show up as the stop reason. // But if something bad goes wrong, it is nice to be able to tell the user what really happened. + virtual lldb::StopInfoSP GetRealStopInfo() { - return m_real_stop_info_sp; + if (m_real_stop_info_sp) + return m_real_stop_info_sp; + else + return GetPrivateStopInfo (); } lldb::addr_t diff --git a/lldb/source/Target/ThreadPlanBase.cpp b/lldb/source/Target/ThreadPlanBase.cpp index 998cc08f286..240f23a0b8f 100644 --- a/lldb/source/Target/ThreadPlanBase.cpp +++ b/lldb/source/Target/ThreadPlanBase.cpp @@ -102,10 +102,10 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); if (stop_info_sp) { - StopReason reason = stop_info_sp->GetStopReason(); + StopReason reason = stop_info_sp->GetStopReason (); switch (reason) { case eStopReasonInvalid: diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 2b5af7cebeb..c9baaafffd6 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -298,7 +298,7 @@ ThreadPlanCallFunction::DoTakedown (bool success) log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called for thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n", this, m_thread.GetID(), m_valid, IsPlanComplete()); m_takedown_done = true; m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC(); - m_real_stop_info_sp = GetPrivateStopReason(); + m_real_stop_info_sp = GetPrivateStopInfo (); m_thread.RestoreRegisterStateFromCheckpoint(m_stored_thread_state); SetPlanComplete(success); ClearBreakpoints(); @@ -365,7 +365,7 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop (Event *event_ptr) { Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP|LIBLLDB_LOG_PROCESS)); - m_real_stop_info_sp = GetPrivateStopReason(); + m_real_stop_info_sp = GetPrivateStopInfo (); // If our subplan knows why we stopped, even if it's done (which would forward the question to us) // we answer yes. @@ -584,7 +584,7 @@ ThreadPlanCallFunction::ClearBreakpoints () bool ThreadPlanCallFunction::BreakpointsExplainStop() { - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); if ((m_cxx_language_runtime && m_cxx_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp)) diff --git a/lldb/source/Target/ThreadPlanCallUserExpression.cpp b/lldb/source/Target/ThreadPlanCallUserExpression.cpp index 6e478089db7..70de1cbe86e 100644 --- a/lldb/source/Target/ThreadPlanCallUserExpression.cpp +++ b/lldb/source/Target/ThreadPlanCallUserExpression.cpp @@ -67,12 +67,16 @@ StopInfoSP ThreadPlanCallUserExpression::GetRealStopInfo() { StopInfoSP stop_info_sp = ThreadPlanCallFunction::GetRealStopInfo(); - lldb::addr_t addr = GetStopAddress(); - DynamicCheckerFunctions *checkers = m_thread.GetProcess()->GetDynamicCheckers(); - StreamString s; - if (checkers && checkers->DoCheckersExplainStop(addr, s)) - stop_info_sp->SetDescription(s.GetData()); + if (stop_info_sp) + { + lldb::addr_t addr = GetStopAddress(); + DynamicCheckerFunctions *checkers = m_thread.GetProcess()->GetDynamicCheckers(); + StreamString s; + + if (checkers && checkers->DoCheckersExplainStop(addr, s)) + stop_info_sp->SetDescription(s.GetData()); + } return stop_info_sp; } diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index c5bb1446479..b7ebfea89b8 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -403,7 +403,7 @@ ThreadPlanStepInRange::DoPlanExplainsStop (Event *event_ptr) } else { - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); if (stop_info_sp) { StopReason reason = stop_info_sp->GetStopReason(); diff --git a/lldb/source/Target/ThreadPlanStepInstruction.cpp b/lldb/source/Target/ThreadPlanStepInstruction.cpp index fa45b2b8cf6..f7a962ee19d 100644 --- a/lldb/source/Target/ThreadPlanStepInstruction.cpp +++ b/lldb/source/Target/ThreadPlanStepInstruction.cpp @@ -83,7 +83,7 @@ ThreadPlanStepInstruction::ValidatePlan (Stream *error) bool ThreadPlanStepInstruction::DoPlanExplainsStop (Event *event_ptr) { - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); if (stop_info_sp) { StopReason reason = stop_info_sp->GetStopReason(); diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp index 86f99b250b2..71ccf80428b 100644 --- a/lldb/source/Target/ThreadPlanStepOut.cpp +++ b/lldb/source/Target/ThreadPlanStepOut.cpp @@ -200,7 +200,7 @@ ThreadPlanStepOut::DoPlanExplainsStop (Event *event_ptr) // We don't explain signals or breakpoints (breakpoints that handle stepping in or // out will be handled by a child plan. - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); if (stop_info_sp) { StopReason reason = stop_info_sp->GetStopReason(); diff --git a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp index ff4fee72a3a..dc011e54540 100644 --- a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp +++ b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp @@ -61,7 +61,7 @@ ThreadPlanStepOverBreakpoint::ValidatePlan (Stream *error) bool ThreadPlanStepOverBreakpoint::DoPlanExplainsStop (Event *event_ptr) { - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); if (stop_info_sp) { StopReason reason = stop_info_sp->GetStopReason(); diff --git a/lldb/source/Target/ThreadPlanStepOverRange.cpp b/lldb/source/Target/ThreadPlanStepOverRange.cpp index 33812925baf..679ef46cc4d 100644 --- a/lldb/source/Target/ThreadPlanStepOverRange.cpp +++ b/lldb/source/Target/ThreadPlanStepOverRange.cpp @@ -300,7 +300,7 @@ ThreadPlanStepOverRange::DoPlanExplainsStop (Event *event_ptr) // unexplained breakpoint/crash. Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); bool return_value; if (stop_info_sp) diff --git a/lldb/source/Target/ThreadPlanStepUntil.cpp b/lldb/source/Target/ThreadPlanStepUntil.cpp index ca3d30d6f86..7f35d04355a 100644 --- a/lldb/source/Target/ThreadPlanStepUntil.cpp +++ b/lldb/source/Target/ThreadPlanStepUntil.cpp @@ -176,7 +176,7 @@ ThreadPlanStepUntil::AnalyzeStop() if (m_ran_analyze) return; - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); m_should_stop = true; m_explains_stop = false; @@ -320,7 +320,7 @@ ThreadPlanStepUntil::ShouldStop (Event *event_ptr) // do so here. Otherwise, as long as this thread has stopped for a reason, // we will stop. - StopInfoSP stop_info_sp = GetPrivateStopReason(); + StopInfoSP stop_info_sp = GetPrivateStopInfo (); if (!stop_info_sp || stop_info_sp->GetStopReason() == eStopReasonNone) return false; |