File: debug-entry-no-payload.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (56 lines) | stat: -rw-r--r-- 1,833 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## Check that llvm-objcopy does not produce an error for debug directory
## entries without a payload (e.g. IMAGE_DEBUG_TYPE_REPRO,
## IMAGE_DEBUG_TYPE_UNKNOWN) when patching entries that may have moved during
## a requested operation. Also check that the such debug entries are present
## in the output.

## The code to patch debug entries is executed even when no operation is
## requested. Hence the RUN line below invokes llvm-objcopy without any
## arguments.

# RUN: yaml2obj %s -o %t.in.exe
# RUN: llvm-objcopy %t.in.exe %t.out.exe
# RUN: llvm-readobj --coff-debug-directory %t.out.exe | FileCheck %s

# CHECK: Type: Repro (0x10)
# CHECK: Type: Unknown (0x0)

--- !COFF
OptionalHeader:
  AddressOfEntryPoint: 4096
  ImageBase:       1073741824
  SectionAlignment: 4096
  FileAlignment:   512
  MajorOperatingSystemVersion: 6
  MinorOperatingSystemVersion: 0
  MajorImageVersion: 0
  MinorImageVersion: 0
  MajorSubsystemVersion: 6
  MinorSubsystemVersion: 0
  Subsystem:       IMAGE_SUBSYSTEM_WINDOWS_CUI
  DLLCharacteristics: [  ]
  SizeOfStackReserve: 1048576
  SizeOfStackCommit: 4096
  SizeOfHeapReserve: 1048576
  SizeOfHeapCommit: 4096
  Debug:
    RelativeVirtualAddress: 8192
    Size:            56
header:
  Machine:         IMAGE_FILE_MACHINE_AMD64
  Characteristics: [  ]
sections:
  - Name:            .text
    Characteristics: [  ]
    VirtualAddress:  4096
    VirtualSize:     3
    SectionData:     31C0C3
  - Name:            .rdata
    Characteristics: [  ]
    VirtualAddress:  8192
    VirtualSize:     56
    ## '10' in SectionData below indicates the Repro type for the first debug
    ## entry.  The second entry has a type of Unknown ('00').
    SectionData:     0000000047F96B2000000000100000000000000000000000000000000000000047F96B200000000000000000000000000000000000000000
symbols:         []
...