From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Make gdb.ada/ptype_tagged_param.exp pass
Date: Thu, 19 Jan 2023 09:31:50 -0700 [thread overview]
Message-ID: <20230119163150.492922-1-tromey@adacore.com> (raw)
gdb.ada/ptype_tagged_param.exp is failing for me on x86-64 Fedora 36.
However, it's actually generating the correct output -- it is just
that the test thinks that the "ptype" will not work because I do not
have the GNAT debuginfo installed.
This patch changes the code to accept either result, and then to issue
a kfail as appropriate.
---
gdb/testsuite/gdb.ada/ptype_tagged_param.exp | 42 +++++++++++---------
1 file changed, 23 insertions(+), 19 deletions(-)
diff --git a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
index 0050d60a0f2..eaf61ddde79 100644
--- a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
+++ b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
@@ -31,23 +31,27 @@ if {![runto "pck.adb:20"]} {
return -1
}
-# Identifying the runtime type of S can only be done when we have the debug
-# info for the GNAT runtime.
-
-if { $has_runtime_debug_info } {
- gdb_test "ptype s" \
- [multi_line \
- "type = <ref> new pck.shape with record" \
- " r: integer;" \
- "end record"] \
- "ptype s, with debug info"
-} else {
- gdb_test "ptype s" \
- [multi_line \
- "type = <ref> tagged record" \
- " x: integer;" \
- " y: integer;" \
- "end record" ] \
- "ptype s, without debug info"
+# With some versions of the compiler, identifying the runtime type of
+# S can only be done when we have the debug info for the GNAT runtime.
+set ordinary [multi_line \
+ "type = <ref> new pck.shape with record" \
+ " r: integer;" \
+ "end record"]
+set nodebug [multi_line \
+ "type = <ref> tagged record" \
+ " x: integer;" \
+ " y: integer;" \
+ "end record"]
+
+gdb_test_multiple "ptype s" "ptype s" {
+ -re -wrap $ordinary {
+ pass $gdb_test_name
+ }
+ -re -wrap $nodebug {
+ if {$has_runtime_debug_info} {
+ kfail "no debug info" $gdb_test_name
+ } else {
+ fail $gdb_test_name
+ }
+ }
}
-
--
2.38.1
next reply other threads:[~2023-01-19 16:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-19 16:31 Tom Tromey [this message]
2023-01-20 17:00 ` Simon Marchi
2023-01-20 17:05 ` Tom Tromey
2023-01-27 5:58 ` Simon Marchi
2023-01-27 14:11 ` Tom Tromey
2023-01-27 15:56 ` Simon Marchi
2023-01-27 17:24 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230119163150.492922-1-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).