[Lldb-commits] [lldb] 5839976 - [nfc][trace] use formatv instead of the old Printf

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 29 19:05:12 PDT 2021


Author: Walter Erquinigo
Date: 2021-07-29T19:04:59-07:00
New Revision: 5839976976bc018b674f45f56f8a13707b870443

URL: https://github.com/llvm/llvm-project/commit/5839976976bc018b674f45f56f8a13707b870443
DIFF: https://github.com/llvm/llvm-project/commit/5839976976bc018b674f45f56f8a13707b870443.diff

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

It was suggested in https://reviews.llvm.org/D105741 and it makes sense.

Added: 
    

Modified: 
    lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp b/lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
index 873eda687dd8..9e994ea829e9 100644
--- a/lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
+++ b/lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
@@ -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));


        


More information about the lldb-commits mailing list