From patchwork Mon Feb 3 09:33:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 37648 Received: (qmail 35977 invoked by alias); 3 Feb 2020 09:34:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 35927 invoked by uid 89); 3 Feb 2020 09:34:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=prudent, 25475, nonstop, non-stop X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Feb 2020 09:34:00 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id AEC6720393; Mon, 3 Feb 2020 04:33:57 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 73C5D20187 for ; Mon, 3 Feb 2020 04:33:56 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 583582816C for ; Mon, 3 Feb 2020 04:33:56 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Mon, 3 Feb 2020 04:33:56 -0500 From: "Tom de Vries (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] [gdb/testsuite] Fix solib-list.exp test-case for exec with debug-info X-Gerrit-Change-Id: Ic134eb0b8c72d4a25f6076e811da1b53ddaa4213 X-Gerrit-Change-Number: 761 X-Gerrit-ChangeURL: X-Gerrit-Commit: 165b168fafcdd4e2a33a4ca4f5d31834a1bef1e3 References: Reply-To: tdevries@suse.de, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/761 ...................................................................... [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} ... [ And likewise, we should be able to reproduce the same failure on debian by compiling the executable with debug-info. TBC. ] [ The difference in behaviour may be a bug in the exec-file-mismatch. TBC. ] It seems prudent to handle the question in the test-case, which is what this patch does, and what fixes the FAILs on openSUSE. [ Additionally, we may want to force generation of debug-info for the executable to make sure all distros behave the same. Alternatively, we can achieve the same by stripping the debug-info instead. ] Tested on x86_64-linux. Tested on x86_64-linux with gdbserver part of the patch introducing the test-case reverted to ensure that this still FAILs. gdb/testsuite/ChangeLog: 2020-02-02 Tom de Vries PR testsuite/25475 * gdb.server/solib-list.exp: Handle 'Load new symbol table from "/lib64/ld-2.26.so"? (y or n)'. Change-Id: Ic134eb0b8c72d4a25f6076e811da1b53ddaa4213 --- M gdb/testsuite/gdb.server/solib-list.exp 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.server/solib-list.exp b/gdb/testsuite/gdb.server/solib-list.exp index 5471734..6f077c6 100644 --- a/gdb/testsuite/gdb.server/solib-list.exp +++ b/gdb/testsuite/gdb.server/solib-list.exp @@ -92,10 +92,23 @@ {(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 + } } }