Add GetSP to the StackFrame.

llvm-svn: 114674
This commit is contained in:
Jim Ingham 2010-09-23 17:40:12 +00:00
parent a45bbb9628
commit e4284b719c
6 changed files with 40 additions and 0 deletions

View File

@ -143,6 +143,9 @@ public:
virtual void
Calculate (ExecutionContext &exe_ctx);
lldb::StackFrameSP
GetSP ();
protected:
friend class StackFrameList;

View File

@ -58,6 +58,9 @@ public:
void
Dump (Stream *s);
lldb::StackFrameSP
GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
protected:

View File

@ -611,6 +611,9 @@ public:
virtual void
Calculate (ExecutionContext &exe_ctx);
lldb::StackFrameSP
GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
protected:

View File

@ -679,4 +679,10 @@ StackFrame::HasCachedData () const
if (!m_disassembly.GetString().empty())
return true;
return false;
}
lldb::StackFrameSP
StackFrame::GetSP ()
{
return m_thread.GetStackFrameSPForStackFramePtr (this);
}

View File

@ -513,3 +513,23 @@ StackFrameList::Merge (std::auto_ptr<StackFrameList>& curr_ap, lldb::StackFrameL
}
lldb::StackFrameSP
StackFrameList::GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
{
const_iterator pos;
const_iterator begin = m_frames.begin();
const_iterator end = m_frames.end();
lldb::StackFrameSP ret_sp;
for (pos = begin; pos != end; ++pos)
{
if (pos->get() == stack_frame_ptr)
{
ret_sp = (*pos);
break;
}
}
return ret_sp;
}

View File

@ -1129,3 +1129,8 @@ Thread::ThreadSettingsController::instance_settings_table[] =
{ NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
};
lldb::StackFrameSP
Thread::GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
{
return GetStackFrameList().GetStackFrameSPForStackFramePtr (stack_frame_ptr);
}