From patchwork Sun Sep 1 16:08:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 34367 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: 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 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 ; 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: 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 To: gdb-patches@sourceware.org Cc: Tom de Vries , Andrew Burgess 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: References: In-Reply-To: References: X-IsSubscribed: yes 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(-) 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