-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[lldb-dap] Fix format string on Mac OS #169933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@llvm/pr-subscribers-lldb Author: Nicolas Miller (npmiller) ChangesOn Mac Simply always using Full diff: https://github.com/llvm/llvm-project/pull/169933.diff 1 Files Affected:
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);
|
…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
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.
Co-authored-by: Jonas Devlieghere <[email protected]>
118171f to
a2a4077
Compare
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
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);
|
On Mac
unsigned long longcorresponds touint64_tso%lluis needed.Simply always using
%lluand upcasting tounsigned long longshould make it work fine.