summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorDaniel Malea <daniel.malea@intel.com>2013-05-14 15:20:12 +0000
committerDaniel Malea <daniel.malea@intel.com>2013-05-14 15:20:12 +0000
commit246cb61104fc95672a8ce125745306fdcfcbe9c7 (patch)
tree0ebcd3cf2973096f3729f33f127fa54dcb5c0cf2 /lldb
parent61101ba419331343d4a607e13fc4ca07d8245be8 (diff)
downloadbcm5719-llvm-246cb61104fc95672a8ce125745306fdcfcbe9c7.tar.gz
bcm5719-llvm-246cb61104fc95672a8ce125745306fdcfcbe9c7.zip
Fix inline stepping test case on Linux because Thread::ThreadStoppedForAReason ignored virtual steps.
- add IsVirtualStep() virtual function to ThreadPlan, and implement it for ThreadPlanStepInRange - make GetPrivateStopReason query the current thread plan for a virtual stop to decide if the current stop reason needs to be preserved - remove extra check for an existing process in GetPrivateStopReason llvm-svn: 181795
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Target/Thread.h16
-rw-r--r--lldb/include/lldb/Target/ThreadPlan.h6
-rw-r--r--lldb/include/lldb/Target/ThreadPlanStepInRange.h3
-rw-r--r--lldb/source/Target/Thread.cpp43
-rw-r--r--lldb/source/Target/ThreadPlanStepInRange.cpp6
5 files changed, 47 insertions, 27 deletions
diff --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h
index fc58a6903b6..d0984c6d45a 100644
--- a/lldb/include/lldb/Target/Thread.h
+++ b/lldb/include/lldb/Target/Thread.h
@@ -895,9 +895,19 @@ public:
return !m_destroy_called;
}
- // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be
- // valid. The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right
- // even if you have not calculated this yourself, or if it disagrees with what you might have calculated.
+ // Sets and returns a valid stop info based on the process stop ID and the
+ // current thread plan. If the thread stop ID does not match the process'
+ // stop ID, the private stop reason is not set and an invalid StopInfoSP may
+ // be returned.
+ //
+ // NOTE: This function must be called before the current thread plan is
+ // moved to the completed plan stack (in Thread::ShouldStop()).
+ //
+ // NOTE: If subclasses override this function, ensure they do not overwrite
+ // the m_actual_stop_info if it is valid. The stop info may be a
+ // "checkpointed and restored" stop info, so if it is still around it is
+ // right even if you have not calculated this yourself, or if it disagrees
+ // with what you might have calculated.
virtual lldb::StopInfoSP
GetPrivateStopInfo ();
diff --git a/lldb/include/lldb/Target/ThreadPlan.h b/lldb/include/lldb/Target/ThreadPlan.h
index 5e02ec74489..9c4259dff51 100644
--- a/lldb/include/lldb/Target/ThreadPlan.h
+++ b/lldb/include/lldb/Target/ThreadPlan.h
@@ -516,6 +516,12 @@ public:
// Nothing to do in general.
return true;
}
+
+ virtual bool
+ IsVirtualStep()
+ {
+ return false;
+ }
protected:
//------------------------------------------------------------------
diff --git a/lldb/include/lldb/Target/ThreadPlanStepInRange.h b/lldb/include/lldb/Target/ThreadPlanStepInRange.h
index f9e64ce2ced..158c8605df3 100644
--- a/lldb/include/lldb/Target/ThreadPlanStepInRange.h
+++ b/lldb/include/lldb/Target/ThreadPlanStepInRange.h
@@ -60,6 +60,9 @@ public:
static void
SetDefaultFlagValue (uint32_t new_value);
+ bool
+ IsVirtualStep();
+
protected:
virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index c4aa2544682..9abf514ab46 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -390,32 +390,23 @@ Thread::GetPrivateStopInfo ()
ProcessSP process_sp (GetProcess());
if (process_sp)
{
- ProcessSP process_sp (GetProcess());
- if (process_sp)
+ const uint32_t process_stop_id = process_sp->GetStopID();
+ if (m_stop_info_stop_id != process_stop_id)
{
- const uint32_t process_stop_id = process_sp->GetStopID();
- if (m_stop_info_stop_id != process_stop_id)
+ if (m_stop_info_sp)
{
- if (m_stop_info_sp)
- {
- if (m_stop_info_sp->IsValid())
- {
- SetStopInfo (m_stop_info_sp);
- }
- else
- {
- if (IsStillAtLastBreakpointHit())
- SetStopInfo(m_stop_info_sp);
- else
- m_stop_info_sp.reset();
- }
- }
-
- if (!m_stop_info_sp)
- {
- if (CalculateStopInfo() == false)
- SetStopInfo (StopInfoSP());
- }
+ if (m_stop_info_sp->IsValid()
+ || IsStillAtLastBreakpointHit()
+ || GetCurrentPlan()->IsVirtualStep())
+ SetStopInfo (m_stop_info_sp);
+ else
+ m_stop_info_sp.reset();
+ }
+
+ if (!m_stop_info_sp)
+ {
+ if (CalculateStopInfo() == false)
+ SetStopInfo (StopInfoSP());
}
}
}
@@ -693,6 +684,10 @@ Thread::ShouldStop (Event* event_ptr)
return false;
}
+ // Based on the current thread plan and process stop info, check if this
+ // thread caused the process to stop. NOTE: this must take place before
+ // the plan is moved from the current plan stack to the completed plan
+ // stack.
if (ThreadStoppedForAReason() == false)
{
if (log)
diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp
index d5a6b10858f..c5bb1446479 100644
--- a/lldb/source/Target/ThreadPlanStepInRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepInRange.cpp
@@ -463,3 +463,9 @@ ThreadPlanStepInRange::DoWillResume (lldb::StateType resume_state, bool current_
}
return true;
}
+
+bool
+ThreadPlanStepInRange::IsVirtualStep()
+{
+ return m_virtual_step;
+}
OpenPOWER on IntegriCloud