binutils-gdb/gdb/testsuite/gdb.fortran
Andrew Burgess bc3c0632a2 gdb: call value_ind for pointers to dynamic types in UNOP_IND evaluation
When evaluating and expression containing UNOP_IND in mode
EVAL_AVOID_SIDE_EFFECTS, GDB currently (mostly) returns the result of
a call to value_zero meaning we get back an object with the correct
type, but its contents are all zero.

If the target type contains fields with dynamic type then in order to
resolve these dynamic fields GDB will need to read the value of the
field from within the parent object.  In this case the field value
will be zero as a result of the call to value_zero mentioned above.

The idea behind EVAL_AVOID_SIDE_EFFECTS is to avoid the chance that
doing something like `ptype` will modify state within the target, for
example consider: ptype i++.

However, there is already precedence within GDB that sometimes, in
order to get accurate type results, we can't avoid reading from the
target, even when EVAL_AVOID_SIDE_EFFECTS is in effect.  For example I
would point to eval.c:evaluate_var_value, the handling of OP_REGISTER,
the handling of value_x_unop in many places.  I believe the Ada
expression evaluator also ignore EVAL_AVOID_SIDE_EFFECTS in some
cases.

I am therefor proposing that, in the case where a pointer points at a
dynamic type, we allow UNOP_IND to perform the actual indirection.
This allows accurate types to be displayed in more cases.

gdb/ChangeLog:

	* eval.c (evaluate_subexp_standard): Call value_ind for points to
	dynamic types in UNOP_IND.

gdb/testsuite/ChangeLog:

	* gdb.fortran/pointer-to-pointer.exp: Additional tests.
2021-02-24 15:51:29 +00:00
..
allocated.exp gdb/fortran: support ALLOCATED builtin 2021-02-12 09:22:17 +00:00
allocated.f90 gdb/fortran: support ALLOCATED builtin 2021-02-12 09:22:17 +00:00
array-bounds-high.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-bounds-high.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-bounds.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-bounds.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-element.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-element.f Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-bad.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-bad.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-sub-slices.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-sub-slices.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices.exp gdb/testsuite: remove actual addresses from some test names 2021-01-18 17:06:12 +00:00
array-slices.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
block-data.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
block-data.f Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
charset.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
charset.f90
class-allocatable-array.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
class-allocatable-array.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-block.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-block.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
completion.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
completion.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
complex.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
complex.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
debug-expr.exp gdb: fix debug dump of OP_BOOL expressions 2021-01-12 09:44:08 +00:00
debug-expr.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-function.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-function.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-striding.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-striding.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
dot-ops.exp gdb/fortran: add symbol base comparison operators 2021-01-12 09:40:55 +00:00
exprs.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
function-calls.exp [gdb/symtab] Fix element type modification in read_array_type 2021-02-09 23:28:16 +01:00
function-calls.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-modules.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-types-2.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-types.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-types.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
intrinsics.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
intrinsics.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
intvar-array.exp gdb/fortran: Correct the lval type for array elements of internal vars 2021-01-08 09:54:21 +00:00
intvar-array.f90 gdb/fortran: Correct the lval type for array elements of internal vars 2021-01-08 09:54:21 +00:00
intvar-dynamic-types.exp gdb: user variables with components of dynamic type 2021-01-08 11:52:56 +00:00
intvar-dynamic-types.f90 gdb: user variables with components of dynamic type 2021-01-08 11:52:56 +00:00
lbound-ubound.exp gdb/testsuite: remove old comment 2021-02-11 11:32:09 +00:00
lbound-ubound.F90 gdb/fortran: add parser support for lbound and ubound 2021-02-10 16:03:49 +00:00
library-module-lib.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
library-module-main.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
library-module.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
logical.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
logical.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
max-depth.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
max-depth.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mixed-lang-stack.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mixed-lang-stack.cpp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mixed-lang-stack.exp [gdb/testsuite] Add KFAILs for PR symtab/24549 2021-02-05 10:56:39 +01:00
mixed-lang-stack.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
module.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
module.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
multi-dim.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
multi-dim.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs-2.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs-2.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
pointer-to-pointer.exp gdb: call value_ind for pointers to dynamic types in UNOP_IND evaluation 2021-02-24 15:51:29 +00:00
pointer-to-pointer.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
pointers.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print-formatted.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print-formatted.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print_type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
printing-types.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
printing-types.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptr-indentation.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptr-indentation.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptype-on-functions.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptype-on-functions.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
short-circuit-argument-list.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
short-circuit-argument-list.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
subarray.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
subarray.f Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
type-kinds.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
type.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
types.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-alloc-assoc.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-datatypes.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-datatypes.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-history.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-ptr-info.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-ptype-sub.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-ptype.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-sizeof.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-sub.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-type.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value-sub-arbitrary.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value-sub-finish.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value-sub.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
whatis_type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00