summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.fortran
diff options
context:
space:
mode:
authorKeven Boell <keven.boell@intel.com>2016-04-26 16:46:48 +0200
committerBernhard Heckel <bernhard.heckel@intel.com>2016-04-26 16:48:41 +0200
commit3e2e34f8623d9eeb6710d8f3883f26af8b07bbd1 (patch)
tree5e0cd224f61544b60893753d07faf23998512670 /gdb/testsuite/gdb.fortran
parent8f07e298b16e6419a11f9e9d75b15658e42ea775 (diff)
fort_dyn_array: Use value constructor instead of raw-buffer manipulation.
Instead of pre-computing indices into a fortran array re-use the value_* interfaces to subscript a fortran array. The benefit of using the new interface is that it takes care of dynamic types and resolve them when needed. This fixes issues when printing structures with dynamic arrays from toplevel. Before: (gdb) p twov $1 = ( (( ( 6352320, 0, -66, -1, 267) ( 343476, 1, -15, 1, 0) ( 5, 0, 5, 0, 1) ... After: (gdb) p twov $1 = ( (( ( 1, 1, 1, 1, 1) ( 1, 1, 321, 1, 1) ( 1, 1, 1, 1, 1) ... 2016-04-26 Sanimir Agovic <sanimir.agovic@intel.com> Keven Boell <keven.boell@intel.com> Bernhard Heckel <bernhard.heckel@intel.com> gdb/Changelog: * f-valprint.c (f77_create_arrayprint_offset_tbl): Remove function. (F77_DIM_SIZE, F77_DIM_OFFSET): Remove macro. (f77_print_array_1): Use value_subscript to subscript a value array. (f77_print_array): Remove call to f77_create_arrayprint_offset_tbl. (f_val_print): Use value_field to construct a field value. gdb/testsuite/Changelog: * vla-type.exp: Print structure from toplevel.
Diffstat (limited to 'gdb/testsuite/gdb.fortran')
-rwxr-xr-xgdb/testsuite/gdb.fortran/vla-type.exp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp
index 011e27ea15..23c287f09e 100755
--- a/gdb/testsuite/gdb.fortran/vla-type.exp
+++ b/gdb/testsuite/gdb.fortran/vla-type.exp
@@ -60,6 +60,9 @@ gdb_test "ptype twov" \
"\\s+$int :: ivla1\\\(5,12,99\\\)" \
"\\s+$int :: ivla2\\\(9,12\\\)" \
"End Type two" ]
+gdb_test "print twov" " = \\\( \\\(\\\( \\\( 1, 1, 1, 1, 1\\\)\
+ \\\( 1, 1, 321, 1, 1\\\)\
+ \\\( 1, 1, 1, 1, 1\\\) .*"
# Check type with attribute at beginn of type
gdb_breakpoint [gdb_get_line_number "threev-filled"]