gdb/testsuite/fortran: Fix info-modules/info-types for gfortran 8+
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 3 Dec 2019 13:18:43 +0000 (13:18 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 9 Dec 2019 13:06:05 +0000 (13:06 +0000)
commitd57cbee932f86df06251498daa93154046dc77c0
treedfd2c373a27874a7425bd92e3652eccf5d98b4cc
parentb1f0c0b90bc8e93eb2d8592c675cba018ac50739
gdb/testsuite/fortran: Fix info-modules/info-types for gfortran 8+

The gdb.fortran/info-modules.exp and gdb.fortran/info-types.exp tests
are failing on versions of gfortran after 7.3 due to the inclusion of
extra "system" modules and type that were not being matched by the
current test patterns.

Rather than building increasingly complex patterns that would always
be at risk of breaking with future versions of GCC I have instead
added a new library that parses the output of the following commands:

  info types
  info variables
  info functions
  info modules
  info module functions
  info module variables

into a data structure, the test can than run checks against the
contents of this data structure.

The benefit is that we can simply ignore extra results that we don't
care about.

There is a small risk that a bug in GDB might allow us to start
reporting incorrect results in such a way that the new library will
not spot the error.  However, I have tried to mitigate this risk by
adding extra procedures into the test library (see check_no_entry) and
we can add more in future if we wanted to be even more defensive.

I tested this test file with gFortran 7.3.1, 8.3.0, and 9.2.0, I now
see 100% pass in all cases.

gdb/testsuite/ChangeLog:

* gdb.fortran/info-modules.exp: Rewrite to make use of new
sym-info-cmds library.
* gdb.fortran/info-types.exp: Likewise.
* lib/sym-info-cmds.exp: New file.

Change-Id: Iff81624f51b5afb6c95393932f3d94472d7c2970
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/info-modules.exp
gdb/testsuite/gdb.fortran/info-types.exp
gdb/testsuite/lib/sym-info-cmds.exp [new file with mode: 0644]
This page took 0.025307 seconds and 4 git commands to generate.