[PATCHv2] gdb/fortran: Don't access non-existent type fields

Tom Tromey tom@tromey.com
Tue Oct 20 19:32:55 GMT 2020


>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> Updated for latest GDB master.  Things have moved around a bit, but no
Andrew> significant code changes.

Andrew> No changes at all in docs since v1.

This contents of the patch seem fine to me.
I just wanted to note something about the direction.

Andrew>     When considering what was the "correct" default to assume I struggled
Andrew>     to decide, both assumptions seem to have advantages.

In C what is done now is to make the default case an error, and then
require the user to cast the function to the correct type.  This way
return types are handled correctly as well.

I'm sure you recall but this used to be different, and gdb just assumed
that functions returned int, which was an ongoing source of confusion.
I wonder whether this setting will also cause confusion.

I don't know Fortran, so I don't know if the C approach is available.
I suppose not; in which case this seems reasonable enough.

Tom


More information about the Gdb-patches mailing list