diff options
author | Jim Ingham <jingham@apple.com> | 2010-11-30 02:22:11 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2010-11-30 02:22:11 +0000 |
commit | f48169bb4f4ff2921b3522fd7a4b8586f5473984 (patch) | |
tree | a3b94bf2e3539c728fa233eb3368280f302b14fe /lldb/source/Commands/CommandObjectExpression.cpp | |
parent | d4900a644ce3e5ff9e5c5acd4bd379ec45017d8d (diff) | |
download | bcm5719-llvm-f48169bb4f4ff2921b3522fd7a4b8586f5473984.tar.gz bcm5719-llvm-f48169bb4f4ff2921b3522fd7a4b8586f5473984.zip |
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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); } |