diff options
Diffstat (limited to 'lldb/source/Target/StackFrameList.cpp')
-rw-r--r-- | lldb/source/Target/StackFrameList.cpp | 62 |
1 files changed, 13 insertions, 49 deletions
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index 3f747812240..3d8342326a3 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -112,64 +112,28 @@ StackFrameList::GetNumFrames (bool can_create) m_frames.push_back (unwind_frame_sp); } - Block *unwind_block = unwind_frame_sp->GetSymbolContext (eSymbolContextBlock).block; - + SymbolContext unwind_sc = unwind_frame_sp->GetSymbolContext (eSymbolContextBlock | eSymbolContextFunction); + Block *unwind_block = unwind_sc.block; if (unwind_block) { - Block *inlined_block = unwind_block->GetContainingInlinedBlock(); - if (inlined_block) + Address curr_frame_address = unwind_frame_sp->GetFrameCodeAddress(); + SymbolContext next_frame_sc; + Address next_frame_address; + + while (unwind_sc.GetParentOfInlinedScope(curr_frame_address, next_frame_sc, next_frame_address)) { - for (; inlined_block != NULL; inlined_block = inlined_block->GetInlinedParent ()) - { - SymbolContext inline_sc; - Block *parent_block = inlined_block->GetInlinedParent(); - - const bool is_inlined_frame = parent_block != NULL; - - if (parent_block == NULL) - parent_block = inlined_block->GetParent(); - - parent_block->CalculateSymbolContext (&inline_sc); - - Address previous_frame_lookup_addr (m_frames.back()->GetFrameCodeAddress()); - if (unwind_frame_sp->GetFrameIndex() > 0 && m_frames.back().get() == unwind_frame_sp.get()) - previous_frame_lookup_addr.Slide (-1); - - AddressRange range; - inlined_block->GetRangeContainingAddress (previous_frame_lookup_addr, range); - - const InlineFunctionInfo* inline_info = inlined_block->GetInlinedFunctionInfo(); - assert (inline_info); - inline_sc.line_entry.range.GetBaseAddress() = m_frames.back()->GetFrameCodeAddress(); - inline_sc.line_entry.file = inline_info->GetCallSite().GetFile(); - inline_sc.line_entry.line = inline_info->GetCallSite().GetLine(); - inline_sc.line_entry.column = inline_info->GetCallSite().GetColumn(); - StackFrameSP frame_sp(new StackFrame (m_frames.size(), idx, m_thread, unwind_frame_sp->GetRegisterContextSP (), cfa, - range.GetBaseAddress(), - &inline_sc)); // The symbol context for this inline frame - - if (is_inlined_frame) - { - // Use the block with the inlined function info - // as the symbol context since we want this frame - // to have only the variables for the inlined function - frame_sp->SetSymbolContextScope (parent_block); - } - else - { - // This block is not inlined with means it has no - // inlined parents either, so we want to use the top - // most function block. - frame_sp->SetSymbolContextScope (&unwind_frame_sp->GetSymbolContext (eSymbolContextFunction).function->GetBlock(false)); - } - + next_frame_address, + &next_frame_sc)); + m_frames.push_back (frame_sp); - } + unwind_sc = next_frame_sc; + curr_frame_address = next_frame_address; + } } } |