diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2015-09-30 13:50:14 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2015-09-30 13:50:14 +0000 |
| commit | 648f3c7efa0e7d760a668686066adb4e2a91ca6d (patch) | |
| tree | c310c8f4f3d7142da83f5b2ca42783b4b5f94b55 /lldb/source/Plugins/Process | |
| parent | e6e082348d5125cbf7a0027d208f28d9f12f2832 (diff) | |
| download | bcm5719-llvm-648f3c7efa0e7d760a668686066adb4e2a91ca6d.tar.gz bcm5719-llvm-648f3c7efa0e7d760a668686066adb4e2a91ca6d.zip | |
Add support for .ARM.exidx unwind information
.ARM.exidx/.ARM.extab sections contain unwind information used on ARM
architecture from unwinding from an exception.
Differential revision: http://reviews.llvm.org/D13245
llvm-svn: 248903
Diffstat (limited to 'lldb/source/Plugins/Process')
| -rw-r--r-- | lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index 669db2f40ff..302f2034b94 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -17,6 +17,7 @@ #include "lldb/Core/RegisterValue.h" #include "lldb/Core/Value.h" #include "lldb/Expression/DWARFExpression.h" +#include "lldb/Symbol/ArmUnwindInfo.h" #include "lldb/Symbol/DWARFCallFrameInfo.h" #include "lldb/Symbol/FuncUnwinders.h" #include "lldb/Symbol/Function.h" @@ -794,24 +795,38 @@ RegisterContextLLDB::GetFullUnwindPlanForFrame () func_unwinders_sp = pc_module_sp->GetObjectFile()->GetUnwindTable().GetFuncUnwindersContainingAddress (m_current_pc, m_sym_ctx); } - // No FuncUnwinders available for this pc (i.e. a stripped function symbol and -fomit-frame-pointer). - // Try using the eh_frame information relative to the current PC, - // and finally fall back on the architectural default unwind. + // No FuncUnwinders available for this pc (stripped function symbols, lldb could not augment its + // function table with another source, like LC_FUNCTION_STARTS or eh_frame in ObjectFileMachO). + // See if eh_frame or the .ARM.exidx tables have unwind information for this address, else fall + // back to the architectural default unwind. if (!func_unwinders_sp) { - DWARFCallFrameInfo *eh_frame = pc_module_sp && pc_module_sp->GetObjectFile() ? - pc_module_sp->GetObjectFile()->GetUnwindTable().GetEHFrameInfo() : nullptr; - m_frame_type = eNormalFrame; - if (eh_frame && m_current_pc.IsValid()) + + if (!pc_module_sp || !pc_module_sp->GetObjectFile() || !m_current_pc.IsValid()) + return arch_default_unwind_plan_sp; + + // Even with -fomit-frame-pointer, we can try eh_frame to get back on track. + DWARFCallFrameInfo *eh_frame = pc_module_sp->GetObjectFile()->GetUnwindTable().GetEHFrameInfo(); + if (eh_frame) { unwind_plan_sp.reset (new UnwindPlan (lldb::eRegisterKindGeneric)); - // Even with -fomit-frame-pointer, we can try eh_frame to get back on track. if (eh_frame->GetUnwindPlan (m_current_pc, *unwind_plan_sp)) return unwind_plan_sp; else unwind_plan_sp.reset(); } + + ArmUnwindInfo *arm_exidx = pc_module_sp->GetObjectFile()->GetUnwindTable().GetArmUnwindInfo(); + if (arm_exidx) + { + unwind_plan_sp.reset (new UnwindPlan (lldb::eRegisterKindGeneric)); + if (arm_exidx->GetUnwindPlan (exe_ctx.GetTargetRef(), m_current_pc, *unwind_plan_sp)) + return unwind_plan_sp; + else + unwind_plan_sp.reset(); + } + return arch_default_unwind_plan_sp; } |

