From patchwork Thu Oct 3 11:29:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 34813 Received: (qmail 70661 invoked by alias); 3 Oct 2019 11:29:27 -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 70601 invoked by uid 89); 3 Oct 2019 11:29:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f46.google.com Received: from mail-wm1-f46.google.com (HELO mail-wm1-f46.google.com) (209.85.128.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Oct 2019 11:29:25 +0000 Received: by mail-wm1-f46.google.com with SMTP id y135so7049926wmc.1 for ; Thu, 03 Oct 2019 04:29:24 -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=f084PDYDdmJtml7n71herN0eVOgLNtRljVARWjB81Ls=; b=CwghBWQMyYhCoFjAOQcWpQOcRIaDbg0y6GTvYknqxdKXKuKDk4jmlso3WveDrY8ttR TiJoT+RAQQCbDl/f5BTqe4HljMChPZJn8hquntsv/qZioBMoWwcwhaq2oZCYtwyhrhRG fskYPoWY+DxLC6d5EADwuSoaB24CFq55Oa1KYBf9sA9BUTG7PrujNMfgn3XCllImmPNT Dv1j/p654lkcbk1iQpqfngqtXoYGOBD4UaG7YXzXCaxTcgtFGM+U2xoVnQ1m2fk6TRY7 qhZasAFNtuy9iEYQRgc/Iz08uIE2+xVeboLBEX7X7ceLodUHhUg/RL7eTt+rWpjhu15a hTWg== Return-Path: Received: from localhost (host86-128-12-122.range86-128.btcentralplus.com. [86.128.12.122]) by smtp.gmail.com with ESMTPSA id r65sm1754799wmr.9.2019.10.03.04.29.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Oct 2019 04:29:22 -0700 (PDT) From: Andrew Burgess To: gdb-patches Cc: Andrew Burgess Subject: [PATCHv2 2/4] gdb/fortran: Add test for module variables in 'info variables' output Date: Thu, 3 Oct 2019 12:29:15 +0100 Message-Id: <0b0b47e935820b2f37785548b26be58c2db56807.1570101531.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes Recent work from Tom Tromey to better handle variables with associated copy relocations has fixed a Fortran issue where module variables wouldn't show up in the output of 'info variables'. This commit adds a test for this functionality to ensure it doesn't get broken in the future. gdb/testsuite/ChangeLog: * gdb.fortran/module.exp: Extend with 'info variables' test. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.fortran/module.exp | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp index 4d71e7efac5..276f7dc3c24 100644 --- a/gdb/testsuite/gdb.fortran/module.exp +++ b/gdb/testsuite/gdb.fortran/module.exp @@ -13,6 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +load_lib "fortran.exp" + standard_testfile .f90 if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}] } { @@ -32,6 +34,28 @@ if ![runto MAIN__] then { continue } +set int_type [fortran_int4] + +# Test 'info variables' can find module variables. +gdb_test "info variables -n" \ + [multi_line \ + "All defined variables:" \ + "" \ + "File .*$srcfile:" \ + "18:\[ \t\]+${int_type} mod1::var_const;" \ + "17:\[ \t\]+${int_type} mod1::var_i;" \ + "23:\[ \t\]+${int_type} mod2::var_i;" \ + "28:\[ \t\]+${int_type} mod3::mod1;" \ + "27:\[ \t\]+${int_type} mod3::mod2;" \ + "29:\[ \t\]+${int_type} mod3::var_i;" \ + "33:\[ \t\]+${int_type} modmany::var_a;" \ + "33:\[ \t\]+${int_type} modmany::var_b;" \ + "33:\[ \t\]+${int_type} modmany::var_c;" \ + "33:\[ \t\]+${int_type} modmany::var_i;" \ + "37:\[ \t\]+${int_type} moduse::var_x;" \ + "37:\[ \t\]+${int_type} moduse::var_y;" ] + + # Do not use simple single-letter names as GDB would pick up for expectedly # nonexisting symbols some static variables from system libraries debuginfos.