diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-03-02 18:08:49 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-03-03 18:20:18 +0000 |
commit | 5e5d66b6a46c7b0353308bfb508b96a59f1addbf (patch) | |
tree | 6f253eff4c7af4858fcf1bc0f2955a0b6f30f042 /gdb/ChangeLog | |
parent | 584cf46d0ab5960cca76bfaf414cee5641166868 (diff) | |
download | binutils-gdb-5e5d66b6a46c7b0353308bfb508b96a59f1addbf.tar.gz |
gdb/fortran: Fix printing of logical true values for Flang
GDB is not able to print logical true values for Flang compiler.
Actual result:
(gdb) p l
$1 = 4294967295
Expected result:
(gdb) p l
$1 = .TRUE.
This is due to GDB expecting representation of true value being 1.
The Fortran standard doesnt specify how LOGICAL types are represented.
Different compilers use different non-zero values to represent logical
true. The gfortran compiler uses 1 to represent logical true and the
flang compiler uses -1. GDB should accept all the non-zero values as
true.
This is achieved by handling TYPE_CODE_BOOL in f_val_print and
printing any non-zero value as true.
gdb/ChangeLog:
* f-valprint.c (f_val_print): Handle TYPE_CODE_BOOL, any non-zero
value should be printed as true.
gdb/testsuite/ChangeLog:
* gdb.fortran/logical.exp: Add tests that any non-zero value is
printed as true.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2a1f3be79af..2ab26d2ead9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-03-03 Andrew Burgess <andrew.burgess@embecosm.com> + Alok Kumar Sharma <AlokKumar.Sharma@amd.com> + + * f-valprint.c (f_val_print): Handle TYPE_CODE_BOOL, any non-zero + value should be printed as true. + 2020-03-03 Hannes Domani <ssbssa@yahoo.de> * windows-tdep.c (windows_solib_create_inferior_hook): New function. |