[Lldb-commits] [lldb] r151833 - in /lldb/trunk: include/lldb/Target/ThreadPlanStepInstruction.h include/lldb/Target/ThreadPlanStepThrough.h source/Target/ThreadPlanStepInstruction.cpp source/Target/ThreadPlanStepThrough.cpp
Jim Ingham
jingham at apple.com
Thu Mar 1 12:01:23 PST 2012
Author: jingham
Date: Thu Mar 1 14:01:22 2012
New Revision: 151833
URL: http://llvm.org/viewvc/llvm-project?rev=151833&view=rev
Log:
Purge a couple more uses of stack count for stepping.
Modified:
lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h
lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h
lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
lldb/trunk/source/Target/ThreadPlanStepThrough.cpp
Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h?rev=151833&r1=151832&r2=151833&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h Thu Mar 1 14:01:22 2012
@@ -49,7 +49,7 @@
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);
Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h?rev=151833&r1=151832&r2=151833&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h Thu Mar 1 14:01:22 2012
@@ -54,7 +54,7 @@
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);
Modified: lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp?rev=151833&r1=151832&r2=151833&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp Thu Mar 1 14:01:22 2012
@@ -41,11 +41,10 @@
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 @@
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)
{
Modified: lldb/trunk/source/Target/ThreadPlanStepThrough.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepThrough.cpp?rev=151833&r1=151832&r2=151833&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepThrough.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepThrough.cpp Thu Mar 1 14:01:22 2012
@@ -37,7 +37,6 @@
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 @@
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 @@
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)
More information about the lldb-commits
mailing list