[Lldb-commits] [lldb] r114674 - in /lldb/trunk: include/lldb/Target/StackFrame.h include/lldb/Target/StackFrameList.h include/lldb/Target/Thread.h source/Target/StackFrame.cpp source/Target/StackFrameList.cpp source/Target/Thread.cpp
Jim Ingham
jingham at apple.com
Thu Sep 23 10:40:12 PDT 2010
Author: jingham
Date: Thu Sep 23 12:40:12 2010
New Revision: 114674
URL: http://llvm.org/viewvc/llvm-project?rev=114674&view=rev
Log:
Add GetSP to the StackFrame.
Modified:
lldb/trunk/include/lldb/Target/StackFrame.h
lldb/trunk/include/lldb/Target/StackFrameList.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/StackFrameList.cpp
lldb/trunk/source/Target/Thread.cpp
Modified: lldb/trunk/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=114674&r1=114673&r2=114674&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrame.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrame.h Thu Sep 23 12:40:12 2010
@@ -143,6 +143,9 @@
virtual void
Calculate (ExecutionContext &exe_ctx);
+
+ lldb::StackFrameSP
+ GetSP ();
protected:
friend class StackFrameList;
Modified: lldb/trunk/include/lldb/Target/StackFrameList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrameList.h?rev=114674&r1=114673&r2=114674&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrameList.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrameList.h Thu Sep 23 12:40:12 2010
@@ -58,6 +58,9 @@
void
Dump (Stream *s);
+
+ lldb::StackFrameSP
+ GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
protected:
Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=114674&r1=114673&r2=114674&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Thu Sep 23 12:40:12 2010
@@ -611,6 +611,9 @@
virtual void
Calculate (ExecutionContext &exe_ctx);
+
+ lldb::StackFrameSP
+ GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr);
protected:
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=114674&r1=114673&r2=114674&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Thu Sep 23 12:40:12 2010
@@ -679,4 +679,10 @@
if (!m_disassembly.GetString().empty())
return true;
return false;
+}
+
+lldb::StackFrameSP
+StackFrame::GetSP ()
+{
+ return m_thread.GetStackFrameSPForStackFramePtr (this);
}
\ No newline at end of file
Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=114674&r1=114673&r2=114674&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Thu Sep 23 12:40:12 2010
@@ -513,3 +513,23 @@
}
+
+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;
+}
+
Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=114674&r1=114673&r2=114674&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Thu Sep 23 12:40:12 2010
@@ -1129,3 +1129,8 @@
{ NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
};
+lldb::StackFrameSP
+Thread::GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
+{
+ return GetStackFrameList().GetStackFrameSPForStackFramePtr (stack_frame_ptr);
+}
More information about the lldb-commits
mailing list