[ was: Re: [pushed] Support -prompt and -lbl in gdb_test (Re: [PATCH 5/5] Make gdb_test's question non-optional if specified) ] On 5/23/22 14:01, Tom de Vries wrote: > On 5/23/22 12:48, Tom de Vries wrote: >> On 5/18/22 13:01, Pedro Alves wrote: >>> diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp >>> b/gdb/testsuite/gdb.base/ui-redirect.exp >>> index 13bc964f46c..4ed82ae63bf 100644 >>> --- a/gdb/testsuite/gdb.base/ui-redirect.exp >>> +++ b/gdb/testsuite/gdb.base/ui-redirect.exp >>> @@ -117,12 +117,10 @@ with_test_prefix "debugging" { >>>       gdb_test "set logging enabled on" \ >>>       "Copying output to /dev/null.*Copying debug output to >>> /dev/null\\." >>> -    set prompt "$gdb_prompt \\\[infrun\\\] fetch_inferior_event: >>> exit\r\n$" >>> -    gdb_test_multiple "continue" "continue" -prompt $prompt { >>> -    -re "Continuing.*\\\[infrun\\\] .*\\\[infrun\\\] .*Breakpoint >>> \[0-9\]+, foo.*$prompt$" { >>> -        pass $gdb_test_name >>> -    } >>> -    } >>> +    gdb_test \ >>> +    -prompt "$gdb_prompt \\\[infrun\\\] fetch_inferior_event: >>> exit\r\n$" \ >>> +    "continue" \ >>> +    "Continuing.*\\\[infrun\\\] .*\\\[infrun\\\] .*Breakpoint >>> \[0-9\]+, foo.*" >>>       gdb_test "set debug infrun 0" >>>       gdb_test "set logging enabled off" "Done logging to /dev/null\\." >> >> I'm running into: >> ... >>    [infrun] maybe_set_commit_resumed_all_targets: not requesting >> commit-resumed for target native, no resumed threads^M >> (gdb) FAIL: gdb.base/ui-redirect.exp: debugging: continue >> [infrun] fetch_inferior_event: exit^M >> ... >> >> I'm assuming it's related to this change. > > That's confirmed, reproduces reliably with read1, and is fixed by > reverting the patch. > > Looks like this in gdb_test: > ... >     lappend "-prompt $prompt" > ... > has no effect. > > This fixes it: > ... > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 720418beac2..a6780d8d634 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -1393,7 +1393,7 @@ proc gdb_test { args } { >      set user_code [join $user_code] > >      set opts {} > -    lappend "-prompt $prompt" > +    lappend opts "-prompt" "$prompt" >      if {$lbl} { >         lappend opts "-lbl" >      } > ... > Tested and committed. Thanks, - Tom