From 8d624a9d8050ca96e154215c7858ac5c2d8b0b19 Mon Sep 17 00:00:00 2001 From: Felix Willgerodt Date: Mon, 15 Mar 2021 11:00:28 +0100 Subject: [PATCH] gdb/fortran: Fix quad floating-point type for Intel compilers. Intel Fortran compilers emit the following DWARF for gdb.fortran/complex.f90: 0x00000071: DW_TAG_base_type DW_AT_name ("COMPLEX*32") DW_AT_encoding (DW_ATE_complex_float) DW_AT_byte_size (0x20) 0x00000078: DW_TAG_base_type DW_AT_name ("REAL*16") DW_AT_encoding (DW_ATE_float) DW_AT_byte_size (0x10) This results in GDB not reading the right values, as it wrongly assumes the default floatformat "floatformat_i387_ext" instead of "floatformat_ia64_quad_little". gdb/ChangeLog: 2021-03-15 Felix Willgerodt * i386-tdep.c (i386_floatformat_for_type): Add COMPLEX*32 and REAL*16. --- gdb/ChangeLog | 4 ++++ gdb/i386-tdep.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 59c8a399327..36f862a2c91 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2021-03-15 Felix Willgerodt + + * i386-tdep.c (i386_floatformat_for_type): Add COMPLEX*32 and REAL*16. + 2021-03-15 Andrew Burgess * python/python.c (gdbpy_source_objfile_script): Use diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 4f8da924073..2649fad08f2 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8162,9 +8162,12 @@ i386_floatformat_for_type (struct gdbarch *gdbarch, || strcmp (name, "_Float128") == 0 || strcmp (name, "complex _Float128") == 0 || strcmp (name, "complex(kind=16)") == 0 + || strcmp (name, "complex*32") == 0 + || strcmp (name, "COMPLEX*32") == 0 || strcmp (name, "quad complex") == 0 || strcmp (name, "real(kind=16)") == 0 - || strcmp (name, "real*16") == 0) + || strcmp (name, "real*16") == 0 + || strcmp (name, "REAL*16") == 0) return floatformats_ia64_quad; return default_floatformat_for_type (gdbarch, name, len); -- 2.30.2