1 # Copyright
2019 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 # A test of multi
-language dictionaries
, a solution to symtab
/23010 et al.
20 # This test can only be run
on targets which support DWARF.
21 if {![dwarf2_support
]} {
25 standard_testfile main.c .S
27 # Create the DWARF. This is derived from the reproducer in the bug
28 # mentioned above. This DIE tree is typical of compilations wtih
31 set asm_file
[standard_output_file $srcfile2
]
32 Dwarf
::assemble $asm_file
{
33 declare_labels D45d9 D5079 D5080 D50a9 D50af D5ab2 D5ac2 D5ace D5acf
34 declare_labels D2135f D2216a D22171 D226c4 D226ca D244ca \
36 declare_labels D41c21 D42025 D42045 D42038 D42045 D420b5
40 {language @DW_LANG_C_plus_plus
}
41 {name "SerialPortUtils.cpp"}
45 {encoding @DW_ATE_unsigned
}
64 {linkage_name
"_Z18SerialSyncWriteStrPKc"}
66 D5ac2
: formal_parameter
{
70 D5ace
: lexical_block
{} {
71 D5acf
: DW_TAG_variable
{
81 D2135f
: compile_unit
{
82 {language @DW_LANG_C_plus_plus
}
87 {encoding @DW_ATE_unsigned_char
}
95 D226c4
: pointer_type
{
105 {name "PrintPanicMsg"}
107 D245e6
: formal_parameter
{
116 D41c21
: compile_unit
{
117 {language @DW_LANG_C99
}
118 {name "<artificial>"}
121 {abstract_origin
%$D245da
}
122 {low_pc
0x80b60 addr
}
125 D42038
: formal_parameter
{
126 {abstract_origin
%$D245e6
}
129 D42045
: inlined_subroutine
{
130 {abstract_origin
%$D5ab2
}
134 D420b5
: formal_parameter
{
135 {abstract_origin
%$D5ac2
}
143 # Build the test executable.
144 if {[build_executable $testfile.exp $testfile
[list $asm_file $srcfile
] {}] \
149 # We force the DIEs above to be read in via
"-readnow".
150 gdb_spawn_with_cmdline_opts
"-readnow"
153 # All we need to
do is check whether GDB is alive. Without
154 # multidictionaries
, it will either crash
, assert
, or throw an
156 gdb_test
"p 1" "= 1" "GDB is alive"