[compiler-rt] [compiler-rt] Fix GH-112254 DumpAllRegs for win arm64. (PR #112305)

David CARLIER via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 20:58:02 PDT 2024


https://github.com/devnexen created https://github.com/llvm/llvm-project/pull/112305

None

>From efd6c7008a4c906566474303edb34e21329426e5 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen at gmail.com>
Date: Tue, 15 Oct 2024 04:56:49 +0100
Subject: [PATCH] [compiler-rt] Fix GH-112254 DumpAllRegs for win arm64.

---
 .../lib/sanitizer_common/sanitizer_win.cpp    | 38 +++----------------
 1 file changed, 5 insertions(+), 33 deletions(-)

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
index 838b14d3cc559d..5081f1a4b9f7ac 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
@@ -1070,39 +1070,11 @@ void SignalContext::DumpAllRegisters(void *context) {
   Printf("\n");
 #  elif defined(_M_ARM64)
   Report("Register values:\n");
-  Printf("x0  = %llx  ", ctx->X0);
-  Printf("x1  = %llx  ", ctx->X1);
-  Printf("x2  = %llx  ", ctx->X2);
-  Printf("x3  = %llx  ", ctx->X3);
-  Printf("x4  = %llx  ", ctx->X4);
-  Printf("x5  = %llx  ", ctx->X5);
-  Printf("x6  = %llx  ", ctx->X6);
-  Printf("x7  = %llx  ", ctx->X7);
-  Printf("x8  = %llx  ", ctx->X8);
-  Printf("x9  = %llx  ", ctx->X9);
-  Printf("x10 = %llx  ", ctx->X10);
-  Printf("x11 = %llx  ", ctx->X11);
-  Printf("x12 = %llx  ", ctx->X12);
-  Printf("x13 = %llx  ", ctx->X13);
-  Printf("x14 = %llx  ", ctx->X14);
-  Printf("x15 = %llx  ", ctx->X15);
-  Printf("x16 = %llx  ", ctx->X16);
-  Printf("x17 = %llx  ", ctx->X17);
-  Printf("x18 = %llx  ", ctx->X18);
-  Printf("x19 = %llx  ", ctx->X19);
-  Printf("x20 = %llx  ", ctx->X20);
-  Printf("x21 = %llx  ", ctx->X21);
-  Printf("x22 = %llx  ", ctx->X22);
-  Printf("x23 = %llx  ", ctx->X23);
-  Printf("x24 = %llx  ", ctx->X24);
-  Printf("x25 = %llx  ", ctx->X25);
-  Printf("x26 = %llx  ", ctx->X26);
-  Printf("x27 = %llx  ", ctx->X27);
-  Printf("x28 = %llx  ", ctx->X28);
-  Printf("x29 = %llx  ", ctx->X29);
-  Printf("x30 = %llx  ", ctx->X30);
-  Printf("x31 = %llx  ", ctx->X31);
-  Printf("\n");
+  for (int i = 0; i <= 31; i ++) {
+    Printf("x%d%s = %llx", i < 10 ? " " : "", ctx->X[i]);
+    if (i % 4 == 3)
+      Printf("\n");
+  }
 #  else
   // TODO
   (void)ctx;



More information about the llvm-commits mailing list