[PATCH ver 2] PowerPC: fix _Float128 type output string
Tom Tromey
tom@tromey.com
Thu Apr 13 14:18:59 GMT 2023
>>>>> "Carl" == Carl Love via Gdb-patches <gdb-patches@sourceware.org> writes:
Carl> PowerPC supports two 128-bit floating point formats, the IBM long double
Carl> and IEEE 128-bit float. The issue is the DWARF information does not
Carl> distinguish between the two. There have been proposals of how to extend
Carl> the DWARF information as discussed in
Carl> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104194
Carl> but has not been fully implemented.
Could it be? I didn't read the issue but it's often better to put in
the effort to fix the problem in the compiler. Normally once these
workarounds go into gdb, they can never be removed.
Carl> This patch fixes 74 regression test failures in
Carl> gdb.base/whatis-ptype-typedefs.exp on PowerPC with IEEE float 128 as the
Carl> default on GCC. It fixes one regression test failure in
Carl> gdb.base/complex-parts.exp.
I don't really understand how this patch works.
It took me a while to understand that maybe the issue is that the
association between a gdb type and a float format is done by name and
size, and because this is a typedef, the association is done instead by
the underlying type -- which is then wrong.
However, doesn't copy_type also copy the TYPE_FLOATFORMAT field?
So where would this get reset?
Or maybe this isn't the problem at all, but then I don't understand what
it would be.
Carl> +# The DWARF info currently does not distinquish between IEEE 128-bit floating
Carl> +# point values and the IBM 128-bit floating point format. GCC has an internal
Carl> +# hack that uses the _Float128 base typdef for IEEE 128-bit float values. The
Carl> +# following method is used to "fix" the long double typedef so the _Float128
Carl> +# name is not printed.
Carl> +Function(
Carl> + comment="""
Carl> +Return true if the typedef record needs to be replaced.".
Carl> +
Carl> +Return 0 by default""",
I think the comment field could be reworded to be more clear.
I guess the idea is that some typedefs are replaced by their target
type, but given the typedef's name.
Carl> +bool
Carl> +linux_dwarf2_omit_typedef_p (struct type *target_type,
Carl> + const char *producer, const char *name)
I think this can be 'static'.
Tom
More information about the Gdb-patches
mailing list