diff options
author | Jim Ingham <jingham@apple.com> | 2011-08-27 01:22:52 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-08-27 01:22:52 +0000 |
commit | 650543f9ba62022daea1c498a1627a160afc15cc (patch) | |
tree | 67fd37c5565b879a0faa933b4adc86b1928ba15e /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 29ad95b2321746f8266c0bcbd4af82618a7df5db (diff) | |
download | bcm5719-llvm-650543f9ba62022daea1c498a1627a160afc15cc.tar.gz bcm5719-llvm-650543f9ba62022daea1c498a1627a160afc15cc.zip |
Hold onto a shared pointer to the frame CommandObjectFrameVariable::Execute is
analyzing so it won't get deleted on us if a formatter runs code.
llvm-svn: 138692
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 94078b844a9..5b5d6c3c8ba 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -432,7 +432,13 @@ public: Stream &s = result.GetOutputStream(); bool get_file_globals = true; - VariableList *variable_list = exe_ctx.frame->GetVariableList (get_file_globals); + + // Be careful about the stack frame, if any summary formatter runs code, it might clear the StackFrameList + // for the thread. So hold onto a shared pointer to the frame so it stays alive. + + StackFrameSP frame_sp = exe_ctx.frame->GetSP(); + + VariableList *variable_list = frame_sp->GetVariableList (get_file_globals); VariableSP var_sp; ValueObjectSP valobj_sp; @@ -489,7 +495,7 @@ public: var_sp = regex_var_list.GetVariableAtIndex (regex_idx); if (var_sp) { - valobj_sp = exe_ctx.frame->GetValueObjectForFrameVariable (var_sp, m_varobj_options.use_dynamic); + valobj_sp = frame_sp->GetValueObjectForFrameVariable (var_sp, m_varobj_options.use_dynamic); if (valobj_sp) { if (m_option_variable.format != eFormatDefault) @@ -530,7 +536,7 @@ public: Error error; uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember; lldb::VariableSP var_sp; - valobj_sp = exe_ctx.frame->GetValueForVariableExpressionPath (name_cstr, + valobj_sp = frame_sp->GetValueForVariableExpressionPath (name_cstr, m_varobj_options.use_dynamic, expr_path_options, var_sp, @@ -610,7 +616,7 @@ public: // Use the variable object code to make sure we are // using the same APIs as the the public API will be // using... - valobj_sp = exe_ctx.frame->GetValueObjectForFrameVariable (var_sp, + valobj_sp = frame_sp->GetValueObjectForFrameVariable (var_sp, m_varobj_options.use_dynamic); if (valobj_sp) { |