aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-tdep.h
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2017-11-21 18:50:59 +0100
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2017-11-21 18:50:59 +0100
commited0f427344d0befead629d9267aecd01bfb72721 (patch)
tree28c66c138b903afe536bef7624c66ab70e8c06f2 /gdb/ppc-tdep.h
parenta25d69c6dcbabf3f6629b847246ffb4ddbc29472 (diff)
downloadgdb-ed0f427344d0befead629d9267aecd01bfb72721.zip
gdb-ed0f427344d0befead629d9267aecd01bfb72721.tar.gz
gdb-ed0f427344d0befead629d9267aecd01bfb72721.tar.bz2
[PowerPC] Detect different long double floating-point formats
Current versions of GCC support switching the format used for "long double" to either IBM double double or IEEE-128. The resulting binary is marked via different setting of the Tag_GNU_Power_ABI_FP GNU attribute. This patch checks this attribute to detect the format of the default "long double" type and sets GDB's notion of the format accordingly. The patch also adds support for the "__ibm128" type, which always uses IBM double double format independent of the format used for "long double". A new test case verifies that all three types, "long double", "__float128", and "__ibm128" are correctly detected in all three compiler settings, the default setting, -mabi=ieeelongdouble, and -mabi=ibmlongdouble. gdb/ChangeLog: 2017-11-21 Ulrich Weigand <uweigand@de.ibm.com> * ppc-tdep.h (enum powerpc_long_double_abi): New data type. (struct gdbarch_tdep): New member long_double_abi. * rs6000-tdep.c (rs6000_gdbarch_init): Initialize long_double_abi member of tdep struct based on Tag_GNU_Power_ABI_FP attribute. * ppc-linux-tdep.c (ppc_linux_init_abi): Install long double data format depending on long_double_abi tdep member. (ppc_floatformat_for_type): Handle __ibm128 type. gdb/testsuite/ChangeLog: 2017-11-21 Ulrich Weigand <uweigand@de.ibm.com> * gdb.arch/ppc-longdouble.exp: New file. * gdb.arch/ppc-longdouble.c: Likewise.
Diffstat (limited to 'gdb/ppc-tdep.h')
-rw-r--r--gdb/ppc-tdep.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
index 4ae5c7f..3d1e327 100644
--- a/gdb/ppc-tdep.h
+++ b/gdb/ppc-tdep.h
@@ -202,6 +202,15 @@ enum powerpc_vector_abi
POWERPC_VEC_LAST
};
+/* long double ABI version used by the inferior. */
+enum powerpc_long_double_abi
+{
+ POWERPC_LONG_DOUBLE_AUTO,
+ POWERPC_LONG_DOUBLE_IBM128,
+ POWERPC_LONG_DOUBLE_IEEE128,
+ POWERPC_LONG_DOUBLE_LAST
+};
+
struct gdbarch_tdep
{
int wordsize; /* Size in bytes of fixed-point word. */
@@ -209,6 +218,9 @@ struct gdbarch_tdep
enum powerpc_elf_abi elf_abi; /* ELF ABI version. */
+ /* Format to use for the "long double" data type. */
+ enum powerpc_long_double_abi long_double_abi;
+
/* How to pass vector arguments. Never set to AUTO or LAST. */
enum powerpc_vector_abi vector_abi;