aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.ada
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-03-08 10:54:44 -0700
committerTom Tromey <tromey@adacore.com>2022-03-16 09:28:13 -0600
commitfc18a21b65a7a0fc05d5e41118e072d253aeca0a (patch)
tree14912e6f85140f8f89189e0f48c4ca53587dd5c0 /gdb/testsuite/gdb.ada
parent16b6c361546c74aa10287fb88cf0c47c536f9eb3 (diff)
downloadfsf-binutils-gdb-fc18a21b65a7a0fc05d5e41118e072d253aeca0a.zip
fsf-binutils-gdb-fc18a21b65a7a0fc05d5e41118e072d253aeca0a.tar.gz
fsf-binutils-gdb-fc18a21b65a7a0fc05d5e41118e072d253aeca0a.tar.bz2
Ada support for wide strings
This adds some basic support for Wide_String and Wide_Wide_String to the Ada expression evaluator. In particular, a string literal may be converted to a wide or wide-wide string depending on context. The patch updates an existing test case. Note that another test, namely something like: ptype Wide_Wide_String'("literal") ... would be nice to add, but when tested against a distro GNAT, this did not work (probably due to lack of debuginfo); so, I haven't included it here.
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r--gdb/testsuite/gdb.ada/widewide.exp4
-rw-r--r--gdb/testsuite/gdb.ada/widewide/foo.adb2
2 files changed, 6 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.ada/widewide.exp b/gdb/testsuite/gdb.ada/widewide.exp
index c0268f9..d68a0b1 100644
--- a/gdb/testsuite/gdb.ada/widewide.exp
+++ b/gdb/testsuite/gdb.ada/widewide.exp
@@ -43,3 +43,7 @@ gdb_test "print my_wws(1)" "= 32 ' '"
gdb_test "print my_wws(2)" "= 104 'h'"
+gdb_test "print my_wws = \" helo\"" " = true"
+
+gdb_test "print my_ws = \"wide\"" " = true"
+gdb_test "print my_ws = \"nope\"" " = false"
diff --git a/gdb/testsuite/gdb.ada/widewide/foo.adb b/gdb/testsuite/gdb.ada/widewide/foo.adb
index 45adbde..d41734a 100644
--- a/gdb/testsuite/gdb.ada/widewide/foo.adb
+++ b/gdb/testsuite/gdb.ada/widewide/foo.adb
@@ -19,9 +19,11 @@ procedure Foo is
Some_Easy : Wide_Wide_Character := 'J';
Some_Larger : Wide_Wide_Character := Wide_Wide_Character'Val(16#beef#);
Some_Big : Wide_Wide_Character := Wide_Wide_Character'Val(16#00dabeef#);
+ My_Ws : Wide_String := "wide";
My_WWS : Wide_Wide_String := " helo";
begin
Do_Nothing (Some_Easy'Address); -- START
Do_Nothing (Some_Larger'Address);
+ Do_Nothing (My_Ws'Address);
Do_Nothing (Some_Big'Address);
end Foo;