From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCHv2 4/4] gdb: Add new commands to list module variables and functions
Date: Wed, 27 Nov 2019 21:29:00 -0000 [thread overview]
Message-ID: <20191127212923.GC3410@embecosm.com> (raw)
In-Reply-To: <ccd54e39-64a8-b844-b2dd-ada57c9b5c32@suse.de>
* Tom de Vries <tdevries@suse.de> [2019-11-22 13:44:09 +0100]:
> On 03-10-2019 13:29, Andrew Burgess wrote:
> > * gdb.fortran/info-modules.exp: Update expected results, and add
> > additional tests for 'info module functinos', and 'info module
> > variables'.
> > * gdb.fortran/info-types.exp: Update expected results.
> > * gdb.fortran/info-types.f90: Extend testcase with additional
> > module variables and functions.
>
> Hi,
>
> This test-case fails to compile for me:
> ...
> $ cd build/gdb; make check RUNTESTFLAGS="gdb.fortran/info-modules.exp"
> gdb compile failed, src/gdb/testsuite/gdb.fortran/info-types.f90:39:6:
>
> use mod2
> 1
> Fatal Error: Can't open module file 'mod2.mod' for reading at (1): No
> such file or directory
> compilation terminated.
>
> === gdb Summary ===
>
> # of untested testcases 1
> ...
>
> Interestingly, if I first run:
> ...
> $ cd build/gdb; make check RUNTESTFLAGS="gdb.fortran/module.exp"
> Running src/gdb/testsuite/gdb.fortran/module.exp ...
>
> === gdb Summary ===
>
> # of expected passes 27
> ...
> which produces:
> ...
> $ ls -la build/gdb/testsuite/mod2.mod
> -rw-r--r-- 1 vries users 208 22 nov 13:35 build/gdb/testsuite/mod2.mod
> ...
> then the test-case passes:
> ...
> $ cd build/gdb; make check RUNTESTFLAGS="gdb.fortran/info-modules.exp"
> Running src/gdb/testsuite/gdb.fortran/info-modules.exp ...
>
> === gdb Summary ===
>
> # of expected passes 12
> ...
>
> Removing mod2.mod brings the failure back:
> ...
> $ rm -f build/gdb/testsuite/mod2.mod
> $ cd build/gdb; make check
> RUNTESTFLAGS="gdb.fortran/info-modules.exp"
> gdb compile failed, src/gdb/testsuite/gdb.fortran/info-types.f90:39:6:
>
> use mod2
> 1
> Fatal Error: Can't open module file 'mod2.mod' for reading at (1): No
> such file or directory
> compilation terminated.
>
> === gdb Summary ===
>
> # of untested testcases 1
> ...
>
> So, I think that in a parallel test run this may succeed, but in a
> sequential testrun this should fail.
Tom,
Thanks for finding this issue. Sorry that I didn't spot this feedback
until after I'd pushed this patch.
I've committed the fix below to address this issue.
Thanks,
Andrew
---
From 640ab94712483457b99bd1039b52821c510b28a7 Mon Sep 17 00:00:00 2001
From: Andrew Burgess <andrew.burgess@embecosm.com>
Date: Wed, 27 Nov 2019 21:18:38 +0000
Subject: [PATCH] gdb/testsuite: Fix race condition compiling fortran test
The Fortran test gdb.fortran/info-modules compiles the files
info-types.f90 and info-types-2.f90 in that order. Unfortunately
info-types.f90 makes use of a module defined in info-types-2.f90.
This currently doesn't cause a problem if you run all of the Fortran
tests as the info-types.exp test already compiles info-types-2.f90 and
so the module description file 'mod2.mod' will be created, and can
then be found by info-modules.exp during its compile.
If however you try to run just info-modules.exp in a clean build
directory, the test will fail to compile.
Fix this by compiling the source files in the reverse order so that
the module is compiled first, then the test program that uses the
module.
gdb/testsuite/ChangeLog:
* gdb.fortran/info-modules.exp: Compile source files in correct
order.
Change-Id: Ic3a1eded0486f6264ebe3066cf1beafbd2534a91
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.fortran/info-modules.exp | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.fortran/info-modules.exp b/gdb/testsuite/gdb.fortran/info-modules.exp
index 43570066d2f..c57ac3ff569 100644
--- a/gdb/testsuite/gdb.fortran/info-modules.exp
+++ b/gdb/testsuite/gdb.fortran/info-modules.exp
@@ -23,7 +23,7 @@ if { [skip_fortran_tests] } { continue }
standard_testfile info-types.f90 info-types-2.f90
if { [prepare_for_testing "failed to prepare" $testfile \
- [list $srcfile $srcfile2] {debug f90}] } {
+ [list $srcfile2 $srcfile] {debug f90}] } {
return -1
}
--
2.14.5
next prev parent reply other threads:[~2019-11-27 21: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 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 [this message]
2019-11-28 9:21 ` Tom de Vries
2019-11-28 12:18 ` 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 2/4] gdb/fortran: Add test for module variables in 'info variables' output Andrew Burgess
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=20191127212923.GC3410@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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