On 7/15/23 10:46, Andreas Schwab wrote: > On Jul 15 2023, Tom de Vries via Gdb-patches wrote: > >> diff --git a/gdb/testsuite/gdb.dwarf2/forward-spec.exp b/gdb/testsuite/gdb.dwarf2/forward-spec.exp >> index ac7d16b09b8..f4512cf9b8c 100644 >> --- a/gdb/testsuite/gdb.dwarf2/forward-spec.exp >> +++ b/gdb/testsuite/gdb.dwarf2/forward-spec.exp >> @@ -74,7 +74,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \ >> >> set in_v 0 >> gdb_test_multiple "maint print objfiles" "v has a parent" { >> - -re "^ *\\\[\[0-9\]\\\] *..cooked_index_entry\[^\r\n\]*" { >> + -re "^ *\\\[\[0-9\]\\\] *\\(\\(cooked_index_entry\[^\r\n\]*" { > > A match that ends with an empty element doesn't make much sense. I > guess this should rather be > > -re "^ *\\\[\[0-9\]\\\] *..cooked_index_entry\[^\r\n\]*\[\r\n\]" { > > to avoid matching an incomplete line. > >> set in_v 0 >> exp_continue >> } >> @@ -82,7 +82,7 @@ gdb_test_multiple "maint print objfiles" "v has a parent" { >> set in_v 1 >> exp_continue >> } >> - -re "^ *parent: *..cooked_index_entry .. (0|$hex)." { >> + -re "^ *parent: *\\(\\(cooked_index_entry \\*\\) (0|$hex)\\)" { > > I think this just needs to be anchored on EOL as well. > Agreed, anchoring can be improved, but I'd rather use the style that can be used in combination with -wrap, which only lookahead-matches the EOL, but doesn't consume it. This plays well with "-wrap", and all the implicit patterns added by gdb_test_multiple. Thanks, - Tom