aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-08-27 21:47:54 +0000
committerGreg Clayton <gclayton@apple.com>2010-08-27 21:47:54 +0000
commit68275d5e56e7c89b18e7f8da2dbfb529b6ced5b6 (patch)
tree927762ba27c3a95cc811c61758b5055bc7eaf18c /lldb/source/Target
parentaf371b49a8c65bd44223682fd5ee3c669e885fed (diff)
downloadllvm-68275d5e56e7c89b18e7f8da2dbfb529b6ced5b6.tar.gz
llvm-68275d5e56e7c89b18e7f8da2dbfb529b6ced5b6.tar.bz2
llvm-68275d5e56e7c89b18e7f8da2dbfb529b6ced5b6.zip
Made it so we update the current frames from the previous frames by doing STL
swaps on the variable list, value object list, and disassembly. This avoids us having to try and update frame indexes and other things that were getting out of sync. llvm-svn: 112301
Diffstat (limited to 'lldb/source/Target')
-rw-r--r--lldb/source/Target/StackFrame.cpp13
-rw-r--r--lldb/source/Target/StackFrameList.cpp27
2 files changed, 18 insertions, 22 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index 972c19a21758..967df8815f23 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -531,11 +531,14 @@ StackFrame::Dump (Stream *strm, bool show_frame_index)
m_sc.DumpStopContext(strm, &m_thread.GetProcess(), GetFrameCodeAddress(), show_module, show_inline);
}
-
void
-StackFrame::SetSymbolContext (const SymbolContext& sc)
+StackFrame::UpdateCurrentFrameFromPreviousFrame (StackFrame &frame)
{
- m_sc = sc;
- m_flags.Clear(eSymbolContextEverything);
- m_flags.Set(m_sc.GetResolvedMask ());
+ assert (GetStackID() == frame.GetStackID()); // TODO: remove this after some testing
+ m_variable_list_sp = frame.m_variable_list_sp;
+ m_value_object_list.Swap (frame.m_value_object_list);
+ if (!m_disassembly.GetString().empty())
+ m_disassembly.GetString().swap (m_disassembly.GetString());
}
+
+
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp
index 249100ab2ff7..be4e6e46da2d 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -151,9 +151,9 @@ StackFrameList::GetNumFrames()
StackFrameList *curr_frames = this;
#if defined (DEBUG_STACK_FRAMES)
- s.PutCString("prev_frames:\n");
+ s.PutCString("\nprev_frames:\n");
prev_frames->Dump (&s);
- s.PutCString("curr_frames:\n");
+ s.PutCString("\ncurr_frames:\n");
curr_frames->Dump (&s);
s.EOL();
#endif
@@ -203,8 +203,6 @@ StackFrameList::GetNumFrames()
// Same function different block
if (m_show_inlined_frames)
break;
- else
- prev_frame->SetSymbolContext (curr_frame->m_sc);
}
}
else if (curr_sc.symbol && curr_sc.symbol == prev_sc.symbol)
@@ -217,27 +215,22 @@ StackFrameList::GetNumFrames()
break;
}
- if (curr_frame->GetFrameCodeAddress() != prev_frame->GetFrameCodeAddress())
- {
-#if defined (DEBUG_STACK_FRAMES)
- s.Printf("\nUpdating frame code address and symbol context in previous frame #%u to current frame #%u", prev_frame_idx, curr_frame_idx);
-#endif
- // We have a different code frame address, we might need to copy
- // some stuff in prev_frame, yet update the code address...
- prev_frame->SetFrameCodeAddress (curr_frame->GetFrameCodeAddress());
- prev_frame->SetSymbolContext (curr_frame->m_sc);
- }
-
- curr_frames->m_frames[curr_frame_idx] = prev_frames->m_frames[prev_frame_idx];
+ curr_frame->UpdateCurrentFrameFromPreviousFrame (*prev_frame);
#if defined (DEBUG_STACK_FRAMES)
- s.Printf("\nCopying previous frame #%u to current frame #%u", prev_frame_idx, curr_frame_idx);
+ s.Printf("\n Copying previous frame to current frame");
#endif
}
// We are done with the old stack frame list, we can release it now
m_prev_frames_ap.release();
prev_frames = NULL;
}
+
+#if defined (DEBUG_STACK_FRAMES)
+ s.PutCString("\n\nNew frames:\n");
+ Dump (&s);
+ s.EOL();
+#endif
}
else
{