8sa1-binutils-gdb/gdb/testsuite/gdb.fortran
Andrew Burgess 5e5d66b6a4 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.
2020-03-03 18:20:18 +00:00
..
array-bounds-high.exp Fixed gdb to print arrays with very high indexes 2020-02-03 20:24:34 -05:00
array-bounds-high.f90 Fixed gdb to print arrays with very high indexes 2020-02-03 20:24:34 -05:00
array-bounds.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
array-bounds.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
array-element.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
array-element.f Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
array-slices.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
array-slices.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
block-data.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
block-data.f Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
charset.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
charset.f90
common-block.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
common-block.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
complex.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
complex.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
derived-type-function.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
derived-type-function.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
derived-type-striding.exp gdb/fortran: Support negative array stride in one limited case 2020-02-25 16:03:22 +00:00
derived-type-striding.f90 gdb/fortran: Support negative array stride in one limited case 2020-02-25 16:03:22 +00:00
derived-type.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
derived-type.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
dot-ops.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
exprs.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
function-calls.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
function-calls.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
info-modules.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
info-types-2.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
info-types.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
info-types.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
intrinsics.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
intrinsics.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
library-module-lib.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
library-module-main.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
library-module.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
logical.exp gdb/fortran: Fix printing of logical true values for Flang 2020-03-03 18:20:18 +00:00
logical.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
max-depth.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
max-depth.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
module.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
module.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multi-dim.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
multi-dim.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
nested-funcs-2.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
nested-funcs-2.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
nested-funcs.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
nested-funcs.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
pointers.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
print_type.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
print-formatted.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
print-formatted.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
printing-types.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
printing-types.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
ptr-indentation.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
ptr-indentation.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
ptype-on-functions.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
ptype-on-functions.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
short-circuit-argument-list.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
short-circuit-argument-list.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
subarray.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
subarray.f Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
type-kinds.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
type.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
types.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-alloc-assoc.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-datatypes.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-datatypes.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-history.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-ptr-info.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-ptype-sub.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-ptype.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-sizeof.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-sub.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-type.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-type.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-value-sub-arbitrary.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-value-sub-finish.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-value-sub.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla-value.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
vla.f90 Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00
whatis_type.exp Update copyright year range in all GDB files. 2020-01-01 10:20:53 +04:00