* [PATCH] gdb/fortran: Fix quad floating-point type for Intel compilers.
@ 2021-03-12 9:35 Felix Willgerodt
2021-03-15 9:50 ` Andrew Burgess
0 siblings, 1 reply; 3+ messages in thread
From: Felix Willgerodt @ 2021-03-12 9:35 UTC (permalink / raw)
To: gdb-patches, felix.willgerodt
Intel Fortran compilers emit the following DWARF for gdb.fortran/complex.c:
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-08 Felix Willgerodt <felix.willgerodt@intel.com>
* i386-tdep.c (i386_floatformat_for_type): Add COMPLEX*32 and REAL*16.
---
gdb/i386-tdep.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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.25.4
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb/fortran: Fix quad floating-point type for Intel compilers.
2021-03-12 9:35 [PATCH] gdb/fortran: Fix quad floating-point type for Intel compilers Felix Willgerodt
@ 2021-03-15 9:50 ` Andrew Burgess
2021-03-15 10:06 ` Willgerodt, Felix
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2021-03-15 9:50 UTC (permalink / raw)
To: Felix Willgerodt; +Cc: gdb-patches
* Felix Willgerodt via Gdb-patches <gdb-patches@sourceware.org> [2021-03-12 10:35:21 +0100]:
> Intel Fortran compilers emit the following DWARF for gdb.fortran/complex.c:
>
> 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-08 Felix Willgerodt <felix.willgerodt@intel.com>
>
> * i386-tdep.c (i386_floatformat_for_type): Add COMPLEX*32 and REAL*16.
Thanks for doing this.
LGTM.
Andrew
> ---
> gdb/i386-tdep.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> 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.25.4
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
> Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] gdb/fortran: Fix quad floating-point type for Intel compilers.
2021-03-15 9:50 ` Andrew Burgess
@ 2021-03-15 10:06 ` Willgerodt, Felix
0 siblings, 0 replies; 3+ messages in thread
From: Willgerodt, Felix @ 2021-03-15 10:06 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches
Thanks! I fixed the obvious file ending typo in the commit msg and pushed this.
Felix
-----Original Message-----
From: Andrew Burgess <andrew.burgess@embecosm.com>
Sent: Montag, 15. März 2021 10:51
To: Willgerodt, Felix <felix.willgerodt@intel.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/fortran: Fix quad floating-point type for Intel compilers.
* Felix Willgerodt via Gdb-patches <gdb-patches@sourceware.org> [2021-03-12 10:35:21 +0100]:
> Intel Fortran compilers emit the following DWARF for gdb.fortran/complex.c:
>
> 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-08 Felix Willgerodt <felix.willgerodt@intel.com>
>
> * i386-tdep.c (i386_floatformat_for_type): Add COMPLEX*32 and REAL*16.
Thanks for doing this.
LGTM.
Andrew
> ---
> gdb/i386-tdep.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> 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.25.4
>
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de> Managing
> Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
> Chairperson of the Supervisory Board: Nicole Lau Registered Office:
> Munich Commercial Register: Amtsgericht Muenchen HRB 186928
>
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-15 10:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 9:35 [PATCH] gdb/fortran: Fix quad floating-point type for Intel compilers Felix Willgerodt
2021-03-15 9:50 ` Andrew Burgess
2021-03-15 10:06 ` Willgerodt, Felix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).