From 9920b4348edbdd83e3f91c85d7174cb92bba204d Mon Sep 17 00:00:00 2001 From: Bernhard Heckel Date: Tue, 26 Apr 2016 16:28:43 +0200 Subject: fort_dyn_array: Enable dynamic member types inside a structure. Fortran supports dynamic types for which bounds, size and location can vary during their lifetime. As a result of the dynamic behaviour, they have to be resolved at every query. This patch will resolve the type of a structure field when it is dynamic. 2016-04-26 Bernhard Heckel 2016-04-26 Keven Boell Before: (gdb) print threev%ivla(1) Cannot access memory at address 0x3 (gdb) print threev%ivla(5) no such vector element After: (gdb) print threev%ivla(1) $9 = 1 (gdb) print threev%ivla(5) $10 = 42 gdb/Changelog: * NEWS: Add new supported features for fortran. * gdbtypes.c (remove_dyn_prop): New. (resolve_dynamic_struct): Keep type length for fortran structs. * gdbtypes.h: Forward declaration of new function. * value.c (value_address): Return dynamic resolved location of a value. (set_value_component_location): Adjust the value address for single value prints. (value_primitive_field): Support value types with a dynamic location. (set_internalvar): Remove dynamic location property of internal variables. gdb/testsuite/Changelog: * gdb.fortran/vla-type.f90: New file. * gdb.fortran/vla-type.exp: New file. --- gdb/gdbtypes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/gdbtypes.h') diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 1518a7ad82..c651c88a5b 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1826,6 +1826,9 @@ extern void add_dyn_prop (enum dynamic_prop_node_kind kind, struct dynamic_prop prop, struct type *type, struct objfile *objfile); +extern void remove_dyn_prop (enum dynamic_prop_node_kind prop_kind, + struct type *type); + extern struct type *check_typedef (struct type *); extern void check_stub_method_group (struct type *, int); -- cgit v1.2.3