[PATCH] D86523: [1/5] [llvm-readobj] Fix arm64 unwind opcode disassembly printing

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 23:38:44 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGdb259fe38b89: [llvm-readobj] Fix arm64 unwind opcode disassembly printing (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86523/new/

https://reviews.llvm.org/D86523

Files:
  llvm/test/CodeGen/AArch64/wineh5.mir
  llvm/test/tools/llvm-readobj/COFF/arm64-unwind-opcodes.s
  llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp


Index: llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
===================================================================
--- llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
+++ llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
@@ -637,7 +637,7 @@
   Reg += 19;
   uint32_t Off = ((OC[Offset + 1] & 0x1F) + 1) << 3;
   if (Prologue)
-    SW.startLine() << format("0x%02x%02x              ; str x%u, [sp, #%u]!\n",
+    SW.startLine() << format("0x%02x%02x              ; str x%u, [sp, #-%u]!\n",
                              OC[Offset], OC[Offset + 1], Reg, Off);
   else
     SW.startLine() << format("0x%02x%02x              ; ldr x%u, [sp], #%u\n",
@@ -703,7 +703,7 @@
   Reg >>= 6;
   Reg += 8;
   uint32_t Off = (OC[Offset + 1] & 0x3F) << 3;
-  SW.startLine() << format("0x%02x%02x                ; %s d%u, [sp, #%u]\n",
+  SW.startLine() << format("0x%02x%02x              ; %s d%u, [sp, #%u]\n",
                            OC[Offset], OC[Offset + 1],
                            static_cast<const char *>(Prologue ? "str" : "ldr"),
                            Reg, Off);
Index: llvm/test/tools/llvm-readobj/COFF/arm64-unwind-opcodes.s
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-readobj/COFF/arm64-unwind-opcodes.s
@@ -0,0 +1,24 @@
+// REQUIRES: aarch64-registered-target
+// RUN: llvm-mc -filetype=obj -triple aarch64-windows %s -o - \
+// RUN:   | llvm-readobj --unwind - | FileCheck %s
+
+// CHECK:          Prologue [
+// CHECK-NEXT:        0xdc01              ; str d8, [sp, #8]
+// CHECK-NEXT:        0xd400              ; str x19, [sp, #-8]!
+// CHECK-NEXT:        0xe4                ; end
+// CHECK-NEXT:     ]
+
+.section .pdata,"dr"
+        .long func at IMGREL
+        .long "$unwind$func"@IMGREL
+
+        .text
+        .globl  func
+func:
+        str x19, [sp, #-8]!
+        str d8,  [sp, #8]
+        ret
+
+.section .xdata,"dr"
+"$unwind$func":
+.long 0x10000002, 0x00d401dc, 0xe3e3e3e4
Index: llvm/test/CodeGen/AArch64/wineh5.mir
===================================================================
--- llvm/test/CodeGen/AArch64/wineh5.mir
+++ llvm/test/CodeGen/AArch64/wineh5.mir
@@ -15,7 +15,7 @@
 # CHECK-NEXT:       0xe3                ; nop
 # CHECK-NEXT:       0xe3                ; nop
 # CHECK-NEXT:       0x42                ; stp x29, x30, [sp, #16]
-# CHECK-NEXT:       0xd53f              ; str x28, [sp, #256]!
+# CHECK-NEXT:       0xd53f              ; str x28, [sp, #-256]!
 # CHECK-NEXT:       0xe4                ; end
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     EpilogueScopes [


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86523.287837.patch
Type: text/x-patch
Size: 2571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200826/70fcd590/attachment.bin>


More information about the llvm-commits mailing list