@@ -124,7 +124,7 @@ InstrumentationBoundsSafetyStopInfo::ComputeStopReasonAndSuggestedStackFrame(
124124 Log *log_category = GetLog (LLDBLog::InstrumentationRuntime);
125125 ThreadSP thread_sp = GetThread ();
126126 if (!thread_sp) {
127- LLDB_LOGF (log_category, " failed to get thread while stopped" );
127+ LLDB_LOG (log_category, " failed to get thread while stopped" );
128128 return {};
129129 }
130130
@@ -133,7 +133,7 @@ InstrumentationBoundsSafetyStopInfo::ComputeStopReasonAndSuggestedStackFrame(
133133
134134 StackFrameSP parent_sf = thread_sp->GetStackFrameAtIndex (1 );
135135 if (!parent_sf) {
136- LLDB_LOGF (log_category, " got nullptr when fetching stackframe at index 1" );
136+ LLDB_LOG (log_category, " got nullptr when fetching stackframe at index 1" );
137137 return {};
138138 }
139139
@@ -166,9 +166,9 @@ InstrumentationBoundsSafetyStopInfo::
166166 auto MaybeTrapReason =
167167 clang::CodeGen::DemangleTrapReasonInDebugInfo (TrapReasonFuncName);
168168 if (!MaybeTrapReason.has_value ()) {
169- LLDB_LOGF (
169+ LLDB_LOG (
170170 GetLog (LLDBLog::InstrumentationRuntime),
171- " clang::CodeGen::DemangleTrapReasonInDebugInfo(\" %s \" ) call failed" ,
171+ " clang::CodeGen::DemangleTrapReasonInDebugInfo(\" {0} \" ) call failed" ,
172172 TrapReasonFuncName);
173173 return {};
174174 }
@@ -207,7 +207,7 @@ InstrumentationBoundsSafetyStopInfo::
207207 Log *log_category = GetLog (LLDBLog::InstrumentationRuntime);
208208 StackFrameSP softtrap_sf = thread_sp->GetStackFrameAtIndex (0 );
209209 if (!softtrap_sf) {
210- LLDB_LOGF (log_category, " got nullptr when fetching stackframe at index 0" );
210+ LLDB_LOG (log_category, " got nullptr when fetching stackframe at index 0" );
211211 return {};
212212 }
213213 llvm::StringRef trap_reason_func_name = softtrap_sf->GetFunctionName ();
@@ -242,16 +242,16 @@ InstrumentationBoundsSafetyStopInfo::
242242 // __bounds_safety_soft_trap_s has one argument which is a pointer to a string
243243 // describing the trap or a nullptr.
244244 if (trap_reason_func_name != BoundsSafetySoftTrapStr) {
245- LLDB_LOGF (log_category,
246- " unexpected function name. Expected \" %s \" but got \" %s \" " ,
247- BoundsSafetySoftTrapStr.data (), trap_reason_func_name.data ());
245+ LLDB_LOG (log_category,
246+ " unexpected function name. Expected \" {0} \" but got \" {1} \" " ,
247+ BoundsSafetySoftTrapStr.data (), trap_reason_func_name.data ());
248248 assert (0 && " hit breakpoint for unexpected function name" );
249249 return {};
250250 }
251251
252252 RegisterContextSP rc = thread_sp->GetRegisterContext ();
253253 if (!rc) {
254- LLDB_LOGF (log_category, " failed to get register context" );
254+ LLDB_LOG (log_category, " failed to get register context" );
255255 return {};
256256 }
257257
@@ -262,7 +262,7 @@ InstrumentationBoundsSafetyStopInfo::
262262 // work.
263263 ProcessSP process = thread_sp->GetProcess ();
264264 if (!process) {
265- LLDB_LOGF (log_category, " failed to get process" );
265+ LLDB_LOG (log_category, " failed to get process" );
266266 return {};
267267 }
268268 switch (process->GetTarget ().GetArchitecture ().GetCore ()) {
@@ -289,19 +289,19 @@ InstrumentationBoundsSafetyStopInfo::
289289 const RegisterInfo *arg0_info = rc->GetRegisterInfo (
290290 lldb::RegisterKind::eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1);
291291 if (!arg0_info) {
292- LLDB_LOGF (log_category,
293- " failed to get register info for LLDB_REGNUM_GENERIC_ARG1" );
292+ LLDB_LOG (log_category,
293+ " failed to get register info for LLDB_REGNUM_GENERIC_ARG1" );
294294 return {};
295295 }
296296 RegisterValue reg_value;
297297 if (!rc->ReadRegister (arg0_info, reg_value)) {
298- LLDB_LOGF (log_category, " failed to read register %s " , arg0_info->name );
298+ LLDB_LOG (log_category, " failed to read register {0} " , arg0_info->name );
299299 return {};
300300 }
301301 uint64_t reg_value_as_int = reg_value.GetAsUInt64 (UINT64_MAX);
302302 if (reg_value_as_int == UINT64_MAX) {
303- LLDB_LOGF (log_category, " failed to read register %s as a UInt64" ,
304- arg0_info->name );
303+ LLDB_LOG (log_category, " failed to read register {0} as a UInt64" ,
304+ arg0_info->name );
305305 return {};
306306 }
307307
@@ -323,12 +323,13 @@ InstrumentationBoundsSafetyStopInfo::
323323 thread_sp->GetProcess ()->ReadCStringFromMemory (reg_value_as_int, out_string,
324324 error_status);
325325 if (error_status.Fail ()) {
326- LLDB_LOGF (log_category, " failed to read C string from address %p " ,
327- (void *)reg_value_as_int);
326+ LLDB_LOG (log_category, " failed to read C string from address {0} " ,
327+ (void *)reg_value_as_int);
328328 return {};
329329 }
330- LLDB_LOGF (log_category, " read C string from %p found in register %s: \" %s\" " ,
331- (void *)reg_value_as_int, arg0_info->name , out_string.c_str ());
330+ LLDB_LOG (log_category,
331+ " read C string from {0} found in register {1}: \" {2}\" " ,
332+ (void *)reg_value_as_int, arg0_info->name , out_string.c_str ());
332333 std::string stop_reason;
333334 llvm::raw_string_ostream SS (stop_reason);
334335 SS << SOFT_TRAP_FALLBACK_CATEGORY;
@@ -380,14 +381,14 @@ bool InstrumentationRuntimeBoundsSafety::CheckIfRuntimeIsValid(
380381
381382 if (module_sp->FindFirstSymbolWithNameAndType (test_sym,
382383 lldb::eSymbolTypeAny)) {
383- LLDB_LOGF (log_category, " found \" %s \" in %s " , SoftTrapFunc.c_str (),
384- module_sp->GetObjectName ().AsCString (" <unknown>" ));
384+ LLDB_LOG (log_category, " found \" {0} \" in {1} " , SoftTrapFunc.c_str (),
385+ module_sp->GetObjectName ().AsCString (" <unknown>" ));
385386 return true ;
386387 }
387388 }
388- LLDB_LOGF (log_category,
389- " did not findFound BoundsSafety soft trap functions in %s " ,
390- module_sp->GetObjectName ().AsCString (" <unknown>" ));
389+ LLDB_LOG (log_category,
390+ " did not find BoundsSafety soft trap functions in module {0} " ,
391+ module_sp->GetObjectName ().AsCString (" <unknown>" ));
391392 return false ;
392393}
393394
@@ -404,26 +405,26 @@ bool InstrumentationRuntimeBoundsSafety::NotifyBreakpointHit(
404405 Log *log_category = GetLog (LLDBLog::InstrumentationRuntime);
405406 ProcessSP process_sp = instance->GetProcessSP ();
406407 if (!process_sp) {
407- LLDB_LOGF (log_category, " failed to get process from baton" );
408+ LLDB_LOG (log_category, " failed to get process from baton" );
408409 return false ;
409410 }
410411 ThreadSP thread_sp = context->exe_ctx_ref .GetThreadSP ();
411412 if (!thread_sp) {
412- LLDB_LOGF (log_category,
413- " failed to get thread from StoppointCallbackContext" );
413+ LLDB_LOG (log_category,
414+ " failed to get thread from StoppointCallbackContext" );
414415 return false ;
415416 }
416417 if (process_sp != context->exe_ctx_ref .GetProcessSP ()) {
417- LLDB_LOGF (log_category,
418- " process from baton (%p ) and StoppointCallbackContext (%p ) do "
419- " not match" ,
420- (void *)process_sp.get (),
421- (void *)context->exe_ctx_ref .GetProcessSP ().get ());
418+ LLDB_LOG (log_category,
419+ " process from baton ({0} ) and StoppointCallbackContext ({1} ) do "
420+ " not match" ,
421+ (void *)process_sp.get (),
422+ (void *)context->exe_ctx_ref .GetProcessSP ().get ());
422423 return false ;
423424 }
424425
425426 if (process_sp->GetModIDRef ().IsLastResumeForUserExpression ()) {
426- LLDB_LOGF (log_category, " IsLastResumeForUserExpression is true" );
427+ LLDB_LOG (log_category, " IsLastResumeForUserExpression is true" );
427428 return false ;
428429 }
429430
@@ -442,7 +443,7 @@ void InstrumentationRuntimeBoundsSafety::Activate() {
442443 Log *log_category = GetLog (LLDBLog::InstrumentationRuntime);
443444 ProcessSP process_sp = GetProcessSP ();
444445 if (!process_sp) {
445- LLDB_LOGF (log_category, " could not get process during Activate()" );
446+ LLDB_LOG (log_category, " could not get process during Activate()" );
446447 return ;
447448 }
448449
@@ -458,10 +459,10 @@ void InstrumentationRuntimeBoundsSafety::Activate() {
458459 if (!breakpoint)
459460 return ;
460461 if (!breakpoint->HasResolvedLocations ()) {
461- LLDB_LOGF (log_category,
462- " breakpoint %d for BoundsSafety soft traps did not resolve to "
463- " any locations" ,
464- breakpoint->GetID ());
462+ LLDB_LOG (log_category,
463+ " breakpoint {0} for BoundsSafety soft traps did not resolve to "
464+ " any locations" ,
465+ breakpoint->GetID ());
465466 assert (0 && " breakpoint has no resolved locations" );
466467 process_sp->GetTarget ().RemoveBreakpointByID (breakpoint->GetID ());
467468 return ;
@@ -474,8 +475,8 @@ void InstrumentationRuntimeBoundsSafety::Activate() {
474475 /* sync=*/ false );
475476 breakpoint->SetBreakpointKind (" bounds-safety-soft-trap" );
476477 SetBreakpointID (breakpoint->GetID ());
477- LLDB_LOGF (log_category, " created breakpoint %d for BoundsSafety soft traps" ,
478- breakpoint->GetID ());
478+ LLDB_LOG (log_category, " created breakpoint {0} for BoundsSafety soft traps" ,
479+ breakpoint->GetID ());
479480 SetActive (true );
480481}
481482
@@ -485,11 +486,11 @@ void InstrumentationRuntimeBoundsSafety::Deactivate() {
485486 if (ProcessSP process_sp = GetProcessSP ()) {
486487 bool success =
487488 process_sp->GetTarget ().RemoveBreakpointByID (GetBreakpointID ());
488- LLDB_LOGF (log_category,
489- " %sremoved breakpoint %llu for BoundsSafety soft traps" ,
490- success ? " " : " failed to " , GetBreakpointID ());
489+ LLDB_LOG (log_category,
490+ " {0}removed breakpoint {1} for BoundsSafety soft traps" ,
491+ success ? " " : " failed to " , GetBreakpointID ());
491492 } else {
492- LLDB_LOGF (log_category, " no process available during Deactivate()" );
493+ LLDB_LOG (log_category, " no process available during Deactivate()" );
493494 }
494495
495496 SetBreakpointID (LLDB_INVALID_BREAK_ID);
0 commit comments