From f48169bb4f4ff2921b3522fd7a4b8586f5473984 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 30 Nov 2010 02:22:11 +0000 Subject: Moved the code in ClangUserExpression that set up & ran the thread plan with timeouts, and restarting with all threads into a utility function in Process. This required a bunch of renaming. Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it. Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened. llvm-svn: 120386 --- lldb/source/Commands/CommandObjectExpression.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lldb/source/Commands/CommandObjectExpression.cpp') diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 32236f8c917..c58f3f529c8 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -13,6 +13,7 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include "CommandObjectThread.h" // For DisplayThreadInfo. #include "lldb/Interpreter/Args.h" #include "lldb/Core/Value.h" #include "lldb/Core/InputReader.h" @@ -242,7 +243,8 @@ CommandObjectExpression::EvaluateExpression if (m_exe_ctx.target) prefix = m_exe_ctx.target->GetExpressionPrefixContentsAsCString(); - lldb::ValueObjectSP result_valobj_sp (ClangUserExpression::Evaluate (m_exe_ctx, m_options.unwind_on_error, expr, prefix)); + lldb::ValueObjectSP result_valobj_sp; + Process::ExecutionResults execution_results = ClangUserExpression::Evaluate (m_exe_ctx, m_options.unwind_on_error, expr, prefix, result_valobj_sp); assert (result_valobj_sp.get()); if (result_valobj_sp->GetError().Success()) { @@ -267,6 +269,16 @@ CommandObjectExpression::EvaluateExpression else { error_stream.PutCString(result_valobj_sp->GetError().AsCString()); + // If we've been interrupted, display state information. + if (execution_results == Process::eExecutionInterrupted && !m_options.unwind_on_error) + { + if (m_exe_ctx.thread) + lldb_private::DisplayThreadInfo (m_interpreter, result->GetOutputStream(), m_exe_ctx.thread, false, true); + else + { + lldb_private::DisplayThreadsInfo (m_interpreter, &m_exe_ctx, *result, true, true); + } + } if (result) result->SetStatus (eReturnStatusFailed); } -- cgit v1.2.3