From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [pushed] Add another test for Ada Wide_Wide_String
Date: Thu, 17 Mar 2022 06:51:31 -0600 [thread overview]
Message-ID: <20220317125131.1654456-1-tromey@adacore.com> (raw)
In an earlier patch, I had written that I wanted to add this test:
ptype Wide_Wide_String'("literal")
... but that it failed with the distro GNAT. Further investigation
showed that it could be made to work by adding a function using
Wide_Wide_String to the program -- this caused the type to end up in
the debug info.
This patch adds the test. I'm checking this in.
---
gdb/testsuite/gdb.ada/widewide.exp | 3 +++
gdb/testsuite/gdb.ada/widewide/foo.adb | 3 ++-
gdb/testsuite/gdb.ada/widewide/pck.adb | 10 ++++++++++
gdb/testsuite/gdb.ada/widewide/pck.ads | 2 ++
4 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.ada/widewide.exp b/gdb/testsuite/gdb.ada/widewide.exp
index 2f14a0faee8..56c9e12abd2 100644
--- a/gdb/testsuite/gdb.ada/widewide.exp
+++ b/gdb/testsuite/gdb.ada/widewide.exp
@@ -59,3 +59,6 @@ gdb_test "print my_wws" " = \"bcllo\"" \
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"
diff --git a/gdb/testsuite/gdb.ada/widewide/foo.adb b/gdb/testsuite/gdb.ada/widewide/foo.adb
index d41734a485f..eda6ac54039 100644
--- a/gdb/testsuite/gdb.ada/widewide/foo.adb
+++ b/gdb/testsuite/gdb.ada/widewide/foo.adb
@@ -24,6 +24,7 @@ procedure Foo is
begin
Do_Nothing (Some_Easy'Address); -- START
Do_Nothing (Some_Larger'Address);
- Do_Nothing (My_Ws'Address);
+ Do_Nothing (My_Ws);
+ Do_Nothing (My_WWS);
Do_Nothing (Some_Big'Address);
end Foo;
diff --git a/gdb/testsuite/gdb.ada/widewide/pck.adb b/gdb/testsuite/gdb.ada/widewide/pck.adb
index 6b9023beb67..f5ec5607a56 100644
--- a/gdb/testsuite/gdb.ada/widewide/pck.adb
+++ b/gdb/testsuite/gdb.ada/widewide/pck.adb
@@ -20,4 +20,14 @@ package body Pck is
null;
end Do_Nothing;
+ procedure Do_Nothing (A : Wide_String) is
+ begin
+ null;
+ end Do_Nothing;
+
+ procedure Do_Nothing (A : Wide_Wide_String) is
+ begin
+ null;
+ end Do_Nothing;
+
end Pck;
diff --git a/gdb/testsuite/gdb.ada/widewide/pck.ads b/gdb/testsuite/gdb.ada/widewide/pck.ads
index e9316b09678..90c04f373f2 100644
--- a/gdb/testsuite/gdb.ada/widewide/pck.ads
+++ b/gdb/testsuite/gdb.ada/widewide/pck.ads
@@ -18,5 +18,7 @@ with System;
package Pck is
procedure Do_Nothing (A : System.Address);
+ procedure Do_Nothing (A : Wide_String);
+ procedure Do_Nothing (A : Wide_Wide_String);
end Pck;
--
2.34.1
reply other threads:[~2022-03-17 12:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220317125131.1654456-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).