@@ -187,18 +187,22 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
187
187
if (execution_result == lldb::eExpressionInterrupted ||
188
188
execution_result == lldb::eExpressionHitBreakpoint) {
189
189
const char *error_desc = nullptr ;
190
+ const char *explanation = execution_result == lldb::eExpressionInterrupted
191
+ ? " was interrupted"
192
+ : " hit a breakpoint" ;
190
193
191
194
if (user_expression_plan) {
192
195
if (auto real_stop_info_sp = user_expression_plan->GetRealStopInfo ())
193
196
error_desc = real_stop_info_sp->GetDescription ();
194
197
}
198
+
195
199
if (error_desc)
196
200
diagnostic_manager.Printf (lldb::eSeverityError,
197
- " Execution was interrupted, reason : %s." ,
201
+ " Expression execution %s : %s." , explanation ,
198
202
error_desc);
199
203
else
200
- diagnostic_manager.PutString (lldb::eSeverityError,
201
- " Execution was interrupted. " );
204
+ diagnostic_manager.Printf (lldb::eSeverityError,
205
+ " Expression execution %s. " , explanation );
202
206
203
207
if ((execution_result == lldb::eExpressionInterrupted &&
204
208
options.DoesUnwindOnError ()) ||
@@ -212,31 +216,35 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
212
216
user_expression_plan->TransferExpressionOwnership ();
213
217
diagnostic_manager.AppendMessageToDiagnostic (
214
218
" The process has been left at the point where it was "
215
- " interrupted, "
216
- " use \" thread return -x\" to return to the state before "
217
- " expression evaluation." );
219
+ " interrupted, use \" thread return -x\" to return to the state "
220
+ " before expression evaluation." );
218
221
}
219
222
220
223
return execution_result;
221
- } else if (execution_result == lldb::eExpressionStoppedForDebug) {
224
+ }
225
+
226
+ if (execution_result == lldb::eExpressionStoppedForDebug) {
222
227
diagnostic_manager.PutString (
223
228
lldb::eSeverityInfo,
224
- " Execution was halted at the first instruction of the expression "
225
- " function because \" debug\" was requested.\n "
229
+ " Expression execution was halted at the first instruction of the "
230
+ " expression function because \" debug\" was requested.\n "
226
231
" Use \" thread return -x\" to return to the state before expression "
227
232
" evaluation." );
228
233
return execution_result;
229
- } else if (execution_result == lldb::eExpressionThreadVanished) {
230
- diagnostic_manager.Printf (
231
- lldb::eSeverityError,
232
- " Couldn't complete execution; the thread "
233
- " on which the expression was being run: 0x%" PRIx64
234
- " exited during its execution." ,
235
- expr_thread_id);
234
+ }
235
+
236
+ if (execution_result == lldb::eExpressionThreadVanished) {
237
+ diagnostic_manager.Printf (lldb::eSeverityError,
238
+ " Couldn't execute expression: the thread on "
239
+ " which the expression was being run (0x%" PRIx64
240
+ " ) exited during its execution." ,
241
+ expr_thread_id);
236
242
return execution_result;
237
- } else if (execution_result != lldb::eExpressionCompleted) {
243
+ }
244
+
245
+ if (execution_result != lldb::eExpressionCompleted) {
238
246
diagnostic_manager.Printf (lldb::eSeverityError,
239
- " Couldn't execute function; result was %s" ,
247
+ " Couldn't execute expression: result was %s" ,
240
248
toString (execution_result).c_str ());
241
249
return execution_result;
242
250
}
@@ -245,9 +253,9 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
245
253
if (FinalizeJITExecution (diagnostic_manager, exe_ctx, result,
246
254
function_stack_bottom, function_stack_top)) {
247
255
return lldb::eExpressionCompleted;
248
- } else {
249
- return lldb::eExpressionResultUnavailable;
250
256
}
257
+
258
+ return lldb::eExpressionResultUnavailable;
251
259
}
252
260
253
261
bool LLVMUserExpression::FinalizeJITExecution (
0 commit comments