public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix solib-list.exp test-case for exec with debug-info
@ 2020-03-15 14:15 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-03-15 14:15 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6b9374f1e07cb250736815ff8db263199416adc6
commit 6b9374f1e07cb250736815ff8db263199416adc6
Author: Tom de Vries <tdevries@suse.de>
Date: Sun Mar 15 15:15:56 2020 +0100
[gdb/testsuite] Fix solib-list.exp test-case for exec with debug-info
Since commit a2fedca99c "Implement 'set/show exec-file-mismatch'.", I see the
following regression on openSUSE Leap 15.1:
...
FAIL: gdb.server/solib-list.exp: non-stop 0: target remote \
(got interactive prompt)
FAIL: gdb.server/solib-list.exp: non-stop 1: target remote \
(got interactive prompt)
...
The first FAIL in more detail:
...
(gdb) PASS: gdb.server/solib-list.exp: non-stop 0: file binfile
target remote localhost:2346
Remote debugging using localhost:2346
warning: Mismatch between current exec-file /data/gdb_versions/devel/build/\
gdb/testsuite/outputs/gdb.server/solib-list/solib-list
and automatically determined exec-file /lib64/ld-2.26.so
exec-file-mismatch handling is currently "ask"
Load new symbol table from "/lib64/ld-2.26.so"? (y or n) n
warning: loading /lib64/ld-2.26.so Not confirmed.
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
warning: File transfers from remote targets can be slow. \
Use "set sysroot" to access files locally instead.
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading symbols from target:/lib64/ld-linux-x86-64.so.2...
Reading /lib64/ld-2.26.so-2.26-lp151.18.7.x86_64.debug from remote target...
Reading /lib64/.debug/ld-2.26.so-2.26-lp151.18.7.x86_64.debug from remote \
target...
Reading /data/gdb_versions/devel/install/lib64/debug//lib64/\
ld-2.26.so-2.26-lp151.18.7.x86_64.debug from remote target...
Reading /data/gdb_versions/devel/install/lib64/debug/lib64/\
/ld-2.26.so-2.26-lp151.18.7.x86_64.debug from remote target...
Reading target:/data/gdb_versions/devel/install/lib64/debug/lib64/\
/ld-2.26.so-2.26-lp151.18.7.x86_64.debug from remote target...
(No debugging symbols found in target:/lib64/ld-linux-x86-64.so.2)
0x00007ffff7dd7ea0 in ?? ()
(gdb) FAIL: gdb.server/solib-list.exp: non-stop 0: target remote (got \
interactive prompt)
...
The commit introduces the "Load new symbol table from" question, and
gdb_test_multiple defaults to answering "no" and reporting the
"got interactive prompt" FAIL.
This FAIL is not seen on f.i. debian 10.2. The difference originates from the
fact that the solib-list executable has debug-info in the openSUSE case, while
it doesn't in the debian case.
We can prevent the failure on openSUSE by stripping the executable from
debug-info:
...
+ exec strip --strip-debug ${binfile}
...
The difference in behaviour is a bug or improvement opportunity in the
exec-file-mismatch, filed as PR25475.
This patch fixes the FAIL by handling the question in the test-case.
Tested on x86_64-linux.
Tested on x86_64-linux with the gdbserver part of the patch introducing the
test-case reverted to ensure that this still FAILs.
gdb/testsuite/ChangeLog:
2020-03-15 Tom de Vries <tdevries@suse.de>
* gdb.server/solib-list.exp: Handle
'Load new symbol table from "/lib64/ld-2.26.so"? (y or n)'.
Diff:
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.server/solib-list.exp | 17 +++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7c3fd4cf4cb..9387c686a05 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-15 Tom de Vries <tdevries@suse.de>
+
+ * gdb.server/solib-list.exp: Handle
+ 'Load new symbol table from "/lib64/ld-2.26.so"? (y or n)'.
+
2020-03-15 Tom de Vries <tdevries@suse.de>
* gdb.base/maint.exp: Use exp_continue in long lines for "maint print
diff --git a/gdb/testsuite/gdb.server/solib-list.exp b/gdb/testsuite/gdb.server/solib-list.exp
index 5471734e031..6f077c6a664 100644
--- a/gdb/testsuite/gdb.server/solib-list.exp
+++ b/gdb/testsuite/gdb.server/solib-list.exp
@@ -92,10 +92,23 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" {
{(Are you sure you want to change the file|Load new symbol table from ".*")\? \(y or n\) } "y"
set test "target $gdbserver_protocol"
+ set ok 0
gdb_test_multiple "target $gdbserver_protocol $gdbserver_gdbport" $test {
- -re "Remote debugging using .*\r\n$gdb_prompt " {
+ -re "Remote debugging using" {
+ set ok 1
+ exp_continue
+ }
+ -re {.*Load new symbol table from ".*"\? \(y or n\) } {
+ send_gdb "y\n" answer
+ exp_continue
+ }
+ -re ".*\r\n$gdb_prompt " {
# Do not anchor end, there may be more output in non-stop mode.
- pass $test
+ if ($ok) {
+ pass $test
+ } else {
+ fail $test
+ }
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-15 14:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-15 14:15 [binutils-gdb] [gdb/testsuite] Fix solib-list.exp test-case for exec with debug-info Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).