Index: lldb/include/lldb/Target/RegisterContextUnwind.h =================================================================== --- lldb/include/lldb/Target/RegisterContextUnwind.h +++ lldb/include/lldb/Target/RegisterContextUnwind.h @@ -71,6 +71,7 @@ enum FrameType { eNormalFrame, eTrapHandlerFrame, + eTrapHandlerParentFrame, // a parent frame of eTrapHandlerFrame eDebuggerFrame, // a debugger inferior function call frame; we get caller's // registers from debugger eSkipFrame, // The unwind resulted in a bogus frame but may get back on Index: lldb/source/Target/RegisterContextUnwind.cpp =================================================================== --- lldb/source/Target/RegisterContextUnwind.cpp +++ lldb/source/Target/RegisterContextUnwind.cpp @@ -655,7 +655,8 @@ // If we're in _sigtramp(), unwinding past this frame requires special // knowledge. - if (m_frame_type == eTrapHandlerFrame || m_frame_type == eDebuggerFrame) + if (m_frame_type == eTrapHandlerFrame || + m_frame_type == eTrapHandlerParentFrame || m_frame_type == eDebuggerFrame) return unwind_plan_sp; unwind_plan_sp = func_unwinders_sp->GetUnwindPlanFastUnwind( @@ -807,7 +808,9 @@ // section, so prefer that if available. On other platforms we may need to // provide a platform-specific UnwindPlan which encodes the details of how to // unwind out of sigtramp. - if (m_frame_type == eTrapHandlerFrame && process) { + if ((m_frame_type == eTrapHandlerFrame || + m_frame_type == eTrapHandlerParentFrame) && + process) { m_fast_unwind_plan_sp.reset(); unwind_plan_sp = func_unwinders_sp->GetEHFrameUnwindPlan(process->GetTarget()); @@ -1099,7 +1102,8 @@ // so this method helps to disambiguate that. bool RegisterContextUnwind::IsTrapHandlerFrame() const { - return m_frame_type == eTrapHandlerFrame; + return m_frame_type == eTrapHandlerFrame || + m_frame_type == eTrapHandlerParentFrame; } // A skip frame is a bogus frame on the stack -- but one where we're likely to @@ -1216,9 +1220,10 @@ // value instead of the Return Address register. // If $pc is not available, fall back to the RA reg. UnwindPlan::Row::RegisterLocation scratch; - if (m_frame_type == eTrapHandlerFrame && - active_row->GetRegisterInfo - (pc_regnum.GetAsKind (unwindplan_registerkind), scratch)) { + if ((m_frame_type == eTrapHandlerFrame || + m_frame_type == eTrapHandlerParentFrame) && + active_row->GetRegisterInfo( + pc_regnum.GetAsKind(unwindplan_registerkind), scratch)) { UnwindLogMsg("Providing pc register instead of rewriting to " "RA reg because this is a trap handler and there is " "a location for the saved pc register value."); @@ -1769,7 +1774,7 @@ return; } - m_frame_type = eTrapHandlerFrame; + m_frame_type = eTrapHandlerParentFrame; if (m_current_offset_backed_up_one != m_current_offset) { // We backed up the pc by 1 to compute the symbol context, but