binutils-gdb/gdb/testsuite/gdb.fortran
Andrew Burgess 584a927c5a gdb/fortran: Show the type for non allocated / associated types
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.
2019-06-16 00:29:35 +01:00
..
array-bounds.exp Allow really large fortran array bounds: fortran type/value printers 2019-03-29 10:35:19 -07:00
array-bounds.f90 Allow really large fortran array bounds: fortran type/value printers 2019-03-29 10:35:19 -07:00
array-element.exp
array-element.f
block-data.exp Dwarf: Don't add nameless modules to partial symbol table 2019-06-11 19:20:09 +01:00
block-data.f Dwarf: Don't add nameless modules to partial symbol table 2019-06-11 19:20:09 +01:00
charset.exp
charset.f90
common-block.exp
common-block.f90
complex.exp gdb/fortran: Use floatformats_ia64_quad for fortran 16-byte floats 2019-05-18 09:49:02 +01:00
complex.f90 gdb/fortran: better types for components of complex numbers 2019-04-30 10:10:31 +01:00
derived-type-function.exp
derived-type-function.f90
derived-type.exp
derived-type.f90
dot-ops.exp gdb/fortran: Simplify handling of Fortran dot operations and keywords 2019-03-06 18:11:31 +00:00
exprs.exp gdb/fortran: Print 'void' type in lower case 2019-04-30 10:17:01 +01:00
function-calls.exp Fortran function calls with arguments 2019-03-06 08:24:12 +00:00
function-calls.f90 Fortran function calls with arguments 2019-03-06 08:24:12 +00:00
intrinsics.exp gdb/fortran: Additional builtin procedures 2019-04-30 10:10:24 +01:00
intrinsics.f90 gdb/fortran: Add Fortran 'kind' intrinsic and keyword 2019-03-06 18:11:31 +00:00
library-module-lib.f90
library-module-main.f90
library-module.exp
logical.exp
logical.f90
max-depth.exp gdb: Introduce 'print max-depth' feature 2019-04-29 22:01:09 +01:00
max-depth.f90 gdb: Introduce 'print max-depth' feature 2019-04-29 22:01:09 +01:00
module.exp
module.f90
multi-dim.exp
multi-dim.f90
nested-funcs.exp
nested-funcs.f90
pointers.f90 gdb/fortran: Show the type for non allocated / associated types 2019-06-16 00:29:35 +01:00
print-formatted.exp
print-formatted.f90
print_type.exp gdb/fortran: Show the type for non allocated / associated types 2019-06-16 00:29:35 +01:00
printing-types.exp gdb/fortran: Use floatformats_ia64_quad for fortran 16-byte floats 2019-05-18 09:49:02 +01:00
printing-types.f90 gdb/fortran: Use floatformats_ia64_quad for fortran 16-byte floats 2019-05-18 09:49:02 +01:00
ptr-indentation.exp gdb/fortran: Update rules for printing whitespace in types 2019-04-30 10:36:56 +01:00
ptr-indentation.f90
ptype-on-functions.exp gdb/fortran: Update rules for printing whitespace in types 2019-04-30 10:36:56 +01:00
ptype-on-functions.f90 gdb/fortran: print function arguments when printing function type 2019-04-30 10:34:26 +01:00
short-circuit-argument-list.exp
short-circuit-argument-list.f90
subarray.exp
subarray.f
type-kinds.exp gdb/fortran: Use floatformats_ia64_quad for fortran 16-byte floats 2019-05-18 09:49:02 +01:00
type.f90
types.exp gdb/fortran: Cleanup code for parsing logical constants 2019-03-06 18:11:30 +00:00
vla-alloc-assoc.exp
vla-datatypes.exp gdb/fortran: Add allocatable type qualifier 2019-04-30 10:36:57 +01:00
vla-datatypes.f90
vla-history.exp
vla-ptr-info.exp gdb/fortran: Update rules for printing whitespace in types 2019-04-30 10:36:56 +01:00
vla-ptype-sub.exp
vla-ptype.exp gdb/fortran: Show the type for non allocated / associated types 2019-06-16 00:29:35 +01:00
vla-sizeof.exp gdb: Check for not allocated/associated values during array slicing 2019-06-10 23:05:58 +01:00
vla-sub.f90
vla-type.exp gdb/fortran: Show the type for non allocated / associated types 2019-06-16 00:29:35 +01:00
vla-type.f90
vla-value-sub-arbitrary.exp
vla-value-sub-finish.exp
vla-value-sub.exp
vla-value.exp gdb/fortran: Show the type for non allocated / associated types 2019-06-16 00:29:35 +01:00
vla.f90
whatis_type.exp