]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PowerPC: fix _Float128 type output string
authorCarl Love <cel@us.ibm.com>
Thu, 23 Mar 2023 22:23:05 +0000 (18:23 -0400)
committerCarl Love <cel@us.ibm.com>
Tue, 18 Apr 2023 15:03:08 +0000 (11:03 -0400)
commitc1a398a320f46905eaf6f520dddc441791861dcb
treecc83eb566cd1183ca7e6d94c6a755d997a2987a4
parenta02676b77d84d8229b5d4b01259535234cded19e
PowerPC: fix _Float128 type output string

PowerPC supports two 128-bit floating point formats, the IBM long double
and IEEE 128-bit float.  The issue is the DWARF information does not
distinguish between the two.  There have been proposals of how to extend
the DWARF information as discussed in

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104194

but has not been fully implemented.

GCC introduced the _Float128 internal type as a work around for the issue.
The workaround is not transparent to GDB.  The internal _Float128 type
name is printed rather then the user specified long double type.  This
patch adds a new gdbarch method to allow PowerPC to detect the GCC
workaround.  The workaround checks for "_Float128" name when reading the
base typedef from the die_info.  If the workaround is detected, the type
and format fields from the _Float128 typedef are copied to the long
double typedef.  The same is done for the complex long double typedef.

This patch fixes 74 regression test failures in
gdb.base/whatis-ptype-typedefs.exp on PowerPC with IEEE float 128 as the
default on GCC.  It fixes one regression test failure in
gdb.base/complex-parts.exp.

The patch has been tested on Power 10 where GCC defaults to IEEE Float
128-bit and on Power 10 where GCC defaults to the IBM 128-bit float.  The
patch as also been tested on X86-64 with no new regression failures.
gdb/arch-utils.c
gdb/arch-utils.h
gdb/dwarf2/read.c
gdb/gdbarch-gen.h
gdb/gdbarch.c
gdb/gdbarch_components.py
gdb/ppc-linux-tdep.c