Fortran print allocatable array in gdb

前端 未结 3 1387
梦谈多话
梦谈多话 2020-11-29 12:58

I\'m adding some functionality on to an open-source scientific code. I work with a lot of allocatables, but I\'m having some trouble printing them properly. For example, I d

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 13:36

    UPDATE: Works out-of-the-box in Ubuntu 16.04 LTS

    The issue is being discussed for almost a decade already (e.g. https://sourceware.org/bugzilla/show_bug.cgi?id=9395) and is partially fixed in some distros. I have reported the same problem in gdb that comes with Ubuntu 14.04 LTS. The workaround was in a similar fashion as Francois Jacq suggested here, but without damaging dpkg-controlled directories.

    I have used alien tool from native Ubuntu repo to convert a gdb RPM from Fedora (namely GNU gdb (GDB) Fedora 7.9-10.fc23) into .deb package, and then used dpkg to install it. Now i have installed gdb-7.9.1-7.1.x86_64.rpm from OpenSUSE in a similar manner:

    fakeroot alien gdb-7.9.1-7.1.x86_64.rpm
    sudo dpkg -i gdb_7.9.1-8.1_amd64.deb
    

    In many cases it works correctly with simple pointers and allocatable arrays. Though segfaults of gdb are often when trying to touch large and/or complex structures. Probably, that is why many maintainers prefer not to include the fortran patch into mainstream...

    Please consider confirming the bug in your distro bug trackers, so maintainers will pay more attention to it.

提交回复
热议问题