summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2010-10-26 00:27:45 +0000
committerJim Ingham <jingham@apple.com>2010-10-26 00:27:45 +0000
commit40d871fa245b288b7933c03df4c3605a418827a9 (patch)
tree2d14faeb0775e2dbd33a9ca144890cc898ed27fe
parente2c340c8d0b9cf7ea5fefc556171f82b1368b955 (diff)
downloadbcm5719-llvm-40d871fa245b288b7933c03df4c3605a418827a9.tar.gz
bcm5719-llvm-40d871fa245b288b7933c03df4c3605a418827a9.zip
The call function thread plan should allow internal breakpoints to continue on. Also made stopping
in mid-expression evaluation when we hit a breakpoint/signal work. llvm-svn: 117341
-rw-r--r--lldb/include/lldb/Target/StopInfo.h8
-rw-r--r--lldb/source/Target/ThreadPlanCallFunction.cpp43
2 files changed, 49 insertions, 2 deletions
diff --git a/lldb/include/lldb/Target/StopInfo.h b/lldb/include/lldb/Target/StopInfo.h
index 080aaa37011..2eecb9edd21 100644
--- a/lldb/include/lldb/Target/StopInfo.h
+++ b/lldb/include/lldb/Target/StopInfo.h
@@ -46,6 +46,14 @@ public:
return m_thread;
}
+ // The value of the StopInfo depends on the StopReason.
+ // StopReason Meaning
+ // ----------------------------------------------
+ // eStopReasonBreakpoint BreakpointSiteID
+ // eStopReasonSignal Signal number
+ // eStopReasonWatchpoint WatchpointSiteID
+ // eStopReasonPlanComplete No significance
+
uint64_t
GetValue() const
{
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp
index 6b606d4565a..2f5f7cca1cd 100644
--- a/lldb/source/Target/ThreadPlanCallFunction.cpp
+++ b/lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -14,11 +14,14 @@
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private-log.h"
+#include "lldb/Breakpoint/Breakpoint.h"
+#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/Stream.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlanRunToAddress.h"
@@ -171,9 +174,45 @@ ThreadPlanCallFunction::ValidatePlan (Stream *error)
bool
ThreadPlanCallFunction::PlanExplainsStop ()
{
- // If the subplan is running, any crashes are attributable to us.
+ // If our subplan knows why we stopped, even if it's done (which would forward the question to us)
+ // we answer yes.
+ if(m_subplan_sp.get() != NULL && m_subplan_sp->PlanExplainsStop())
+ return true;
- return (m_subplan_sp.get() != NULL);
+ // If we don't want to discard this plan, than any stop we don't understand should be propagated up the stack.
+ if (!OkayToDiscard())
+ return false;
+
+ // Otherwise, check the case where we stopped for an internal breakpoint, in that case, continue on.
+ // If it is not an internal breakpoint, consult OkayToDiscard.
+ lldb::StopInfoSP stop_info_sp = GetPrivateStopReason();
+ if (stop_info_sp && stop_info_sp->GetStopReason() == eStopReasonBreakpoint)
+ {
+ uint64_t break_site_id = stop_info_sp->GetValue();
+ lldb::BreakpointSiteSP bp_site_sp = m_thread.GetProcess().GetBreakpointSiteList().FindByID(break_site_id);
+ if (bp_site_sp)
+ {
+ uint32_t num_owners = bp_site_sp->GetNumberOfOwners();
+ bool is_internal = true;
+ for (uint32_t i = 0; i < num_owners; i++)
+ {
+ if (!bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint().IsInternal())
+ {
+ is_internal = false;
+ break;
+ }
+ }
+ if (is_internal)
+ return false;
+ }
+
+ return OkayToDiscard();
+ }
+ else
+ {
+ // If the subplan is running, any crashes are attributable to us.
+ return (m_subplan_sp.get() != NULL);
+ }
}
bool
OpenPOWER on IntegriCloud