diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2015-06-24 11:27:32 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2015-06-24 11:27:32 +0000 |
| commit | 44ff9ccede2c44c79e735127cc25853156189ba9 (patch) | |
| tree | 4b7bf8a0a2653b2bd6c9a176da957bbe5576cefd /lldb/source/Symbol/FuncUnwinders.cpp | |
| parent | 1d2353d4f3cda04ea7ef18dfffc720b526816de2 (diff) | |
| download | bcm5719-llvm-44ff9ccede2c44c79e735127cc25853156189ba9.tar.gz bcm5719-llvm-44ff9ccede2c44c79e735127cc25853156189ba9.zip | |
Improve instruction emulation based stack unwinding on ARM
* Add and fix the emulation of several instruction.
* Disable frame pointer usage on Android.
* Specify return address register for the unwind plan instead of explict
tracking the value of RA.
* Replace prologue detection heuristics (unreliable in several cases)
with a logic to follow the branch instructions and restore the CFI
value based on them. The target address for a branch should have the
same CFI as the source address (if they are in the same function).
* Handle symbols in ELF files where the symbol size is not specified
with calcualting their size based on the next symbol (already done
in MachO files).
* Fix architecture in FuncUnwinders with filling up the inforamtion
missing from the object file with the architecture of the target.
* Add code to read register wehn the value is set to "IsSame" as it
meanse the value of a register in the parent frame is the same as the
value in the current frame.
Differential revision: http://reviews.llvm.org/D10447
llvm-svn: 240533
Diffstat (limited to 'lldb/source/Symbol/FuncUnwinders.cpp')
| -rw-r--r-- | lldb/source/Symbol/FuncUnwinders.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lldb/source/Symbol/FuncUnwinders.cpp b/lldb/source/Symbol/FuncUnwinders.cpp index a36d5546b04..000df722bb9 100644 --- a/lldb/source/Symbol/FuncUnwinders.cpp +++ b/lldb/source/Symbol/FuncUnwinders.cpp @@ -154,7 +154,7 @@ FuncUnwinders::GetEHFrameAugmentedUnwindPlan (Target &target, Thread &thread, in // Augment the eh_frame instructions with epilogue descriptions if necessary so the // UnwindPlan can be used at any instruction in the function. - UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler()); + UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler(target)); if (assembly_profiler_sp) { if (!assembly_profiler_sp->AugmentUnwindPlanFromCallSite (m_range, thread, *m_unwind_plan_eh_frame_augmented_sp)) @@ -179,7 +179,7 @@ FuncUnwinders::GetAssemblyUnwindPlan (Target &target, Thread &thread, int curren Mutex::Locker lock (m_mutex); m_tried_unwind_plan_assembly = true; - UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler()); + UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler(target)); if (assembly_profiler_sp) { m_unwind_plan_assembly_sp.reset (new UnwindPlan (lldb::eRegisterKindGeneric)); @@ -204,7 +204,7 @@ FuncUnwinders::GetUnwindPlanAtNonCallSite (Target& target, Thread& thread, int c } UnwindPlanSP -FuncUnwinders::GetUnwindPlanFastUnwind (Thread& thread) +FuncUnwinders::GetUnwindPlanFastUnwind (Target& target, Thread& thread) { if (m_unwind_plan_fast_sp.get() || m_tried_unwind_fast) return m_unwind_plan_fast_sp; @@ -212,7 +212,7 @@ FuncUnwinders::GetUnwindPlanFastUnwind (Thread& thread) Mutex::Locker locker (m_mutex); m_tried_unwind_fast = true; - UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler()); + UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler(target)); if (assembly_profiler_sp) { m_unwind_plan_fast_sp.reset (new UnwindPlan (lldb::eRegisterKindGeneric)); @@ -287,7 +287,7 @@ FuncUnwinders::GetFirstNonPrologueInsn (Target& target) Mutex::Locker locker (m_mutex); ExecutionContext exe_ctx (target.shared_from_this(), false); - UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler()); + UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler(target)); if (assembly_profiler_sp) assembly_profiler_sp->FirstNonPrologueInsn (m_range, exe_ctx, m_first_non_prologue_insn); return m_first_non_prologue_insn; @@ -300,12 +300,13 @@ FuncUnwinders::GetFunctionStartAddress () const } lldb::UnwindAssemblySP -FuncUnwinders::GetUnwindAssemblyProfiler () +FuncUnwinders::GetUnwindAssemblyProfiler (Target& target) { UnwindAssemblySP assembly_profiler_sp; ArchSpec arch; if (m_unwind_table.GetArchitecture (arch)) { + arch.MergeFrom (target.GetArchitecture ()); assembly_profiler_sp = UnwindAssembly::FindPlugin (arch); } return assembly_profiler_sp; |

