[Lldb-commits] [lldb] [lldb-dap] Fix format string on Mac OS (PR #169933)

via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 28 08:17:17 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Nicolas Miller (npmiller)

<details>
<summary>Changes</summary>

On Mac `unsigned long long` corresponds to `uint64_t` so `%llu` is needed.

Simply always using `%llu` and upcasting to `unsigned long long` should make it work fine.

---
Full diff: https://github.com/llvm/llvm-project/pull/169933.diff


1 Files Affected:

- (modified) lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp (+2-2) 


``````````diff
diff --git a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
index 24c0ca2111f40..3e7de5d055837 100644
--- a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
@@ -87,8 +87,8 @@ 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.SetErrorStringWithFormat("invalid target_id %llu in attach config",
+                                     (unsigned long long)*target_id);
     }
   } else {
     target = dap.CreateTarget(error);

``````````

</details>


https://github.com/llvm/llvm-project/pull/169933


More information about the lldb-commits mailing list