public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/23051] internal-error for printing the contents of an allocated pointer of a derived type that contains an allocated pointer array
       [not found] <bug-23051-4717@http.sourceware.org/bugzilla/>
@ 2020-07-13 13:28 ` andrew.burgess at embecosm dot com
  2020-07-25  0:30 ` cvs-commit at gcc dot gnu.org
  2020-07-25  0:32 ` andrew.burgess at embecosm dot com
  2 siblings, 0 replies; 3+ messages in thread
From: andrew.burgess at embecosm dot com @ 2020-07-13 13:28 UTC (permalink / raw)
  To: gdb-prs

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

Andrew Burgess <andrew.burgess at embecosm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew.burgess at embecosm dot com

--- Comment #5 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
This issue is resolved by the patches I posted here:
  https://sourceware.org/pipermail/gdb-patches/2020-July/170333.html

I'll update the ChangeLog for those patches to ensure I reference this bug, and
I'll extend the patch to include tests that cover this issue too.

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

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

* [Bug fortran/23051] internal-error for printing the contents of an allocated pointer of a derived type that contains an allocated pointer array
       [not found] <bug-23051-4717@http.sourceware.org/bugzilla/>
  2020-07-13 13:28 ` [Bug fortran/23051] internal-error for printing the contents of an allocated pointer of a derived type that contains an allocated pointer array andrew.burgess at embecosm dot com
@ 2020-07-25  0:30 ` cvs-commit at gcc dot gnu.org
  2020-07-25  0:32 ` andrew.burgess at embecosm dot com
  2 siblings, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-25  0:30 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Burgess <aburgess@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e79eb02f2f09baecffb144bac6804f975065466f

commit e79eb02f2f09baecffb144bac6804f975065466f
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Thu Jul 9 16:26:23 2020 +0100

    gdb/fortran: resolve dynamic types when readjusting after an indirection

    After dereferencing a pointer (in value_ind) or following a
    reference (in coerce_ref) we call readjust_indirect_value_type to
    "fixup" the type of the resulting value object.

    This fixup handles cases relating to the type of the resulting object
    being different (a sub-class) of the original pointers target type.

    If we encounter a pointer to a dynamic type then after dereferencing a
    pointer (in value_ind) the type of the object created will have had
    its dynamic type resolved.  However, in readjust_indirect_value_type,
    we use the target type of the original pointer to "fixup" the type of
    the resulting value.  In this case, the target type will be a dynamic
    type, so the resulting value object, once again has a dynamic type.

    This then triggers an assertion later within GDB.

    The solution I propose here is that we call resolve_dynamic_type on
    the pointer's target type (within readjust_indirect_value_type) so
    that the resulting value is not converted back to a dynamic type.

    The test case is based on the original test in the bug report.

    gdb/ChangeLog:

            PR fortran/23051
            PR fortran/26139
            * valops.c (value_ind): Pass address to
            readjust_indirect_value_type.
            * value.c (readjust_indirect_value_type): Make parameter
            non-const, and add extra address parameter.  Resolve original type
            before using it.
            * value.h (readjust_indirect_value_type): Update function
            signature and comment.

    gdb/testsuite/ChangeLog:

            PR fortran/23051
            PR fortran/26139
            * gdb.fortran/class-allocatable-array.exp: New file.
            * gdb.fortran/class-allocatable-array.f90: New file.
            * gdb.fortran/pointer-to-pointer.exp: New file.
            * gdb.fortran/pointer-to-pointer.f90: New file.

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

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

* [Bug fortran/23051] internal-error for printing the contents of an allocated pointer of a derived type that contains an allocated pointer array
       [not found] <bug-23051-4717@http.sourceware.org/bugzilla/>
  2020-07-13 13:28 ` [Bug fortran/23051] internal-error for printing the contents of an allocated pointer of a derived type that contains an allocated pointer array andrew.burgess at embecosm dot com
  2020-07-25  0:30 ` cvs-commit at gcc dot gnu.org
@ 2020-07-25  0:32 ` andrew.burgess at embecosm dot com
  2 siblings, 0 replies; 3+ messages in thread
From: andrew.burgess at embecosm dot com @ 2020-07-25  0:32 UTC (permalink / raw)
  To: gdb-prs

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

Andrew Burgess <andrew.burgess at embecosm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
This issue should now be resolved.

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

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23051-4717@http.sourceware.org/bugzilla/>
2020-07-13 13:28 ` [Bug fortran/23051] internal-error for printing the contents of an allocated pointer of a derived type that contains an allocated pointer array andrew.burgess at embecosm dot com
2020-07-25  0:30 ` cvs-commit at gcc dot gnu.org
2020-07-25  0:32 ` andrew.burgess at embecosm 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).