Skip to content

Conversation

@npmiller
Copy link
Contributor

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.

@llvmbot
Copy link
Member

llvmbot commented Nov 28, 2025

@llvm/pr-subscribers-lldb

Author: Nicolas Miller (npmiller)

Changes

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 --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);

modularbot pushed a commit to modular/modular that referenced this pull request Nov 29, 2025
…2934)

* Update stubs
* Use upstream LLVM zlib and zstd bazel config
* Update `//max/tests/tests/graph:ops/test_reshape` expected error text,
see:
llvm/llvm-project@012721d
* Update `matmul_sm100_4096x4096x4096.ptx` test data: bisected to
llvm/llvm-project@ebf5d9e
* Revert llvm/llvm-project#169038, see
llvm/llvm-project#169552
* Patch to fix macOS build, see:
llvm/llvm-project#169933
MODULAR_ORIG_COMMIT_REV_ID: 21985d6f60bc4c98c9442d9a83d476e12c9609b9
npmiller and others added 2 commits December 2, 2025 09:59
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.
@npmiller npmiller force-pushed the npmiller/fix-macos-lldb branch from 118171f to a2a4077 Compare December 2, 2025 09:59
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp -- lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
index 55e41c16d..f0996eb3f 100644
--- a/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
@@ -87,7 +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.SetErrorString(llvm::formatv("invalid target_id {0} in attach config", *target_id).str().c_str());
+      error.SetErrorString(
+          llvm::formatv("invalid target_id {0} in attach config", *target_id)
+              .str()
+              .c_str());
     }
   } else {
     target = dap.CreateTarget(error);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants