[Lldb-commits] [lldb] r151793 - /lldb/trunk/source/Target/StackFrameList.cpp
Jim Ingham
jingham at apple.com
Wed Feb 29 18:53:40 PST 2012
Author: jingham
Date: Wed Feb 29 20:53:40 2012
New Revision: 151793
URL: http://llvm.org/viewvc/llvm-project?rev=151793&view=rev
Log:
If the unwinder fails to make us a frame 0, make one by hand from the SP & PC.
Modified:
lldb/trunk/source/Target/StackFrameList.cpp
Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=151793&r1=151792&r2=151793&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Wed Feb 29 20:53:40 2012
@@ -83,25 +83,25 @@
// if we need to
if (m_frames.empty())
{
- const bool success = unwinder->GetFrameInfoAtIndex(idx, cfa, pc);
- // There shouldn't be any way not to get the frame info for frame 0.
- assert (success);
m_thread.GetRegisterContext();
assert (m_thread.m_reg_context_sp.get());
+
+ const bool success = unwinder->GetFrameInfoAtIndex(idx, cfa, pc);
+ // There shouldn't be any way not to get the frame info for frame 0.
+ // But if the unwinder can't make one, lets make one by hand with the
+ // SP as the CFA and see if that gets any further.
+ if (!success)
+ {
+ cfa = m_thread.GetRegisterContext()->GetSP();
+ pc = m_thread.GetRegisterContext()->GetPC();
+ }
+
unwind_frame_sp.reset (new StackFrame (m_thread.shared_from_this(),
m_frames.size(),
idx,
m_thread.m_reg_context_sp,
-// If set to 1 this will use the correct CFA & PC.
-// Note for some reason the ValueObject Summaries and Formatters were relying on getting incorrect (constantly changing) values.
-
-#if 1
- cfa,
+ cfa,
pc,
-#else
- m_thread.GetRegisterContext()->GetSP(),
- m_thread.GetRegisterContext()->GetPC(),
-#endif
NULL));
m_frames.push_back (unwind_frame_sp);
}
More information about the lldb-commits
mailing list