Make the ThreadPlanStepThrough set a backstop breakpoint on the return address from
the function it is being asked to step through, so that even if we get the trampoline
target wrong (for instance) we will still not lose control.
The other fix here is to tighten up the handling of the case where the current plan
doesn't explain the stop, but a plan above us does. In that case, if the plan that
does explain the stop says it is done, we need to clean up the plans below it and
continue on with our processing.
llvm-svn: 145740
diff --git a/lldb/source/Target/ThreadPlanShouldStopHere.cpp b/lldb/source/Target/ThreadPlanShouldStopHere.cpp
index a297dd8..9528e62 100644
--- a/lldb/source/Target/ThreadPlanShouldStopHere.cpp
+++ b/lldb/source/Target/ThreadPlanShouldStopHere.cpp
@@ -7,8 +7,10 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlanShouldStopHere.h"
+#include "lldb/Core/Log.h"
using namespace lldb;
using namespace lldb_private;
@@ -47,7 +49,26 @@
ThreadPlanShouldStopHere::InvokeShouldStopHereCallback ()
{
if (m_callback)
- return m_callback (m_owner, m_flags, m_baton);
+ {
+ ThreadPlan *return_plan = m_callback (m_owner, m_flags, m_baton);
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
+ if (log)
+ {
+ lldb::addr_t current_addr = m_owner->GetThread().GetRegisterContext()->GetPC(0);
+
+ if (return_plan)
+ {
+ StreamString s;
+ return_plan->GetDescription (&s, lldb::eDescriptionLevelFull);
+ log->Printf ("ShouldStopHere callback found a step out plan from 0x%llx: %s.", current_addr, s.GetData());
+ }
+ else
+ {
+ log->Printf ("ShouldStopHere callback didn't find a step out plan from: 0x%llx.", current_addr);
+ }
+ }
+ return return_plan;
+ }
else
return NULL;
}