public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Add KFAIL for PR ada/30908
@ 2023-10-01 13:25 Tom de Vries
  2023-10-02 15:52 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2023-10-01 13:25 UTC (permalink / raw)
  To: gdb-patches

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).

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30908
---
 gdb/testsuite/gdb.ada/str_binop_equal.exp | 20 ++++++++++++++--
 gdb/testsuite/gdb.ada/widewide.exp        | 28 +++++++++++++++++++++--
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/str_binop_equal.exp b/gdb/testsuite/gdb.ada/str_binop_equal.exp
index f3c8a348d82..38b04f6a958 100644
--- a/gdb/testsuite/gdb.ada/str_binop_equal.exp
+++ b/gdb/testsuite/gdb.ada/str_binop_equal.exp
@@ -31,8 +31,24 @@ runto "foo_p211_061.adb:$bp_location"
 gdb_test "print my_str = my_str" \
          " = true"
 
-gdb_test "print my_str = \"ABCD\"" \
-         " = true"
+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_str = "ABCD"} "" {
+    -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_str = \"EFGH\"" \
          " = false"
diff --git a/gdb/testsuite/gdb.ada/widewide.exp b/gdb/testsuite/gdb.ada/widewide.exp
index 5c5b5a34dc3..c02d7f398f5 100644
--- a/gdb/testsuite/gdb.ada/widewide.exp
+++ b/gdb/testsuite/gdb.ada/widewide.exp
@@ -42,9 +42,33 @@ gdb_test "print my_wws(1)" "= 32 ' '"
 
 gdb_test "print my_wws(2)" "= 104 'h'"
 
-gdb_test "print my_wws = \" helo\"" " = true"
+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 = \"wide\"" " = true"
 gdb_test "print my_ws = \"nope\"" " = false"
 
 gdb_test "print \"x\" & my_ws & \"y\"" " = \"xwidey\""

base-commit: 1371b803685eebf02db4fe81ac7f4a6606c5d5b4
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [gdb/testsuite] Add KFAIL for PR ada/30908
  2023-10-01 13:25 [PATCH] [gdb/testsuite] Add KFAIL for PR ada/30908 Tom de Vries
@ 2023-10-02 15:52 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-10-02 15:52 UTC (permalink / raw)
  To: Tom de Vries via Gdb-patches; +Cc: Tom de Vries

>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

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

Tom> Add KFAILs for the PR.

Thanks for doing this.
Approved-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-02 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-01 13:25 [PATCH] [gdb/testsuite] Add KFAIL for PR ada/30908 Tom de Vries
2023-10-02 15:52 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).