]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.go/methods.exp with check-readmore
authorTom de Vries <tdevries@suse.de>
Fri, 15 Apr 2022 14:53:08 +0000 (16:53 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 15 Apr 2022 14:53:08 +0000 (16:53 +0200)
When running test-case gdb.go/methods.exp with make check we have:
...
(gdb) break main.T.Foo^M
Function "main.T.Foo" not defined.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) XFAIL: gdb.go/methods.exp: gdb_breakpoint: set breakpoint at main.T.Foo
...
but with make check-readmore the XFAIL fails to trigger:
...
(gdb) break main.T.Foo^M
Function "main.T.Foo" not defined.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) FAIL: gdb.go/methods.exp: gdb_breakpoint: set breakpoint at main.T.Foo
...

This happens because this gdb_test_multiple "maintenance print symbols"
regexp:
...
    -re "\r\n$gdb_prompt $" {
...
matches the entire command output.

Fix this by adding the missing ^ at the regexp start.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29064

gdb/testsuite/gdb.go/methods.exp

index aabf1fa5e090480b58ba9f8986327649de21c2e5..d50fbde122c830eb6e9df8eb880cb35bc615f761 100644 (file)
@@ -49,7 +49,7 @@ gdb_test_multiple "maintenance print symbols" "" {
     -re "^\r\n void main.T.Bar\[^\r\n\]*(?=\r\n)" {
        exp_continue
     }
-    -re "\r\n$gdb_prompt $" {
+    -re "^\r\n$gdb_prompt $" {
        pass $gdb_test_name
     }
     -re "\r\n\[^\r\n\]*(?=\r\n)" {