[PATCHv2 4/4] gdb: Add new commands to list module variables and functions

Andrew Burgess andrew.burgess@embecosm.com
Thu Nov 28 12:18:00 GMT 2019


* Tom de Vries <tdevries@suse.de> [2019-11-28 10:20:59 +0100]:

> On 27-11-2019 22:29, Andrew Burgess wrote:
> >> 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
> 
> > 
> > I've committed the fix below to address this issue.
> > 
> 
> > 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
> >  }
> >  
> > 
> 
> Ah, interesting.  I initially tried:
> ...
> -standard_testfile info-types.f90 info-types-2.f90
> +standard_testfile info-types-2.f90 info-types.f90
> ...
> which made the test-case compile but caused a bunch of FAILs, but it
> didn't occur to me to switch the order in the preparing_for_testing call.

That change will result in $srcfile and $srcfile2 swapping over.  This
test checks that symbols are being reported as from the correct source
file, so the output patterns make use of the srcfile variables.
That's why this didn't work.

Thanks,
Andre



More information about the Gdb-patches mailing list