diff options
| author | Jason Molenda <jmolenda@apple.com> | 2014-11-04 05:28:40 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2014-11-04 05:28:40 +0000 |
| commit | 4b0089324344946ce033859d1cb3e031ae5fadd0 (patch) | |
| tree | 9ac3b0a04fa3033f43e2542c5f81f1cb86f8653a /lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | |
| parent | d28edfea031b06f36e61e58093b39f37f14270d9 (diff) | |
| download | bcm5719-llvm-4b0089324344946ce033859d1cb3e031ae5fadd0.tar.gz bcm5719-llvm-4b0089324344946ce033859d1cb3e031ae5fadd0.zip | |
Back out r221229 -- instead of trying to identify the end of the unwind,
let's let lldb try the arch default unwind every time but not destructively --
it doesn't permanently replace the main unwind method for that function from
now on.
This fix is for <rdar://problem/18683658>.
I tested it against Ryan Brown's go program test case and also a
collection of core files of tricky unwind scenarios
<rdar://problem/15664282> <rdar://problem/15835846>
<rdar://problem/15982682> <rdar://problem/16099440>
<rdar://problem/17364005> <rdar://problem/18556719>
that I've fixed over the last 6-9 months.
llvm-svn: 221238
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index 88bb608ea9e..92e378979be 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -62,8 +62,7 @@ RegisterContextLLDB::RegisterContextLLDB m_sym_ctx_valid (false), m_frame_number (frame_number), m_registers(), - m_parent_unwind (unwind_lldb), - m_completed_stack_walk (false) + m_parent_unwind (unwind_lldb) { m_sym_ctx.Clear(false); m_sym_ctx_valid = false; @@ -307,7 +306,6 @@ RegisterContextLLDB::InitializeNonZerothFrame() if (pc == 0) { m_frame_type = eNotAValidFrame; - m_completed_stack_walk = true; UnwindLogMsg ("this frame has a pc of 0x0"); return; } @@ -388,10 +386,6 @@ RegisterContextLLDB::InitializeNonZerothFrame() { UnwindLogMsg ("could not find a valid cfa address"); m_frame_type = eNotAValidFrame; - if (cfa_regval == 0 || cfa_regval == 1) - { - m_completed_stack_walk = true; - } return; } @@ -588,10 +582,6 @@ RegisterContextLLDB::InitializeNonZerothFrame() { UnwindLogMsg ("could not find a valid cfa address"); m_frame_type = eNotAValidFrame; - if (cfa_regval == 0 || cfa_regval == 1) - { - m_completed_stack_walk = true; - } return; } @@ -1040,11 +1030,10 @@ RegisterContextLLDB::IsValid () const return m_frame_type != eNotAValidFrame; } -bool -RegisterContextLLDB::IsCompletedStackWalk () const -{ - return m_completed_stack_walk; -} +// After the final stack frame in a stack walk we'll get one invalid (eNotAValidFrame) stack frame -- +// one past the end of the stack walk. But higher-level code will need to tell the differnece between +// "the unwind plan below this frame failed" versus "we successfully completed the stack walk" so +// this method helps to disambiguate that. bool RegisterContextLLDB::IsTrapHandlerFrame () const @@ -1420,15 +1409,6 @@ RegisterContextLLDB::TryFallbackUnwindPlan () if (active_row && active_row->GetCFARegister() != LLDB_INVALID_REGNUM) { - FuncUnwindersSP func_unwinders_sp; - if (m_sym_ctx_valid && m_current_pc.IsValid() && m_current_pc.GetModule()) - { - func_unwinders_sp = m_current_pc.GetModule()->GetObjectFile()->GetUnwindTable().GetFuncUnwindersContainingAddress (m_current_pc, m_sym_ctx); - if (func_unwinders_sp) - { - func_unwinders_sp->InvalidateNonCallSiteUnwindPlan (m_thread); - } - } m_registers.clear(); m_full_unwind_plan_sp = m_fallback_unwind_plan_sp; addr_t cfa_regval = LLDB_INVALID_ADDRESS; @@ -1437,8 +1417,9 @@ RegisterContextLLDB::TryFallbackUnwindPlan () m_cfa = cfa_regval + active_row->GetCFAOffset (); } - UnwindLogMsg ("full unwind plan '%s' has been replaced by architecture default unwind plan '%s' for this function from now on.", - original_full_unwind_plan_sp->GetSourceName().GetCString(), m_fallback_unwind_plan_sp->GetSourceName().GetCString()); + UnwindLogMsg ("trying to unwind from this function with the UnwindPlan '%s' because UnwindPlan '%s' failed.", + m_fallback_unwind_plan_sp->GetSourceName().GetCString(), + original_full_unwind_plan_sp->GetSourceName().GetCString()); m_fallback_unwind_plan_sp.reset(); } |

