diff --git a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp index 24c0ca2111f40..f0996eb3ff0f4 100644 --- a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp +++ b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp @@ -87,8 +87,10 @@ Error AttachRequestHandler::Run(const AttachRequestArguments &args) const { // Use the unique target ID to get the target. target = dap.debugger.FindTargetByGloballyUniqueID(*target_id); if (!target.IsValid()) { - error.SetErrorStringWithFormat("invalid target_id %lu in attach config", - *target_id); + error.SetErrorString( + llvm::formatv("invalid target_id {0} in attach config", *target_id) + .str() + .c_str()); } } else { target = dap.CreateTarget(error);