[nfc][trace] use formatv instead of the old Printf

It was suggested in https://reviews.llvm.org/D105741 and it makes sense.
This commit is contained in:
Walter Erquinigo 2021-07-29 19:04:27 -07:00
parent f16a4fcbe5
commit 5839976976
1 changed files with 5 additions and 3 deletions

View File

@ -75,9 +75,11 @@ bool CommandObjectThreadTraceExportCTF::DoExecute(Args &command,
const uint32_t num_threads = process->GetThreadList().GetSize();
size_t tid = m_options.m_thread_index ? *m_options.m_thread_index
: LLDB_INVALID_THREAD_ID;
result.AppendErrorWithFormat(
"Thread index %" PRIu64 " is out of range (valid values are 0 - %u).\n", tid,
num_threads);
result.AppendError(
llvm::formatv(
"Thread index {0} is out of range (valid values are 1 - {1}).\n",
tid, num_threads)
.str());
return false;
} else {
TraceHTR htr(*thread, *trace_sp->GetCursor(*thread));