binutils-gdb/gdb/testsuite/gdb.ada/ghost.exp
Tom de Vries 84860e8591 [gdb/testsuite] Fix timeout in gdb.ada/ghost.exp
On openSUSE Tumbleweed with gcc-12, I run into a timeout:
...
(gdb) print value^M
Multiple matches for value^M
[0] cancel^M
[1] ada.strings.maps.value (<ref> ada.strings.maps.character_mapping; \
    character) return character at a-strmap.adb:599^M
[2] pck.value at src/gdb/testsuite/gdb.ada/ghost/pck.ads:17^M
[3] system.object_reader.value (<ref> system.object_reader.object_symbol) \
    return system.object_reader.uint64 at s-objrea.adb:2279^M
[4] system.traceback.symbolic.value (system.address) return string at \
    s-trasym.adb:200^M
> FAIL: gdb.ada/ghost.exp: print value (timeout)
print ghost_value^M
Argument must be choice number^M
(gdb) FAIL: gdb.ada/ghost.exp: print ghost_value
...

Fix this by prefixing value (as well as the other printed values) with the
package name:
...
(gdb) print pck.value^M
...

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29055
2022-06-10 08:46:17 +02:00

38 lines
1.2 KiB
Plaintext

# Copyright 2022 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 main
set flags [list debug additional_flags=-gnata]
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != "" } {
return -1
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/main.adb]
if ![runto "main.adb:$bp_location" ] then {
perror "Couldn't run ${testfile}"
return
}
gdb_test "print pck.value" " = 64 '@'"
gdb_test "print pck.ghost_value" " = 64 '@'"
gdb_test "print gpck.value2" " = 33 '!'"