summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-03-01 20:01:22 +0000
committerJim Ingham <jingham@apple.com>2012-03-01 20:01:22 +0000
commit6b35c86fbe21c209aa436a78cac6b88428ddcb4c (patch)
treefa89154c3c63b8e426101e3077f690d96aa26e6f
parentbe1c875a1c20dd3bd9e35c4c9627e24e8610b1b3 (diff)
downloadbcm5719-llvm-6b35c86fbe21c209aa436a78cac6b88428ddcb4c.tar.gz
bcm5719-llvm-6b35c86fbe21c209aa436a78cac6b88428ddcb4c.zip
Purge a couple more uses of stack count for stepping.
llvm-svn: 151833
-rw-r--r--lldb/include/lldb/Target/ThreadPlanStepInstruction.h2
-rw-r--r--lldb/include/lldb/Target/ThreadPlanStepThrough.h2
-rw-r--r--lldb/source/Target/ThreadPlanStepInstruction.cpp10
-rw-r--r--lldb/source/Target/ThreadPlanStepThrough.cpp10
4 files changed, 13 insertions, 11 deletions
diff --git a/lldb/include/lldb/Target/ThreadPlanStepInstruction.h b/lldb/include/lldb/Target/ThreadPlanStepInstruction.h
index 80a6263ad7b..a64da08493f 100644
--- a/lldb/include/lldb/Target/ThreadPlanStepInstruction.h
+++ b/lldb/include/lldb/Target/ThreadPlanStepInstruction.h
@@ -49,7 +49,7 @@ private:
bool m_stop_other_threads;
bool m_step_over;
// This is used only for the step over case.
- uint64_t m_stack_depth;
+ StackID m_stack_id;
DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepInstruction);
diff --git a/lldb/include/lldb/Target/ThreadPlanStepThrough.h b/lldb/include/lldb/Target/ThreadPlanStepThrough.h
index 6e7009d180b..fe99881d819 100644
--- a/lldb/include/lldb/Target/ThreadPlanStepThrough.h
+++ b/lldb/include/lldb/Target/ThreadPlanStepThrough.h
@@ -54,7 +54,7 @@ private:
lldb::addr_t m_start_address;
lldb::break_id_t m_backstop_bkpt_id;
lldb::addr_t m_backstop_addr;
- size_t m_stack_depth;
+ StackID m_stack_id;
bool m_stop_others;
DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepThrough);
diff --git a/lldb/source/Target/ThreadPlanStepInstruction.cpp b/lldb/source/Target/ThreadPlanStepInstruction.cpp
index ac337cbc8c4..c4b9ccac1f3 100644
--- a/lldb/source/Target/ThreadPlanStepInstruction.cpp
+++ b/lldb/source/Target/ThreadPlanStepInstruction.cpp
@@ -41,11 +41,10 @@ ThreadPlanStepInstruction::ThreadPlanStepInstruction
ThreadPlan (ThreadPlan::eKindStepInstruction, "Step over single instruction", thread, stop_vote, run_vote),
m_instruction_addr (0),
m_stop_other_threads (stop_other_threads),
- m_step_over (step_over),
- m_stack_depth (0)
+ m_step_over (step_over)
{
m_instruction_addr = m_thread.GetRegisterContext()->GetPC(0);
- m_stack_depth = m_thread.GetStackFrameCount();
+ m_stack_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
}
ThreadPlanStepInstruction::~ThreadPlanStepInstruction ()
@@ -102,7 +101,10 @@ ThreadPlanStepInstruction::ShouldStop (Event *event_ptr)
if (m_step_over)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
- if (m_thread.GetStackFrameCount() <= m_stack_depth)
+
+ StackID cur_frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
+
+ if (cur_frame_zero_id == m_stack_id || m_stack_id < cur_frame_zero_id)
{
if (m_thread.GetRegisterContext()->GetPC(0) != m_instruction_addr)
{
diff --git a/lldb/source/Target/ThreadPlanStepThrough.cpp b/lldb/source/Target/ThreadPlanStepThrough.cpp
index cb7bf99711a..3c4824153cb 100644
--- a/lldb/source/Target/ThreadPlanStepThrough.cpp
+++ b/lldb/source/Target/ThreadPlanStepThrough.cpp
@@ -37,7 +37,6 @@ ThreadPlanStepThrough::ThreadPlanStepThrough (Thread &thread, bool stop_others)
m_start_address (0),
m_backstop_bkpt_id (LLDB_INVALID_BREAK_ID),
m_backstop_addr(LLDB_INVALID_ADDRESS),
- m_stack_depth (0),
m_stop_others (stop_others)
{
@@ -47,8 +46,8 @@ ThreadPlanStepThrough::ThreadPlanStepThrough (Thread &thread, bool stop_others)
if (m_sub_plan_sp)
{
m_start_address = GetThread().GetRegisterContext()->GetPC(0);
- m_stack_depth = m_thread.GetStackFrameCount() - 1;
-
+ m_stack_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
+
// We are going to return back to the concrete frame 1, we might pass by some inlined code that we're in
// the middle of by doing this, but it's easier than trying to figure out where the inlined code might return to.
@@ -261,8 +260,9 @@ ThreadPlanStepThrough::HitOurBackstopBreakpoint()
BreakpointSiteSP cur_site_sp = m_thread.GetProcess()->GetBreakpointSiteList().FindByID(stop_value);
if (cur_site_sp && cur_site_sp->IsBreakpointAtThisSite(m_backstop_bkpt_id))
{
- size_t current_stack_depth = m_thread.GetStackFrameCount();
- if (current_stack_depth == m_stack_depth)
+ StackID cur_frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
+
+ if (cur_frame_zero_id == m_stack_id)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
if (log)
OpenPOWER on IntegriCloud