From 0f16e73a76503fb252f36b90c2e1a7901ab6a9a4 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 8 Feb 2011 05:20:59 +0000 Subject: Rework the RunThreadPlan event handling to use Event Hijacking not stopping the event thread. Also clarify the logic of the function. llvm-svn: 125083 --- lldb/source/Target/ThreadPlanBase.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lldb/source/Target/ThreadPlanBase.cpp') diff --git a/lldb/source/Target/ThreadPlanBase.cpp b/lldb/source/Target/ThreadPlanBase.cpp index b83306cb62a..7529991a7bd 100644 --- a/lldb/source/Target/ThreadPlanBase.cpp +++ b/lldb/source/Target/ThreadPlanBase.cpp @@ -18,6 +18,7 @@ #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/Breakpoint.h" +#include "lldb/Core/Log.h" #include "lldb/Core/Stream.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" @@ -82,6 +83,8 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) m_stop_vote = eVoteYes; m_run_vote = eVoteYes; + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + StopInfoSP stop_info_sp = GetPrivateStopReason(); if (stop_info_sp) { @@ -101,6 +104,8 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) // If we are going to stop for a breakpoint, then unship the other plans // at this point. Don't force the discard, however, so Master plans can stay // in place if they want to. + if (log) + log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4x (breakpoint hit.)", m_thread.GetID()); m_thread.DiscardThreadPlans(false); return true; } @@ -127,12 +132,16 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) case eStopReasonException: // If we crashed, discard thread plans and stop. Don't force the discard, however, // since on rerun the target may clean up this exception and continue normally from there. + if (log) + log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4x (exception.)", m_thread.GetID()); m_thread.DiscardThreadPlans(false); return true; case eStopReasonSignal: if (stop_info_sp->ShouldStop(event_ptr)) { + if (log) + log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4x (signal.)", m_thread.GetID()); m_thread.DiscardThreadPlans(false); return true; } -- cgit v1.2.3