Message ID | 8e6a86ffac28f50f57a826daf8cb4647e4de2ad3.1567353237.git.andrew.burgess@embecosm.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 43235 invoked by alias); 1 Sep 2019 16:09:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 43155 invoked by uid 89); 1 Sep 2019 16:09:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1403 X-HELO: mail-wr1-f43.google.com Received: from mail-wr1-f43.google.com (HELO mail-wr1-f43.google.com) (209.85.221.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 01 Sep 2019 16:09:01 +0000 Received: by mail-wr1-f43.google.com with SMTP id s18so11616665wrn.1 for <gdb-patches@sourceware.org>; Sun, 01 Sep 2019 09:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=URsDcjarSt0WtHA1WG9nj3Jh7uLGBrkRvXf5pcWvLtg=; b=SPTl3sI5+GRoXxaRPAqslCdAbmoQCQEJCOv7seaseV6RT3jZ2nObfdaoeT8uuw7fGy 6y+7l/vdgG4ug5khh6OAsrO9TsAZRsIFv8zFKimvfxkjepxKKWrvMG4mxz/WWvjMMwLA Jji3vFFux9RuSJuSR7kwBJ6JpRa6eepjkNaD/ba3aX5GFntyU6w1nJRbRkYBdT0Lk5Jt 4uAiOUXC6aTx4Hp52hINC1oLGwsQcNZx5mp6KMOAOoG5yiNFsPIjLzj1FhdkNDBtgRqM eTwgxxWbJ5oVAnun4oLRorKLd09RDForX0zydkx5vBJik4rT8d/59S6ucUuyiL957h5M RxRQ== Return-Path: <andrew.burgess@embecosm.com> Received: from localhost (92.40.249.158.threembb.co.uk. [92.40.249.158]) by smtp.gmail.com with ESMTPSA id g24sm10253603wrb.35.2019.09.01.09.08.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Sep 2019 09:08:58 -0700 (PDT) From: Andrew Burgess <andrew.burgess@embecosm.com> To: gdb-patches@sourceware.org Cc: Tom de Vries <tdevries@suse.de>, Andrew Burgess <andrew.burgess@embecosm.com> Subject: [PATCH 3/3] gdb/testsuite: Make use of exec_has_index_section function Date: Sun, 1 Sep 2019 17:08:47 +0100 Message-Id: <8e6a86ffac28f50f57a826daf8cb4647e4de2ad3.1567353237.git.andrew.burgess@embecosm.com> In-Reply-To: <cover.1567353237.git.andrew.burgess@embecosm.com> References: <cover.1567353237.git.andrew.burgess@embecosm.com> In-Reply-To: <cover.1567353237.git.andrew.burgess@embecosm.com> References: <cover.1567353237.git.andrew.burgess@embecosm.com> X-IsSubscribed: yes |
Commit Message
Andrew Burgess
Sept. 1, 2019, 4:08 p.m. UTC
Make use of exec_has_index_section library function rather than manually checking in the 'maintenance info sections' output. Should make no difference to the test results, just makes the code easier to read. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Use exec_has_index_section. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/maint.exp | 13 +------------ 2 files changed, 5 insertions(+), 12 deletions(-)
Comments
On 01-09-19 18:08, Andrew Burgess wrote: > Make use of exec_has_index_section library function rather than > manually checking in the 'maintenance info sections' output. Should > make no difference to the test results, just makes the code easier to > read. > I agree that it's nicer to test this using a proc call. I just wonder whether we should move the removed code to the exec_has_index_section proc to handle the case that there's no readelf. Then again, that might be overkill, I'm not sure. Thanks, - Tom > gdb/testsuite/ChangeLog: > > * gdb.base/maint.exp: Use exec_has_index_section. > --- > gdb/testsuite/ChangeLog | 4 ++++ > gdb/testsuite/gdb.base/maint.exp | 13 +------------ > 2 files changed, 5 insertions(+), 12 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp > index a5d5dacaba9..15988c79386 100644 > --- a/gdb/testsuite/gdb.base/maint.exp > +++ b/gdb/testsuite/gdb.base/maint.exp > @@ -127,18 +127,7 @@ gdb_test_multiple "maint info sections" $test { > } > > # If we're using .gdb_index or .debug_names there will be no psymtabs. > -set have_gdb_index 0 > -gdb_test_multiple "maint info sections .gdb_index .debug_names" "check for .gdb_index" { > - -re ": \\.gdb_index .*\r\n$gdb_prompt $" { > - set have_gdb_index 1 > - } > - -re ": \\.debug_names .*\r\n$gdb_prompt $" { > - set have_gdb_index 1 > - } > - -re ".*$gdb_prompt $" { > - ;# Nothing to do, present to avoid a FAIL. > - } > -} > +set have_gdb_index [ exec_has_index_section ${binfile} ] > > # There also won't be any psymtabs if we read the index from the index cache. > # We can detect this by looking if the index-cache is enabled and if the number >
* Tom de Vries <tdevries@suse.de> [2019-09-02 13:21:36 +0200]: > On 01-09-19 18:08, Andrew Burgess wrote: > > Make use of exec_has_index_section library function rather than > > manually checking in the 'maintenance info sections' output. Should > > make no difference to the test results, just makes the code easier to > > read. > > > > I agree that it's nicer to test this using a proc call. I just wonder > whether we should move the removed code to the exec_has_index_section > proc to handle the case that there's no readelf. Then again, that might > be overkill, I'm not sure. Possibly, but other functions in lib/gdb.exp don't provide non-readelf alternatives. Also, as readelf is in the same tree as GDB it feels like it should be easy enough for any GDB developer to get access to readelf. I'm inclined to leave things as I have them, but if you (or anyone else) feels strongly I'm happy to update the patch, just let me know. Thanks, Andrew > > Thanks, > - Tom > > > gdb/testsuite/ChangeLog: > > > > * gdb.base/maint.exp: Use exec_has_index_section. > > --- > > gdb/testsuite/ChangeLog | 4 ++++ > > gdb/testsuite/gdb.base/maint.exp | 13 +------------ > > 2 files changed, 5 insertions(+), 12 deletions(-) > > > > diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp > > index a5d5dacaba9..15988c79386 100644 > > --- a/gdb/testsuite/gdb.base/maint.exp > > +++ b/gdb/testsuite/gdb.base/maint.exp > > @@ -127,18 +127,7 @@ gdb_test_multiple "maint info sections" $test { > > } > > > > # If we're using .gdb_index or .debug_names there will be no psymtabs. > > -set have_gdb_index 0 > > -gdb_test_multiple "maint info sections .gdb_index .debug_names" "check for .gdb_index" { > > - -re ": \\.gdb_index .*\r\n$gdb_prompt $" { > > - set have_gdb_index 1 > > - } > > - -re ": \\.debug_names .*\r\n$gdb_prompt $" { > > - set have_gdb_index 1 > > - } > > - -re ".*$gdb_prompt $" { > > - ;# Nothing to do, present to avoid a FAIL. > > - } > > -} > > +set have_gdb_index [ exec_has_index_section ${binfile} ] > > > > # There also won't be any psymtabs if we read the index from the index cache. > > # We can detect this by looking if the index-cache is enabled and if the number > >
On 02-09-19 15:14, Andrew Burgess wrote: > * Tom de Vries <tdevries@suse.de> [2019-09-02 13:21:36 +0200]: > >> On 01-09-19 18:08, Andrew Burgess wrote: >>> Make use of exec_has_index_section library function rather than >>> manually checking in the 'maintenance info sections' output. Should >>> make no difference to the test results, just makes the code easier to >>> read. >>> >> >> I agree that it's nicer to test this using a proc call. I just wonder >> whether we should move the removed code to the exec_has_index_section >> proc to handle the case that there's no readelf. Then again, that might >> be overkill, I'm not sure. > > Possibly, but other functions in lib/gdb.exp don't provide non-readelf > alternatives. Also, as readelf is in the same tree as GDB it feels > like it should be easy enough for any GDB developer to get access to > readelf. > > I'm inclined to leave things as I have them, but if you (or anyone > else) feels strongly I'm happy to update the patch, just let me know. You've convinced me that it's overkill, thanks. - Tom
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index a5d5dacaba9..15988c79386 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -127,18 +127,7 @@ gdb_test_multiple "maint info sections" $test { } # If we're using .gdb_index or .debug_names there will be no psymtabs. -set have_gdb_index 0 -gdb_test_multiple "maint info sections .gdb_index .debug_names" "check for .gdb_index" { - -re ": \\.gdb_index .*\r\n$gdb_prompt $" { - set have_gdb_index 1 - } - -re ": \\.debug_names .*\r\n$gdb_prompt $" { - set have_gdb_index 1 - } - -re ".*$gdb_prompt $" { - ;# Nothing to do, present to avoid a FAIL. - } -} +set have_gdb_index [ exec_has_index_section ${binfile} ] # There also won't be any psymtabs if we read the index from the index cache. # We can detect this by looking if the index-cache is enabled and if the number