binutils-gdb/gdb/testsuite/gdb.mi
Keven Boell 3f2f83ddcb fort_dyn_array: add basic fortran dyn array support
Fortran provide types whose values may be dynamically allocated
or associated with a variable under explicit program control.
The purpose of this commit is:

  * to read allocated/associated DWARF tags and store them in
    the dynamic property list of main_type.

  * enable GDB to print the value of a dynamic array in Fortran
    in case the type is allocated or associated (pointer to
    dynamic array).

Examples:
    (gdb) p vla_not_allocated
    $1 = <not allocated>

    (gdb) p vla_allocated
    $1 = (1, 2, 3)

    (gdb) p vla_ptr_not_associated
    $1 = <not associated>

    (gdb) p vla_ptr_associated
    $1 = (1, 2, 3)

Add basic test coverage for most dynamic array use-cases in Fortran.
The commit contains the following tests:
  * Ensure that values of Fortran dynamic arrays
    can be evaluated correctly in various ways and states.
  * Ensure that Fortran primitives can be evaluated
    correctly when used as a dynamic array.
  * Dynamic arrays passed to subroutines and handled
    in different ways inside the routine.
  * Ensure that the ptype of dynamic arrays in
    Fortran can be printed in GDB correctly.
  * Ensure that dynamic arrays in different states
    (allocated/associated) can be evaluated.
  * Dynamic arrays passed to functions and returned from
    functions.
  * History values of dynamic arrays can be accessed and
    printed again with the correct values.
  * Dynamic array evaluations using MI protocol.
  * Sizeof output of dynamic arrays in various states.

The patch was tested using the test suite on Ubuntu 12.04 64bit.

gdb/ChangeLog:

        * dwarf2read.c (set_die_type): Add read of
        DW_AT_allocated and DW_AT_associated.
        * f-typeprint.c: New include of typeprint.h
        (f_print_type): Add check for allocated/associated
        status of type.
        (f_type_print_varspec_suffix): Add check for
        allocated/associated status of type.
        * gdbtypes.c (create_array_type_with_stride):
        Add check for valid data location of type in
        case allocated or associated attributes are set.
        Length of an array should be only calculated if
        allocated or associated is resolved as true.
        (is_dynamic_type_internal): Add check for allocated/
        associated.
        (resolve_dynamic_array): Evaluate allocated/associated
        properties.
        * gdbtypes.h (enum dynamic_prop_node_kind): <DYN_PROP_ALLOCATED>
        <DYN_PROP_ASSOCIATED>: New enums.
        (TYPE_ALLOCATED_PROP, TYPE_ASSOCIATED_PROP): New macros.
        (type_not_allocated): New function.
        (type_not_associated): New function.
        * valarith.c (value_subscripted_rvalue): Add check for
        allocated/associated.
        * valprint.c: New include of typeprint.h.
        (valprint_check_validity): Add check for allocated/associated.
        (value_check_printable): Add check for allocated/
        associated.
        * typeprint.h (val_print_not_allocated): New function.
        (val_print_not_associated): New function.
        * typeprint.c (val_print_not_allocated): New function.
        (val_print_not_associated): New function.

gdb/testsuite/ChangeLog:

        * gdb.fortran/vla-alloc-assoc.exp: New file.
        * gdb.fortran/vla-datatypes.exp: New file.
        * gdb.fortran/vla-datatypes.f90: New file.
        * gdb.fortran/vla-history.exp: New file.
        * gdb.fortran/vla-ptype-sub.exp: New file.
        * gdb.fortran/vla-ptype.exp: New file.
        * gdb.fortran/vla-sizeof.exp: New file.
        * gdb.fortran/vla-sub.f90: New file.
        * gdb.fortran/vla-value-sub-arbitrary.exp: New file.
        * gdb.fortran/vla-value-sub-finish.exp: New file.
        * gdb.fortran/vla-value-sub.exp: New file.
        * gdb.fortran/vla-value.exp: New file.
        * gdb.fortran/vla-ptr-info.exp: New file.
        * gdb.mi/mi-vla-fortran.exp: New file.
        * gdb.mi/vla.f90: New file.
2015-10-21 15:37:46 -04:00
..
ChangeLog-1999-2003
Makefile.in Fix breakpoint thread condition missing with mi and a pending breakpoint. 2015-03-24 08:38:49 -04:00
array.f Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
basics.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
dw2-ref-missing-frame-func.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
dw2-ref-missing-frame-main.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
dw2-ref-missing-frame.S Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
dw2-ref-missing-frame.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb669.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb680.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb701.c
gdb701.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb792.cc
gdb792.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
gdb2549.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-async.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-basics.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-break.exp Explicit locations: MI support for explicit locations 2015-08-11 17:09:36 -07:00
mi-breakpoint-changed.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-catch-load-so.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-catch-load.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-catch-load.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cli.exp Generalize breakpoint pattern in gdb.mi/mi-cli.exp. 2015-09-18 09:39:31 -07:00
mi-cmd-param-changed.exp Rename dwarf2 to dwarf in "set debug" and maintenance commands. 2015-05-26 16:50:57 -07:00
mi-condbreak-call-thr-state-mt.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-condbreak-call-thr-state-st.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-condbreak-call-thr-state.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-condbreak-call-thr-state.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-console.c GDB testsuite: Fix warnings with -std=gnu11 2014-11-13 10:20:44 +01:00
mi-console.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-detach.exp Fix =thread-exited not showing up when detaching (PR 15564) 2015-06-02 15:32:57 -04:00
mi-disassemble.exp New /s modifier for the disassemble command. 2015-08-14 21:45:54 -07:00
mi-dprintf-pending.c Fix MI dprintf-insert not printing on a resolved pending location. 2015-06-12 08:43:17 -04:00
mi-dprintf-pending.exp Generalize filename pattern in gdb.mi/mi-dprintf-pending.exp. 2015-09-18 09:22:02 -07:00
mi-dprintf-pendshr.c Fix MI dprintf-insert not printing on a resolved pending location. 2015-06-12 08:43:17 -04:00
mi-dprintf.c Unbuffer all tests that rely on stdio 2015-07-29 11:09:45 +01:00
mi-dprintf.exp Explicit locations: MI support for explicit locations 2015-08-11 17:09:36 -07:00
mi-eval.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-exit-code.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-exit-code.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-file-transfer.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-file.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-fill-memory.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-fullname-deleted.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-hack-cli.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-i-cmd.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-info-os.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-inheritance-syntax-error.cc
mi-inheritance-syntax-error.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-language.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-logging.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-memory-changed.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-nonstop-exit.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-nonstop.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-ns-stale-regcache.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-nsintrall.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-nsmoribund.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-nsthrexec.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-pending.c gdb.mi/mi-pending.c: Return NULL instead of nothing in thread function 2015-07-27 15:49:24 -04:00
mi-pending.exp Fix pathname prefix and timeout issues in gdb.mi/mi-pending.exp. 2015-09-18 11:52:26 -07:00
mi-pendshr.c Fix breakpoint thread condition missing with mi and a pending breakpoint. 2015-03-24 08:38:49 -04:00
mi-pendshr2.c Fix breakpoint thread condition missing with mi and a pending breakpoint. 2015-03-24 08:38:49 -04:00
mi-pthreads.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-read-memory.c
mi-read-memory.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-record-changed.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-reg-undefined.S Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-reg-undefined.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-reg-undefined.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-regs.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-return.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-reverse.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-simplerun.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-solib.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-stack.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-stack.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-start.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-start.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-stepi.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-stepn.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-stepn.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-syn-frame.c GDB testsuite: Fix warnings with -std=gnu11 2014-11-13 10:20:44 +01:00
mi-syn-frame.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-undefined-cmd.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-until.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-block.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-child-f.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-child.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-child.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-cmd.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-cp.cc Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-cp.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-create-rtti.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-create-rtti.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-display.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-invalidate.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-list-children-invalid-grandchild.c Catch exception in value_rtti_indirect_type 2015-01-23 12:59:24 -05:00
mi-var-list-children-invalid-grandchild.exp Catch exception in value_rtti_indirect_type 2015-01-23 12:59:24 -05:00
mi-var-rtti.cc Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-var-rtti.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-vla-c99.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-vla-fortran.exp fort_dyn_array: add basic fortran dyn array support 2015-10-21 15:37:46 -04:00
mi-watch-nonstop.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-watch.exp Remove xfail in gdb.mi/mi-watch.exp 2015-07-27 15:02:37 -04:00
mi2-amd64-entry-value.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi2-amd64-entry-value.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi2-amd64-entry-value.s Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi2-prompt.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi2-var-child.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
non-stop-exit.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
non-stop.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
ns-stale-regcache.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
nsintrall.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
nsmoribund.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
nsthrexec.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
pending.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pendshr1.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pendshr2.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pr11022.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pr11022.exp Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
pthreads.c Remove testsuite compile errors with GCC5. 2015-01-25 18:50:56 +01:00
solib-lib.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
solib-main.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
testcmds
until.c Eliminate literal line numbers in mi-until.exp 2014-11-17 10:26:30 +01:00
var-cmd.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
vla.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
vla.f90 fort_dyn_array: add basic fortran dyn array support 2015-10-21 15:37:46 -04:00
watch-nonstop.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00