]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: Make hook-stop.exp ignore termination message from GDB stub
authorSandra Loosemore <sandra@codesourcery.com>
Tue, 5 Sep 2023 18:48:22 +0000 (18:48 +0000)
committerSandra Loosemore <sandra@codesourcery.com>
Tue, 5 Sep 2023 18:48:22 +0000 (18:48 +0000)
When a GDB stub is run via "target remote |", it sometimes produces
extra output that ends up mixed with GDB's own output.  For example,
QEMU's built-in GDB stub responds to the vKill packet by printing

nios2-elf-qemu-system: QEMU: Terminated via GDBstub

before exiting.

This patch fixes the regexp in gdb.base/hook-stop.exp to allow such
messages between GDB's "continuing" and "Inferior killed" messages.

Reviewed-By: Tom Tromey <tom@tromey.com>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.base/hook-stop.exp

index 0babd46aaeaba2b5ed01fedbf44820f91602a983..50c5dfe9dc5b77068df5e067ad0315bfcc5b52a0 100644 (file)
@@ -85,7 +85,7 @@ proc hook_stop_kill {} {
 
        set test "run hook-stop"
        gdb_test_multiple "continue" "$test" {
-           -re "Continuing.\r\n\\\[Inferior $decimal \\(.*\\) killed\\\]\r\n${gdb_prompt} $" {
+           -re "Continuing.*\r\n\\\[Inferior $decimal \\(.*\\) killed\\\]\r\n${gdb_prompt} $" {
                pass $test
            }
        }