binutils-gdb/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp
Tom de Vries 2f985dd1ac [gdb/testsuite] Fix gdb.ada/out_of_line_in_inlined.exp with -m32 and gcc-10
When running test-case gdb.ada/out_of_line_in_inlined.exp with target board
unix/-m32 on a system with gcc-10 default compiler, we run into:
...
(gdb) break foo_o224_021.child1.child2^M
Breakpoint 1 at 0x804ba59: foo_o224_021.child1.child2. (3 locations)^M
(gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: \
  break foo_o224_021.child1.child2
...

The test does not expect the "3 locations" part.

Fix this by using gdb_breakpoint instead of gdb_test.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-01-28  Tom de Vries  <tdevries@suse.de>

	* gdb.ada/out_of_line_in_inlined.exp: Use gdb_breakpoint.
2021-01-28 08:14:58 +01:00

45 lines
1.4 KiB
Plaintext

# Copyright 2015-2021 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
standard_ada_testfile foo_o224_021
foreach_with_prefix scenario {all minimal} {
set flags [list debug \
optimize=-O2 \
additional_flags=-fgnat-encodings=$scenario]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} {
return -1
}
clean_restart ${testfile}
gdb_breakpoint "foo_o224_021.child1.child2"
gdb_run_cmd
gdb_test "" \
"Breakpoint $decimal, foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*"
set opt_addr_in "($hex in)?"
gdb_test "bt" \
[multi_line "#0 +$opt_addr_in +foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \
"#1 +$opt_addr_in +foo_o224_021\\.child1 \\(\\).*" \
"#2 +$opt_addr_in +foo_o224_021 \\(\\).*" ]
}