mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-11 13:02:10 +08:00
Show the type of not-allocated and/or not-associated types. For array types and pointer to array types we are going to print the number of ranks. Consider this Fortran program: program test integer, allocatable :: vla (:) logical l allocate (vla(5:12)) l = allocated (vla) end program test And this GDB session with current HEAD: (gdb) start ... 2 integer, allocatable :: vla (:) (gdb) n 4 allocate (vla(5:12)) (gdb) ptype vla type = <not allocated> (gdb) p vla $1 = <not allocated> (gdb) And the same session with this patch applied: (gdb) start ... 2 integer, allocatable :: vla (:) (gdb) n 4 allocate (vla(5:12)) (gdb) ptype vla type = integer(kind=4), allocatable (:) (gdb) p vla $1 = <not allocated> (gdb) The type of 'vla' is now printed correctly, while the value itself still shows as '<not allocated>'. How GDB prints the type of associated pointers has changed in a similar way. gdb/ChangeLog: * f-typeprint.c (f_print_type): Don't return early for not associated or not allocated types. (f_type_print_varspec_suffix): Add print_rank parameter and print ranks of array types in case they dangling. (f_type_print_base): Add print_rank parameter. gdb/testsuite/ChangeLog: * gdb.fortran/pointers.f90: New file. * gdb.fortran/print_type.exp: New file. * gdb.fortran/vla-ptype.exp: Adapt expected results. * gdb.fortran/vla-type.exp: Likewise. * gdb.fortran/vla-value.exp: Likewise. * gdb.mi/mi-vla-fortran.exp: Likewise. |
||
---|---|---|
.. | ||
array-bounds.exp | ||
array-bounds.f90 | ||
array-element.exp | ||
array-element.f | ||
block-data.exp | ||
block-data.f | ||
charset.exp | ||
charset.f90 | ||
common-block.exp | ||
common-block.f90 | ||
complex.exp | ||
complex.f90 | ||
derived-type-function.exp | ||
derived-type-function.f90 | ||
derived-type.exp | ||
derived-type.f90 | ||
dot-ops.exp | ||
exprs.exp | ||
function-calls.exp | ||
function-calls.f90 | ||
intrinsics.exp | ||
intrinsics.f90 | ||
library-module-lib.f90 | ||
library-module-main.f90 | ||
library-module.exp | ||
logical.exp | ||
logical.f90 | ||
max-depth.exp | ||
max-depth.f90 | ||
module.exp | ||
module.f90 | ||
multi-dim.exp | ||
multi-dim.f90 | ||
nested-funcs.exp | ||
nested-funcs.f90 | ||
pointers.f90 | ||
print_type.exp | ||
print-formatted.exp | ||
print-formatted.f90 | ||
printing-types.exp | ||
printing-types.f90 | ||
ptr-indentation.exp | ||
ptr-indentation.f90 | ||
ptype-on-functions.exp | ||
ptype-on-functions.f90 | ||
short-circuit-argument-list.exp | ||
short-circuit-argument-list.f90 | ||
subarray.exp | ||
subarray.f | ||
type-kinds.exp | ||
type.f90 | ||
types.exp | ||
vla-alloc-assoc.exp | ||
vla-datatypes.exp | ||
vla-datatypes.f90 | ||
vla-history.exp | ||
vla-ptr-info.exp | ||
vla-ptype-sub.exp | ||
vla-ptype.exp | ||
vla-sizeof.exp | ||
vla-sub.f90 | ||
vla-type.exp | ||
vla-type.f90 | ||
vla-value-sub-arbitrary.exp | ||
vla-value-sub-finish.exp | ||
vla-value-sub.exp | ||
vla-value.exp | ||
vla.f90 | ||
whatis_type.exp |