This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Status of GDB support for debugging of Fortran programs?


On 09/04/2012 09:16 PM, Harald Anlauf wrote:
does anybody know whether there has been any progress in GDB
that supports debugging of Fortran programs on Linux/x86?

Yes, but only slowly: Support for modules is in GDB 7.2 (use: print 'mod1::myvar') as is support for UCS-4 strings (character(kind=4)).


Are there some secret patches that are needed to get it working?

Yes - but they don't help with your problem.


The unpatched GDB from Sourceware.org doesn't support Fortran 90 style arrays which use an array descriptor (assumed-shape, deferred-shape, assumed-rank) - nor does it support the similar but rarely used C99 varying length arrays (VLA). Jan Kratochvil of Red Hat has some patches (the initial version is from 2007/2008) which add support for those arrays, but they do not work in all cases - such as yours.

Jan believes that the current approach is not the best one and, thus, he doesn't want to spend time on the current approach. He does intent to work on a new implementation, but so far he hadn't the time to do so. At the GNU Tools Cauldron in Prague he said that he shifted some projects to someone else and hopes to have more time to work on this in the (near) future. For details, see also http://sourceware.org/ml/gdb/2011-03/msg00021.html and http://sourceware.org/gdb/wiki/ArcherBranchManagement

See also page 11 at http://gcc.gnu.org/wiki/cauldron2012?action=AttachFile&do=get&target=jkratoch.pdf (-> http://gcc.gnu.org/wiki/cauldron2012 ).

To a certain extend the problem seems to be that some big customers (of Red Hat, SUSE, etc.) don't put strong pressure/large financial incentive to their vendors to implement Fortran features. I think many bigger customers are using gfortran/gdb, but either they are happy with the current support or the issues don't escalate high enough in the hierarchy to reach the management. To a certain extent that's also because several most sites also have commercial compilers. [You also seem to use idb.] Given the complexity/size of, e.g., VLA, it simply takes a while to get it implemented, unless those project get rated with a very high priority.

I tried gdb-7.3 that comes with OpenSuse 12.1, as well as a
self-compiled gdb-7.5.

As the Red Hat/Fedora version contains at least some VLA/F90 array support, I recommend to avoid using the unpatched sourceware.org version. Note that (open)SUSE's gdb includes the VLA patches.


If you want to have a newer gdb (or GCC) on you openSUSE 12.1, you could use the builds from http://download.opensuse.org/repositories/devel:/gcc/openSUSE_12.1/

You find gdb 7.4.50 of July there. That version should match 7.5 (released 2012-08-17) minus a few later patches.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]