This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] fortran: Print logical values as either .FALSE. or .TRUE.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Christoph Weinmann <christoph dot t dot weinmann at intel dot com>
- Cc: qiyaoltc at gmail dot com, gdb-patches at sourceware dot org
- Date: Wed, 13 Jul 2016 10:03:21 +0200
- Subject: Re: [PATCH] fortran: Print logical values as either .FALSE. or .TRUE.
- Authentication-results: sourceware.org; auth=none
- References: <1468396596-19212-1-git-send-email-christoph.t.weinmann@intel.com>
On Wed, 13 Jul 2016 09:56:36 +0200, Christoph Weinmann wrote:
> A Logical value in Fortran may be either .FALSE. or .TRUE.
> When converting from integer, a subset of compilers evaluate
> the whole value, while others only check if the least significant
> bit is set. This patch unifies the printing output by evaluating
> only the lsb.
[...]
> + if ((val & 1) == 0)
> + fputs_filtered (f_decorations.false_name, stream);
> + else
> + fputs_filtered (f_decorations.true_name, stream);
Doesn't it need to check DW_AT_producer then? GDB already does that in some
cases.
If the compiler evaluates the whole value, val==16, then GDB will print
something different than what the compiler evaluates.
Jan