1 # Copyright 2020 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # Set up the DWARF for the test.
18 set main_str_label [Dwarf::_compute_label info_string3]
19 set int_str_label [Dwarf::_compute_label info_string4]
20 set main_die_label [Dwarf::_compute_label main_die_label]
21 set int_die_label [Dwarf::_compute_label int_die_label]
32 " .4byte .Ldebug_names_end - .Ldebug_names_start" \
33 ".Ldebug_names_start:" \
34 " .short 5 # Header: version" \
35 " .short 0 # Header: padding" \
36 " .long 1 # Header: compilation unit count" \
37 " .long 0 # Header: local type unit count" \
38 " .long 0 # Header: foreign type unit count" \
39 " .long 2 # Header: bucket count" \
40 " .long 2 # Header: name count" \
41 " .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 " \
42 " # Header: abbreviation table size" \
43 " .long 8 # Header: augmentation string size" \
44 " .ascii \"LLVM0700\" # Header: augmentation string" \
45 " .long .Lcu1_begin # Compilation unit 0" \
46 " .long 1 # Bucket 0" \
47 " .long 0 # Bucket 1" \
48 " .long 193495088 # Hash in Bucket 0" \
49 " .long 2090499946 # Hash in Bucket 0" \
50 " .long $int_str_label # String in Bucket 0: int" \
51 " .long $main_str_label # String in Bucket 0: main" \
52 " .long .Lnames1-.Lnames_entries0 # Offset in Bucket 0" \
53 " .long .Lnames0-.Lnames_entries0 # Offset in Bucket 0" \
54 ".Lnames_abbrev_start0:" \
55 " .byte 46 # Abbrev code" \
56 " .byte 46 # DW_TAG_subprogram" \
57 " .byte 3 # DW_IDX_die_offset" \
58 " .byte 19 # DW_FORM_ref4" \
59 " .byte 0 # End of abbrev" \
60 " .byte 0 # End of abbrev" \
61 " .byte 36 # Abbrev code" \
62 " .byte 36 # DW_TAG_base_type" \
63 " .byte 3 # DW_IDX_die_offset" \
64 " .byte 19 # DW_FORM_ref4" \
65 " .byte 0 # End of abbrev" \
66 " .byte 0 # End of abbrev" \
67 " .byte 0 # End of abbrev list" \
68 ".Lnames_abbrev_end0:" \
71 " .byte 36 # Abbreviation code" \
72 " .long $int_die_label - .Lcu1_begin # DW_IDX_die_offset" \
73 " .long 0 # End of list: int" \
75 " .byte 46 # Abbreviation code" \
76 " .long $main_die_label - .Lcu1_begin # DW_IDX_die_offset" \
77 " .long 0 # End of list: main" \
81 Dwarf::assemble $asm_file {
82 global srcdir subdir srcfile
83 global main_start main_length
87 {DW_AT_language @DW_LANG_C}
88 {DW_AT_name clang-debug-names.c}
95 define_label $int_die_label
98 {encoding @DW_ATE_signed}
99 {byte_size 4 DW_FORM_sdata}
102 define_label $main_die_label
105 {type :$int_die_label}
106 {low_pc $main_start addr}
107 {high_pc "$main_start + $main_length" addr}
112 _defer_output .debug_str {
114 _emit [join $debug_str "\n"]
117 _defer_output .debug_names {
119 _emit [join $debug_names "\n"]