Files
binutils-gdb/gdb/testsuite/gdb.ada/widewide.exp
Tom de Vries 89238cfdba [gdb/testsuite] Add KFAIL for PR ada/30908
With gcc 13.2.1, I run into a cluster of fails:
...
FAIL: gdb.ada/str_binop_equal.exp: print my_str = "ABCD"
FAIL: gdb.ada/widewide.exp: print my_wws = " helo"
FAIL: gdb.ada/widewide.exp: print my_ws = "wide"
...

The problem is that the debug info contains information about function
ada.strings.maps."=", and gdb uses it to implement the comparison.
The function is supposed to compare two char sets, not strings, so gdb
shouldn't use it.  This is PR ada/30908.

I don't see the same problem with gcc 7.5.0, because the exec doesn't contain
the debug info for the function, because the corresponding object is not
linked in.  Adter adding "with Ada.Strings.Maps; use Ada.Strings.Maps;" to
gdb.ada/widewide/foo.adb I run into the same problem with gcc 7.5.0.

Add KFAILs for the PR.

Tested on x86_64-linux:
- openSUSE Leap 15.4 (using gcc 7.5.0), and
- openSUSE Tumbleweed (using gcc 13.2.1).

Approved-By: Tom Tromey <tom@tromey.com>

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30908
2023-10-02 19:48:21 +02:00

88 lines
2.3 KiB
Plaintext

# Copyright 2011-2023 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"
require allow_ada_tests
standard_ada_testfile foo
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
return -1
}
clean_restart ${testfile}
set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
if {![runto "foo.adb:$bp_location"]} {
return
}
gdb_test "print some_easy" "= 74 'J'"
gdb_test "print some_larger" "= 48879 '\\\[\"00beef\"\\\]'"
gdb_test "print some_big" "= 14335727 '\\\[\"dabeef\"\\\]'"
gdb_test "print my_wws" "= \" helo\""
gdb_test "print my_wws(1)" "= 32 ' '"
gdb_test "print my_wws(2)" "= 104 'h'"
set kfail_re \
[multi_line \
[string_to_regexp {Symbol: ada.strings.maps."="}] \
".*" \
"\\$$decimal = false"]
gdb_test_no_output "set debug expr 1"
gdb_test_multiple {print my_wws = " helo"} "" {
-re -wrap " = true" {
pass $gdb_test_name
}
-re -wrap $kfail_re {
kfail ada/30908 $gdb_test_name
}
}
gdb_test_multiple {print my_ws = "wide"} "" {
-re -wrap " = true" {
pass $gdb_test_name
}
-re -wrap $kfail_re {
kfail ada/30908 $gdb_test_name
}
}
gdb_test "set debug expr 0"
gdb_test "print my_ws = \"nope\"" " = false"
gdb_test "print \"x\" & my_ws & \"y\"" " = \"xwidey\""
gdb_test "print my_wws(1..3) := \"abc\"" " = \"abc\""
gdb_test "print my_wws" " = \"abclo\"" \
"print my_wws after slice assignment"
gdb_test "print my_wws(1..3) := my_wws(2..4)" " = \"bcl\""
gdb_test "print my_wws" " = \"bcllo\"" \
"print my_wws after overlapping slice assignment"
gdb_test "print 'x' & my_ws" " = \"xwide\""
gdb_test "print my_ws & 'y'" " = \"widey\""
gdb_test "ptype wide_wide_string'(\"wws\")" \
"array \\(1 \\.\\. 3\\) of wide_wide_character"