File: relativenames.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 (108 lines) | stat: -rw-r--r-- 3,910 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
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
106
107
108
# REQUIRES: x86-registered-target

## Test that the relative names option to llvm-symbolizer works properly.
## See llvm/docs/CommandGuide/llvm-symbolizer.rst for commands
## that would produce this test case

# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o

# RUN: llvm-symbolizer 0 --relativenames --obj=%t.o \
# RUN:    | FileCheck %s -DDIR=%p --check-prefix=RELATIVENAMES

## A basic correctness check for default.
# RUN: llvm-symbolizer 0 --obj=%t.o \
# RUN:    | FileCheck %s -DDIR=%p --check-prefix=ABSOLUTENAMES

## Ensure last option wins.
# RUN: llvm-symbolizer 0 --basenames --relativenames --obj=%t.o \
# RUN:    | FileCheck %s -DDIR=%p --check-prefix=RELATIVENAMES
# RUN: llvm-symbolizer 0 --relativenames --basenames --obj=%t.o \
# RUN:    | FileCheck %s --check-prefix=BASENAMES

# ABSOLUTENAMES: {{\\|/}}tmp{{\\|/}}foo{{\\|/}}relativenames.s:4
# RELATIVENAMES: {{^}}foo{{\\|/}}relativenames.s:4
# BASENAMES: {{^}}relativenames.s:4

##  Provide just enough info in debug info for the symbolizer
##  to find the line table.
.section .debug_abbrev,"",@progbits
    .byte 0x01  ## Abbreviation Code
    .byte 0x11  ## DW_TAG_compile_unit
    .byte 0x01  ## DW_CHILDREN_yes
    .byte 0x10  ## DW_AT_stmt_list
    .byte 0x17  ## DW_FORM_sec_offset
    .byte 0x11  ## DW_AT_low_pc
    .byte 0x01  ## DW_FORM_addr
    .byte 0x12  ## DW_AT_high_pc
    .byte 0x01  ## DW_FORM_addr
    .byte 0x1b  ## DW_AT_comp_dir
    .byte 0x08  ## DW_FORM_string
    .byte 0x03  ## DW_AT_name
    .byte 0x08  ## DW_FORM_string
    .byte 0x00  ## EOM(1)
    .byte 0x00  ## EOM(2)
    .byte 0x02  ## Abbreviation Code
    .byte 0x2e  ## DW_TAG_subprogram
    .byte 0x0   ## DW_CHILDREN_no
    .byte 0x11  ## DW_AT_low_pc
    .byte 0x01  ## DW_FORM_addr
    .byte 0x12  ## DW_AT_high_pc
    .byte 0x01  ## DW_FORM_addr
    .byte 0x00  ## EOM(1)
    .byte 0x00  ## EOM(2)
    .byte 0x00  ## EOM(3)

.section .debug_info,"",@progbits
    .long   .Ldebug_info_end-.Ldebug_info_start ## length
.Ldebug_info_start:
    .short 0x05  ## version
    .byte  0x01  ## DW_TAG_compile_unit
    .byte  0x08  ## address size
    .long  .debug_abbrev   ## offset into abbrev section
    .byte  0x01  ## cu abbrev code
    .long  .debug_line  ## DW_AT_stmt_list
    .quad  0x00  ## DW_AT_low_pc
    .quad  0x01  ## DW_AT_high_pc
    .asciz "/tmp"  ## DW_AT_comp_dir
    .asciz "foo/relativenames.s" ## DW_AT_name
    .byte  0x02  ## subprog abbrev code
    .quad  0x00  ## DW_AT_low_pc
    .quad  0x01  ## DW_AT_high_pc
.Ldebug_info_end:


.section .debug_line,"",@progbits
    .long .Lunit_end - .Lunit_begin ## unit_length
.Lunit_begin:
    .short 0x05  ## version
    .byte  0x08  ## address_size
    .byte  0x00  ## segment_selector_size
    .long .Lheader_end - .Lheader_begin ## header_length
.Lheader_begin:
    .byte  0x01  ## minimum_instruction_length
    .byte  0x01  ## maximum_operations_per_instruction
    .byte  0x01  ## default_is_stmt
    .byte  0xfb  ## line_base
    .byte  0x0e  ## line_range
    .byte  0x0d  ## opcode_base and lengths
    .byte  0x00, 0x01, 0x01, 0x01, 0x01, 0x00
    .byte  0x00, 0x00, 0x01, 0x00, 0x00, 0x01
    .byte  0x01  ## directory entry format count
    .byte  0x01, 0x8 ## DW_LNCT_path, DW_FORM_string
    .byte  0x01  ## directories count
    .asciz "/tmp" ## directory entry 0
    .byte  0x02  ## file_name_entry_format_count
    .byte  0x02, 0x0B  ## DW_LNCT_directory_index, DW_FORM_data1
    .byte  0x01, 0x08  ## DW_LNCT_path, DW_FORM_string
    .byte  0x01  ## filname count
    .byte  0x00  ## directory index
    .asciz "foo/relativenames.s"
.Lheader_end:
    .byte 0x04, 0x00 ## set file to zero
    ## set address to 0x0
    .byte 0x00, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00
    .byte 0x00, 0x00, 0x00, 0x00
    .byte 0x15  ## Advance Address by 0 and line by 3
    .byte 0x02, 0x01  ## Advance PC by 1
    .byte 0x0, 0x1, 0x1  ## DW_LNE_end_sequence
.Lunit_end: