[llvm] [llvm] Win x64 Unwind V2 2/n: Support dumping UOP_Epilog (PR #110338)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 14 16:14:47 PDT 2024
================
@@ -0,0 +1,175 @@
+# RUN: yaml2obj %s -o %t.exe
+# RUN: llvm-objdump --unwind-info %t.exe | FileCheck %s
+
+# CHECK-LABEL: Unwind info:
+# CHECK-EMPTY:
+# CHECK-NEXT: Function Table:
+# CHECK-NEXT: Start Address: 0x1010
+# CHECK-NEXT: End Address: 0x1017
+# CHECK-NEXT: Unwind Info Address: 0x2000
+# CHECK-NEXT: Version: 2
+# CHECK-NEXT: Flags: 0
+# CHECK-NEXT: Size of prolog: 4
+# CHECK-NEXT: Number of Codes: 3
+# CHECK-NEXT: No frame pointer used
+# CHECK-NEXT: Unwind Codes:
+# CHECK-NEXT: 0x01: UOP_Epilog atend=yes, length=0x1
+# CHECK-NEXT: 0x0b: UOP_Epilog offset=0xB
+# CHECK-NEXT: 0x04: UOP_AllocSmall 72
+# CHECK-EMPTY:
+# CHECK-NEXT: Function Table:
+# CHECK-NEXT: Start Address: 0x1020
+# CHECK-NEXT: End Address: 0x105c
+# CHECK-NEXT: Unwind Info Address: 0x200c
+# CHECK-NEXT: Version: 1
+# CHECK-NEXT: Flags: 3 UNW_ExceptionHandler UNW_TerminateHandler
+# CHECK-NEXT: Size of prolog: 4
+# CHECK-NEXT: Number of Codes: 1
+# CHECK-NEXT: No frame pointer used
+# CHECK-NEXT: Unwind Codes:
+# CHECK-NEXT: 0x04: UOP_AllocSmall 56
+
+--- !COFF
+OptionalHeader:
+ AddressOfEntryPoint: 4128
+ ImageBase: 5368709120
+ SectionAlignment: 4096
+ FileAlignment: 512
+ MajorOperatingSystemVersion: 6
+ MinorOperatingSystemVersion: 0
+ MajorImageVersion: 0
+ MinorImageVersion: 0
+ MajorSubsystemVersion: 6
+ MinorSubsystemVersion: 0
+ Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
+ DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
+ SizeOfStackReserve: 1048576
+ SizeOfStackCommit: 4096
+ SizeOfHeapReserve: 1048576
+ SizeOfHeapCommit: 4096
+ ExportTable:
+ RelativeVirtualAddress: 0
+ Size: 0
+ ImportTable:
+ RelativeVirtualAddress: 0
+ Size: 0
+ ResourceTable:
+ RelativeVirtualAddress: 0
+ Size: 0
+ ExceptionTable:
+ RelativeVirtualAddress: 12288
+ Size: 24
+ CertificateTable:
+ RelativeVirtualAddress: 0
+ Size: 0
+ BaseRelocationTable:
+ RelativeVirtualAddress: 0
+ Size: 0
+ Debug:
+ RelativeVirtualAddress: 0
+ Size: 0
+ Architecture:
+ RelativeVirtualAddress: 0
+ Size: 0
+ GlobalPtr:
+ RelativeVirtualAddress: 0
+ Size: 0
+ TlsTable:
+ RelativeVirtualAddress: 0
+ Size: 0
+ LoadConfigTable:
+ RelativeVirtualAddress: 0
+ Size: 0
+ BoundImport:
+ RelativeVirtualAddress: 0
+ Size: 0
+ IAT:
+ RelativeVirtualAddress: 0
+ Size: 0
+ DelayImportDescriptor:
+ RelativeVirtualAddress: 0
+ Size: 0
+ ClrRuntimeHeader:
+ RelativeVirtualAddress: 0
+ Size: 0
+header:
+ Machine: IMAGE_FILE_MACHINE_AMD64
+ Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
+sections:
+ - Name: .text
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ VirtualAddress: 4096
+ VirtualSize: 113
+ SectionData: C3662E0F1F8400000000000F1F4400005048890C2458C3660F1F8400000000004883EC38E8D7FFFFFFE900000000488D4C2430E8D8FFFFFF904883C438C3488944242889542424488D4C2430E8BFFFFFFF488B4C2428E805000000CC0F1F4000C3662E0F1F8400000000000F1F440000C3
----------------
efriedma-quic wrote:
If the test doesn't actually parse the contents of the text section, please zero it out. (We don't want difficult-to-audit bits of binary data in the regression tests where we can avoid it.)
https://github.com/llvm/llvm-project/pull/110338
More information about the llvm-commits
mailing list