From patchwork Wed Aug 28 15:13:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 34302 Received: (qmail 47738 invoked by alias); 28 Aug 2019 15:13:57 -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 47728 invoked by uid 89); 28 Aug 2019 15:13:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=decimal X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Aug 2019 15:13:56 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id AD373AE00; Wed, 28 Aug 2019 15:13:53 +0000 (UTC) Subject: [committed][gdb/testsuite] Fix info-var.exp for debug info from other files To: Andrew Burgess , gdb-patches@sourceware.org References: <83o91fl9b9.fsf@gnu.org> <20190730210245.GN23204@embecosm.com> <83blxai7f5.fsf@gnu.org> <20190826155159.GM6076@embecosm.com> <83h863gas2.fsf@gnu.org> <20190827152719.GP6076@embecosm.com> From: Tom de Vries Openpgp: preference=signencrypt Message-ID: <6f62eb16-2b38-e0e3-d1d0-b1137fea4aab@suse.de> Date: Wed, 28 Aug 2019 17:13:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190827152719.GP6076@embecosm.com> X-IsSubscribed: yes [was: Re: [PATCH 1/7] gdb: Add new -n flag to some info commands ] On 27-08-19 17:27, Andrew Burgess wrote: > * Eli Zaretskii [2019-08-26 19:18:53 +0300]: > >>> Date: Mon, 26 Aug 2019 16:52:00 +0100 >>> From: Andrew Burgess >>> Cc: gdb-patches@sourceware.org, Richard.Bunt@arm.com >>> >>> + ** The "info variables", "info functions", and "whereis" commands >>> + now take a '-n' flag that excludes non-debug symbols (symbols >>> + from the symbol table, not from the debug info such as DWARf) >> ^ >> A typo. >> >> Other than that, the documentation parts are OK. >> >> Thanks. > > Thanks, > > This patch is now pushed. > I've committed this fixup for openSUSE Leap. Thanks, - Tom [gdb/testsuite] Fix info-var.exp for debug info from other files On openSUSE Leap 15.1, I get: ... FAIL: gdb.base/info-var.exp: info variables FAIL: gdb.base/info-var.exp: info variables -n ... because the info variables command prints info also for init.c: ... File init.c:^M 24: const int _IO_stdin_used;^M ... while the regexps in the test-case only expect info for info-var-f1.c and info-var-f2.c. Fix this by extending the regexps. Tested on x86_64-linux, both openSUSE Leap 15.1 and Fedora 30. gdb/testsuite/ChangeLog: 2019-08-28 Tom de Vries * gdb.base/info-var.exp: Allow info variables to print info for files other than info-var-f1.c and info-var-f2.c. --- gdb/testsuite/gdb.base/info-var.exp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/info-var.exp b/gdb/testsuite/gdb.base/info-var.exp index 5a07d6214d..6dd896d8aa 100644 --- a/gdb/testsuite/gdb.base/info-var.exp +++ b/gdb/testsuite/gdb.base/info-var.exp @@ -37,7 +37,10 @@ gdb_test "info variables" \ "File .*${srcfile2}:" \ "18:\[ \t\]+int global_var;" \ "20:\[ \t\]+static int f2_var;" \ - "" \ + "(" \ + "File .*:(" \ + "$decimal:.*" \ + ")+)*" \ "Non-debugging symbols:" \ ".*"] @@ -50,7 +53,10 @@ gdb_test "info variables -n" \ "" \ "File .*${srcfile2}:" \ "18:\[ \t\]+int global_var;" \ - "20:\[ \t\]+static int f2_var;" ] + "20:\[ \t\]+static int f2_var;(" \ + "" \ + "File .*:(" \ + "$decimal:.*)+)*"] gdb_test "info variables -n global" \ [multi_line \