diff options
| author | Jason Molenda <jason@molenda.com> | 2021-03-03 19:25:30 -0800 |
|---|---|---|
| committer | Jason Molenda <jason@molenda.com> | 2021-03-03 19:29:40 -0800 |
| commit | 266bb78f7d133a344992c5bfca61ef11ee152cb0 (patch) | |
| tree | 00a4783265062a1c2f6652d1e046b8934f10890c /lldb/source/Target/StackFrameList.cpp | |
| parent | 09fa1d0e50a3d907e8596f6ea49780b7187b727e (diff) | |
LanguageRuntime for 0th frame unwind, simplify getting pc-for-symbolication
Add calls into LanguageRuntime when finding the unwind method to
use out of the 0th (currently executing) stack frame.
Allow for the LanguageRuntimes to indicate if this stack frames
should be treated like a zeroth-frame -- symbolication should be
done based on the saved pc address, not decremented like normal ABI
function calls.
Add methods to RegisterContext and StackFrame to get a pc value
suitable for symbolication, to reduce the number of places in lldb
where we decrement the saved pc values before symbolication.
<rdar://problem/70398009>
Differential Revision: https://reviews.llvm.org/D97644
Diffstat (limited to 'lldb/source/Target/StackFrameList.cpp')
| -rw-r--r-- | lldb/source/Target/StackFrameList.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index e4f5d3028366..95ebfb58a7ec 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -522,27 +522,10 @@ void StackFrameList::GetFramesUpTo(uint32_t end_idx) { SymbolContext unwind_sc = unwind_frame_sp->GetSymbolContext( eSymbolContextBlock | eSymbolContextFunction); Block *unwind_block = unwind_sc.block; + TargetSP target_sp = m_thread.CalculateTarget(); if (unwind_block) { - Address curr_frame_address(unwind_frame_sp->GetFrameCodeAddress()); - TargetSP target_sp = m_thread.CalculateTarget(); - // Be sure to adjust the frame address to match the address that was - // used to lookup the symbol context above. If we are in the first - // concrete frame, then we lookup using the current address, else we - // decrement the address by one to get the correct location. - if (idx > 0) { - if (curr_frame_address.GetOffset() == 0) { - // If curr_frame_address points to the first address in a section - // then after adjustment it will point to an other section. In that - // case resolve the address again to the correct section plus - // offset form. - addr_t load_addr = curr_frame_address.GetOpcodeLoadAddress( - target_sp.get(), AddressClass::eCode); - curr_frame_address.SetOpcodeLoadAddress( - load_addr - 1, target_sp.get(), AddressClass::eCode); - } else { - curr_frame_address.Slide(-1); - } - } + Address curr_frame_address( + unwind_frame_sp->GetFrameCodeAddressForSymbolication()); SymbolContext next_frame_sc; Address next_frame_address; |
