File: gen-dwarf64.s

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (105 lines) | stat: -rw-r--r-- 4,931 bytes parent folder | download | duplicates (21)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
## This checks that llvm-mc is able to produce 64-bit debug info.

# RUN: llvm-mc -g -dwarf-version 3 -dwarf64 -triple x86_64 %s -filetype=obj -o %t3.o
# RUN: llvm-readobj -r %t3.o | FileCheck --check-prefixes=REL,REL3 %s --implicit-check-not="R_{{.*}} .debug_"
# RUN: llvm-dwarfdump -v %t3.o | FileCheck --check-prefixes=DUMP,DUMP3 %s

# RUN: llvm-mc -g -dwarf-version 5 -dwarf64 -triple x86_64 %s -filetype=obj -o %t5.o
# RUN: llvm-readobj -r %t5.o | FileCheck --check-prefixes=REL,REL5 %s --implicit-check-not="R_{{.*}} .debug_"
# RUN: llvm-dwarfdump -v %t5.o | FileCheck --check-prefixes=DUMP,DUMP5 %s

## The references to other debug info sections are 64-bit, as required for DWARF64.
# REL:         Section ({{[0-9]+}}) .rela.debug_frame {
# REL-NEXT:      R_X86_64_64 .debug_frame 0x0
# REL:         Section ({{[0-9]+}}) .rela.debug_info {
# REL-NEXT:      R_X86_64_64 .debug_abbrev 0x0
# REL-NEXT:      R_X86_64_64 .debug_line 0x0
# REL3-NEXT:     R_X86_64_64 .debug_ranges 0x0
# REL5-NEXT:     R_X86_64_64 .debug_rnglists 0x14
# REL:         Section ({{[0-9]+}}) .rela.debug_aranges {
# REL-NEXT:      R_X86_64_64 .debug_info 0x0
# REL5:        Section ({{[0-9]+}}) .rela.debug_line {
# REL5-NEXT:     R_X86_64_64 .debug_line_str 0x0
# REL5-NEXT:     R_X86_64_64 .debug_line_str 0x

## DW_FORM_sec_offset was introduced in DWARFv4.
## For DWARFv3, DW_FORM_data8 is used instead.
# DUMP:       .debug_abbrev contents:
# DUMP3:        DW_AT_stmt_list DW_FORM_data8
# DUMP3-NEXT:   DW_AT_ranges    DW_FORM_data8
# DUMP5:        DW_AT_stmt_list DW_FORM_sec_offset
# DUMP5-NEXT:   DW_AT_ranges    DW_FORM_sec_offset

# DUMP:       .debug_info contents:
# DUMP-NEXT:  0x00000000: Compile Unit: {{.*}} format = DWARF64
# DUMP:       DW_TAG_compile_unit [1] *
# DUMP3-NEXT:   DW_AT_stmt_list [DW_FORM_data8] (0x0000000000000000)
# DUMP5-NEXT:   DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000000000000000)
# DUMP3-NEXT:   DW_AT_ranges [DW_FORM_data8] (0x0000000000000000
# DUMP5-NEXT:   DW_AT_ranges [DW_FORM_sec_offset] (0x0000000000000014
# DUMP-NEXT:      [0x0000000000000000, 0x0000000000000001) ".foo"
# DUMP-NEXT:      [0x0000000000000000, 0x0000000000000001) ".bar")
# DUMP:       DW_TAG_label [2]
# DUMP-NEXT:    DW_AT_name [DW_FORM_string] ("foo")
# DUMP:       DW_TAG_label [2]
# DUMP-NEXT:    DW_AT_name [DW_FORM_string] ("bar")

# DUMP:       .debug_frame contents:
# DUMP:       00000000 {{([[:xdigit:]]{16})}} ffffffffffffffff CIE
# DUMP-NEXT:    Format: DWARF64
# DUMP:       {{([[:xdigit:]]{8})}} {{([[:xdigit:]]{16})}} 0000000000000000 FDE cie=00000000 pc=00000000...00000001
# DUMP-NEXT:    Format: DWARF64

## Even though the debug info sections are in the 64-bit format,
## .eh_frame is still generated as 32-bit.
# DUMP:       .eh_frame contents:
# DUMP:       00000000 {{([[:xdigit:]]{8})}} 00000000 CIE
# DUMP-NEXT:    Format: DWARF32
# DUMP:       {{([[:xdigit:]]{8})}} {{([[:xdigit:]]{8})}} {{([[:xdigit:]]{8})}} FDE cie=00000000 pc=00000000...00000001
# DUMP-NEXT:    Format: DWARF32

# DUMP:       .debug_aranges contents:
# DUMP-NEXT:  Address Range Header: length = 0x0000000000000044, format = DWARF64, version = 0x0002, cu_offset = 0x0000000000000000, addr_size = 0x08, seg_size = 0x00
# DUMP-NEXT:  [0x0000000000000000,  0x0000000000000001)
# DUMP-NEXT:  [0x0000000000000000,  0x0000000000000001)
# DUMP-EMPTY:

# DUMP:       .debug_line contents:
# DUMP-NEXT:  debug_line[0x00000000]
# DUMP-NEXT:  Line table prologue:
# DUMP-NEXT:      total_length:
# DUMP-NEXT:            format: DWARF64
# DUMP5:      include_directories[  0] = .debug_line_str[0x0000000000000000] = "[[DIR:.+]]"
# DUMP5-NEXT: file_names[  0]:
# DUMP5-NEXT:            name: .debug_line_str[0x00000000[[FILEOFF:[[:xdigit:]]{8}]]] = "[[FILE:.+]]"
# DUMP5-NEXT:       dir_index: 0

# DUMP5:      .debug_line_str contents:
# DUMP5-NEXT: 0x00000000: "[[DIR]]"
# DUMP5-NEXT: 0x[[FILEOFF]]: "[[FILE]]"

# DUMP3:      .debug_ranges contents:
# DUMP3-NEXT: 00000000 ffffffffffffffff 0000000000000000
# DUMP3-NEXT: 00000000 0000000000000000 0000000000000001
# DUMP3-NEXT: 00000000 ffffffffffffffff 0000000000000000
# DUMP3-NEXT: 00000000 0000000000000000 0000000000000001
# DUMP3-NEXT: 00000000 <End of list>

# DUMP5:      .debug_rnglists contents:
# DUMP5-NEXT: 0x00000000: range list header: length = 0x000000000000001d, format = DWARF64, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
# DUMP5-NEXT: ranges:
# DUMP5-NEXT: 0x00000014: [DW_RLE_start_length]: 0x0000000000000000, 0x0000000000000001 => [0x0000000000000000, 0x0000000000000001)
# DUMP5-NEXT: 0x0000001e: [DW_RLE_start_length]: 0x0000000000000000, 0x0000000000000001 => [0x0000000000000000, 0x0000000000000001)
# DUMP5-NEXT: 0x00000028: [DW_RLE_end_of_list ]

    .cfi_sections .eh_frame, .debug_frame

    .section .foo, "ax", @progbits
foo:
    nop

    .section .bar, "ax", @progbits
bar:
    .cfi_startproc
    nop
    .cfi_endproc