From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches <gdb-patches@sourceware.org>
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCHv2 2/4] gdb/fortran: Add test for module variables in 'info variables' output
Date: Thu, 03 Oct 2019 11:29:00 -0000 [thread overview]
Message-ID: <0b0b47e935820b2f37785548b26be58c2db56807.1570101531.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1570101531.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1570101531.git.andrew.burgess@embecosm.com>
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 <http://www.gnu.org/licenses/>.
+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.
--
2.14.5
next prev parent reply other threads:[~2019-10-03 11:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-03 11:29 [PATCHv2 0/4] Fortran info types, info modules, info module Andrew Burgess
2019-10-03 11:29 ` [PATCHv2 3/4] gdb/fortran: Add new 'info modules' command Andrew Burgess
2019-10-03 16:12 ` Eli Zaretskii
2019-10-03 11:29 ` [PATCHv2 1/4] gdb/testsuite: Allow cc-with-tweaks board file to be used with Fortran Andrew Burgess
2019-10-03 11:29 ` [PATCHv2 4/4] gdb: Add new commands to list module variables and functions Andrew Burgess
2019-10-03 16:16 ` Eli Zaretskii
2019-10-10 15:58 ` Tom Tromey
2019-11-22 12:44 ` Tom de Vries
2019-11-27 21:29 ` Andrew Burgess
2019-11-28 9:21 ` Tom de Vries
2019-11-28 12:18 ` Andrew Burgess
2019-10-03 11:29 ` Andrew Burgess [this message]
2019-10-10 15:59 ` [PATCHv2 0/4] Fortran info types, info modules, info module Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b0b47e935820b2f37785548b26be58c2db56807.1570101531.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox