From: Andrew Burgess Date: Fri, 17 Feb 2023 10:15:27 +0000 (+0000) Subject: gdb: fix regression in gdb.xml/maint_print_struct.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=733da2ced8f948b299bdd10b7ff40146095f43f9;p=binutils-gdb.git 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 --- 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"