[Lldb-commits] [lldb] r132440 - /lldb/trunk/source/Target/ThreadPlanTestCondition.cpp
Jim Ingham
jingham at apple.com
Wed Jun 1 16:52:47 PDT 2011
Author: jingham
Date: Wed Jun 1 18:52:47 2011
New Revision: 132440
URL: http://llvm.org/viewvc/llvm-project?rev=132440&view=rev
Log:
If somebody has deleted the breakpoint while we are testing the condition, then just continue.
Modified:
lldb/trunk/source/Target/ThreadPlanTestCondition.cpp
Modified: lldb/trunk/source/Target/ThreadPlanTestCondition.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTestCondition.cpp?rev=132440&r1=132439&r2=132440&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTestCondition.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTestCondition.cpp Wed Jun 1 18:52:47 2011
@@ -15,6 +15,7 @@
// Project includes
#include "lldb/lldb-private-log.h"
+#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/Stream.h"
@@ -109,22 +110,31 @@
m_did_stop = true;
}
- // Now we have to change the event to a breakpoint event and mark it up appropriately:
- Process::ProcessEventData *new_data = new Process::ProcessEventData (m_thread.GetProcess().GetSP(), eStateStopped);
- event_ptr->SetData(new_data);
- event_ptr->SetType(Process::eBroadcastBitStateChanged);
- SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID (m_thread,
- m_break_loc_sp->GetBreakpointSite()->GetID(),
- m_did_stop));
- if (m_did_stop)
+ // One tricky bit, somebody might have disabled/deleted the breakpoint while we were running this condition, if so we
+ // should just continue. If the breakpoint gets disabled, then its "site" will be null'ed out, so we can't report
+ // this as a breakpoint event any more, since we can't reconstruct it's site. So just pass the event on.
+ if (!m_break_loc_sp->IsEnabled())
{
- Process::ProcessEventData::SetRestartedInEvent (event_ptr, false);
+ m_did_stop = false;
}
else
{
- Process::ProcessEventData::SetRestartedInEvent (event_ptr, true);
+ // Now we have to change the event to a breakpoint event and mark it up appropriately:
+ Process::ProcessEventData *new_data = new Process::ProcessEventData (m_thread.GetProcess().GetSP(), eStateStopped);
+ event_ptr->SetData(new_data);
+ event_ptr->SetType(Process::eBroadcastBitStateChanged);
+ SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID (m_thread,
+ m_break_loc_sp->GetBreakpointSite()->GetID(),
+ m_did_stop));
+ if (m_did_stop)
+ {
+ Process::ProcessEventData::SetRestartedInEvent (event_ptr, false);
+ }
+ else
+ {
+ Process::ProcessEventData::SetRestartedInEvent (event_ptr, true);
+ }
}
-
SetPlanComplete();
return m_did_stop;
}
More information about the lldb-commits
mailing list