@@ -168,8 +168,8 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
168
168
169
169
Target *target = exe_ctx.GetTargetPtr ();
170
170
if (!target) {
171
- LLDB_LOGF (log, " == [UserExpression::Evaluate] Passed a NULL target, can't "
172
- " run expressions." );
171
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Passed a NULL target, can't "
172
+ " run expressions." );
173
173
error.SetErrorString (" expression passed a null target" );
174
174
return lldb::eExpressionSetupError;
175
175
}
@@ -178,9 +178,8 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
178
178
179
179
if (process == nullptr || process->GetState () != lldb::eStateStopped) {
180
180
if (execution_policy == eExecutionPolicyAlways) {
181
- LLDB_LOGF (log,
182
- " == [UserExpression::Evaluate] Expression may not run, but "
183
- " is not constant ==" );
181
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Expression may not run, but "
182
+ " is not constant ==" );
184
183
185
184
error.SetErrorString (" expression needed to run but couldn't" );
186
185
@@ -225,15 +224,13 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
225
224
desired_type, options, ctx_obj,
226
225
error));
227
226
if (error.Fail ()) {
228
- if (log)
229
- LLDB_LOGF (log, " == [UserExpression::Evaluate] Getting expression: %s ==" ,
230
- error.AsCString ());
227
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Getting expression: {0} ==" ,
228
+ error.AsCString ());
231
229
return lldb::eExpressionSetupError;
232
230
}
233
231
234
- if (log)
235
- LLDB_LOGF (log, " == [UserExpression::Evaluate] Parsing expression %s ==" ,
236
- expr.str ().c_str ());
232
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Parsing expression {0} ==" ,
233
+ expr.str ());
237
234
238
235
const bool keep_expression_in_memory = true ;
239
236
const bool generate_debug_info = options.GetGenerateDebugInfo ();
@@ -306,10 +303,8 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
306
303
307
304
if (execution_policy == eExecutionPolicyNever &&
308
305
!user_expression_sp->CanInterpret ()) {
309
- if (log)
310
- LLDB_LOGF (log,
311
- " == [UserExpression::Evaluate] Expression may not run, but "
312
- " is not constant ==" );
306
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Expression may not run, but "
307
+ " is not constant ==" );
313
308
314
309
if (!diagnostic_manager.Diagnostics ().size ())
315
310
error.SetExpressionError (lldb::eExpressionSetupError,
@@ -329,17 +324,15 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
329
324
330
325
diagnostic_manager.Clear ();
331
326
332
- if (log)
333
- LLDB_LOGF (log, " == [UserExpression::Evaluate] Executing expression ==" );
327
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Executing expression ==" );
334
328
335
329
execution_results =
336
330
user_expression_sp->Execute (diagnostic_manager, exe_ctx, options,
337
331
user_expression_sp, expr_result);
338
332
339
333
if (execution_results != lldb::eExpressionCompleted) {
340
- if (log)
341
- LLDB_LOGF (log, " == [UserExpression::Evaluate] Execution completed "
342
- " abnormally ==" );
334
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Execution completed "
335
+ " abnormally ==" );
343
336
344
337
if (!diagnostic_manager.Diagnostics ().size ())
345
338
error.SetExpressionError (
@@ -351,15 +344,13 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
351
344
if (expr_result) {
352
345
result_valobj_sp = expr_result->GetValueObject ();
353
346
354
- if (log)
355
- LLDB_LOGF (log,
356
- " == [UserExpression::Evaluate] Execution completed "
357
- " normally with result %s ==" ,
358
- result_valobj_sp->GetValueAsCString ());
347
+ LLDB_LOG (log,
348
+ " == [UserExpression::Evaluate] Execution completed "
349
+ " normally with result %s ==" ,
350
+ result_valobj_sp->GetValueAsCString ());
359
351
} else {
360
- if (log)
361
- LLDB_LOGF (log, " == [UserExpression::Evaluate] Execution completed "
362
- " normally with no result ==" );
352
+ LLDB_LOG (log, " == [UserExpression::Evaluate] Execution completed "
353
+ " normally with no result ==" );
363
354
364
355
error.SetError (UserExpression::kNoResult , lldb::eErrorTypeGeneric);
365
356
}
0 commit comments