summaryrefslogtreecommitdiff
path: root/lldb/source/Expression/LLVMUserExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/LLVMUserExpression.cpp')
-rw-r--r--lldb/source/Expression/LLVMUserExpression.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lldb/source/Expression/LLVMUserExpression.cpp b/lldb/source/Expression/LLVMUserExpression.cpp
index 1fc878bbd616..187b427e66aa 100644
--- a/lldb/source/Expression/LLVMUserExpression.cpp
+++ b/lldb/source/Expression/LLVMUserExpression.cpp
@@ -1,4 +1,4 @@
-//===-- LLVMUserExpression.cpp ----------------------------------*- C++ -*-===//
+//===-- LLVMUserExpression.cpp --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -134,6 +134,10 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
return lldb::eExpressionSetupError;
}
+ // Store away the thread ID for error reporting, in case it exits
+ // during execution:
+ lldb::tid_t expr_thread_id = exe_ctx.GetThreadRef().GetID();
+
Address wrapper_address(m_jit_start_addr);
std::vector<lldb::addr_t> args;
@@ -223,6 +227,14 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
"Use \"thread return -x\" to return to the state before expression "
"evaluation.");
return execution_result;
+ } else if (execution_result == lldb::eExpressionThreadVanished) {
+ diagnostic_manager.Printf(
+ eDiagnosticSeverityError,
+ "Couldn't complete execution; the thread "
+ "on which the expression was being run: 0x%" PRIx64
+ " exited during its execution.",
+ expr_thread_id);
+ return execution_result;
} else if (execution_result != lldb::eExpressionCompleted) {
diagnostic_manager.Printf(
eDiagnosticSeverityError, "Couldn't execute function; result was %s",
@@ -357,8 +369,3 @@ bool LLVMUserExpression::PrepareToExecuteJITExpression(
return true;
}
-lldb::ModuleSP LLVMUserExpression::GetJITModule() {
- if (m_execution_unit_sp)
- return m_execution_unit_sp->GetJITModule();
- return lldb::ModuleSP();
-}