[binutils-gdb] gdb: fix regression in gdb.xml/maint_print_struct.exp
Andrew Burgess
aburgess@sourceware.org
Fri Feb 17 22:29:24 GMT 2023
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=733da2ced8f948b299bdd10b7ff40146095f43f9
commit 733da2ced8f948b299bdd10b7ff40146095f43f9
Author: Andrew Burgess <aburgess@redhat.com>
Date: Fri Feb 17 10:15:27 2023 +0000
gdb: fix regression in gdb.xml/maint_print_struct.exp
A regression in gdb.xml/maint_print_struct.exp was introduced with
commit:
commit 81b86eced24f905545b58aa6c27478104c364976
Date: Fri Jan 6 09:30:40 2023 -0700
Do not record a rejected target description
The test relied on an invalid target description being stored within
the tdesc_info of the current inferior, the above commit stopped this
behaviour.
Update the test to check that the invalid architecture is NOT stored,
and then check printing the target description directly from the
file.
Approved-By: Tom Tromey <tromey@adacore.com>
Diff:
---
gdb/testsuite/gdb.xml/maint_print_struct.exp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.xml/maint_print_struct.exp b/gdb/testsuite/gdb.xml/maint_print_struct.exp
index 6f411895501..fbb16aeb8f5 100644
--- a/gdb/testsuite/gdb.xml/maint_print_struct.exp
+++ b/gdb/testsuite/gdb.xml/maint_print_struct.exp
@@ -21,12 +21,17 @@ require allow_xml_test
gdb_start
+set xml_file "$srcdir/$subdir/maint_print_struct.xml"
+
# Required registers are not present so it is expected a warning.
#
-gdb_test "set tdesc filename $srcdir/$subdir/maint_print_struct.xml" "
+gdb_test "set tdesc filename $xml_file" "
warning:.*" "setting a new tdesc having only a structure"
-gdb_test "maint print c-tdesc" "
+gdb_test "maint print c-tdesc" \
+ "There is no target description to print\\."
+
+gdb_test "maint print c-tdesc $xml_file" "
.*tdesc_create_reg \\(feature, \"bad_reg1\", \[0-9\]+, 1, NULL, 128, \"two_fielded\"\\);\r
.*tdesc_create_reg \\(feature, \"bad_reg2\", \[0-9\]+, 1, NULL, 64, \"bitfield\"\\);\r
.*" "printing tdesc with a structure and a bitfield"
More information about the Gdb-cvs
mailing list