[gdb/testsuite] Expect conformation question in gdb.server/solib-list.exp
authorTom de Vries <tdevries@suse.de>
Mon, 29 Jun 2020 09:02:06 +0000 (11:02 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 29 Jun 2020 09:02:06 +0000 (11:02 +0200)
Before commit a8654e7d78 'Fixes PR 25475: ensure exec-file-mismatch "ask"
always asks in case of mismatch', there was a difference in behaviour in
test-case gdb.server/solib-list.exp.

If the executable did not contain debug info (as is usually the case), gdb
would detect a mismatch but not ask for confirmation:
...
(gdb) target remote localhost:2346^M
Remote debugging using localhost:2346^M
warning: Mismatch between current exec-file solib-list^M
and automatically determined exec-file /lib64/ld-2.26.so^M
exec-file-mismatch handling is currently "ask"^M
Reading symbols from /lib64/ld-2.26.so...^M
Reading symbols from /usr/lib/debug/lib64/ld-2.26.so.debug...^M
0x00007ffff7dd7ea0 in _start () at rtld.c:745^M
745     }^M
(gdb) PASS: gdb.server/solib-list.exp: non-stop 0: target remote
...

If the executable did contain debug info (as happens to be the case for
openSUSE), gdb would detect a mismatch and ask for confirmation:
...
(gdb) PASS: gdb.server/solib-list.exp: non-stop 0: file binfile
target remote localhost:2346^M
Remote debugging using localhost:2346^M
warning: Mismatch between current exec-file solib-list^M
and automatically determined exec-file /lib64/ld-2.26.so^M
exec-file-mismatch handling is currently "ask"^M
Load new symbol table from "/lib64/ld-2.26.so"? (y or n) y^M
Reading symbols from /lib64/ld-2.26.so...^M
Reading symbols from /usr/lib/debug/lib64/ld-2.26.so.debug...^M
0x00007ffff7dd7ea0 in _start () at rtld.c:745^M
745     }^M
(gdb) PASS: gdb.server/solib-list.exp: non-stop 0: target remote
...

After commit a8654e7d78, the confirmation is now also asked in case there's
no debug info.

Tighten the test-case by verifying that the confirmation question is asked, as
suggested in the log message of commit a8654e7d78:
...
we can remove the bypass introduced by Tom in 6b9374f1, in order to always
answer to the 'load' question.
...

gdb/testsuite/ChangeLog:

2020-06-29  Tom de Vries  <tdevries@suse.de>

PR gdb/25475
* gdb.server/solib-list.exp: Verify that the symbol reload
confirmation question is asked.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.server/solib-list.exp

index adb5349b8040035bd48ea35d8a2180c6ec6c4132..0c2f47b5f2b63d3532a6cf86fb470b0cef3b3f2d 100644 (file)
@@ -1,3 +1,9 @@
+2020-06-29  Tom de Vries  <tdevries@suse.de>
+
+       PR gdb/25475
+       * gdb.server/solib-list.exp: Verify that the symbol reload
+       confirmation question is asked.
+
 2020-06-26  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
 
        * lib/gdb.exp (gdb_test_multiline): New, moved from gdb-guile.exp,
index 6f077c6a664ecb379f7ae05ba520bcf1faece42f..a326f940ad8c83a04dfe3c12e27852e33aa7087a 100644 (file)
@@ -93,12 +93,14 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" {
 
     set test "target $gdbserver_protocol"
     set ok 0
+    set new_symbol_table 0
     gdb_test_multiple "target $gdbserver_protocol $gdbserver_gdbport" $test {
        -re "Remote debugging using" {
            set ok 1
            exp_continue
        }
        -re {.*Load new symbol table from ".*"\? \(y or n\) } {
+           set new_symbol_table 1
            send_gdb "y\n" answer
            exp_continue
        }
@@ -111,6 +113,7 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" {
            }
        }
     }
+    gdb_assert {$new_symbol_table == 1}
 
     gdb_test "continue" "Program received signal SIGUSR1, .*"
     gdb_test "sharedlibrary" ".*"
This page took 0.034968 seconds and 4 git commands to generate.