public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/26139] New: Cannot access allocatable array/pointer component of derived-type dummy argument
@ 2020-06-19 14:11 mani.e at protonmail dot com
  2020-07-08  9:41 ` [Bug fortran/26139] " mani.e at protonmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mani.e at protonmail dot com @ 2020-06-19 14:11 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26139

            Bug ID: 26139
           Summary: Cannot access allocatable array/pointer component of
                    derived-type dummy argument
           Product: gdb
           Version: 9.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: fortran
          Assignee: unassigned at sourceware dot org
          Reporter: mani.e at protonmail dot com
  Target Milestone: ---

I have encountered a problem while trying to debug Fortran code using gdb 8.1
and after installing gdb 9.2, it still persists. The bug is closely related to
#23051. The following MWE helps demonstrate the issue:

```Fortran
module test_module
        type test_type
                integer a
                real, allocatable :: b(:, :)
                contains
                procedure :: test_proc
        end type

        contains
        subroutine test_proc(this)
                class(test_type), intent(inout) :: this
                allocate(this%b(3, 2))
                this%b = 0
        end subroutine
end module

program test
        use test_module
        implicit none

        type(test_type) :: t

        call t%test_proc()
end program test
```

When trying to access the allocated component of the dummy argument ```this```
in gdb, the following error occurs:

Breakpoint 1, test_module::test_proc (this=...) at test.f90:13
13                      this%b = 0
(gdb) print this
$1 = ( _data = 0x8202060 <t>, _vptr = 0x8201d40
<__test_module_MOD___vtab_test_module_Test_type> )
(gdb) print this%_data%a
$2 = 0
(gdb) print this%_data%b
../../gdb/value.c:2988: internal-error: value* value_primitive_field(value*,
LONGEST, int, type*): Assertion `PROP_CONST == TYPE_DATA_LOCATION_KIND (type)'
failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

Accessing simple scalar components like ```a``` is not an issue. I could work
around this issue by hand (which is cumbersome), but I need gdb to be
integrated with GUI tools.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-25 10:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 14:11 [Bug fortran/26139] New: Cannot access allocatable array/pointer component of derived-type dummy argument mani.e at protonmail dot com
2020-07-08  9:41 ` [Bug fortran/26139] " mani.e at protonmail dot com
2020-07-13 13:29 ` andrew.burgess at embecosm dot com
2020-07-25  0:30 ` cvs-commit at gcc dot gnu.org
2020-07-25  0:33 ` andrew.burgess at embecosm dot com
2020-07-25 10:24 ` mani.e at protonmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).