]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
fortran: calculate elements of a subarray using a provided stride value
authorChristoph Weinmann <christoph.t.weinmann@intel.com>
Wed, 17 Aug 2016 14:05:37 +0000 (16:05 +0200)
committerBernhard Heckel <bernhard.heckel@intel.com>
Wed, 7 Sep 2016 10:08:48 +0000 (12:08 +0200)
commit3067104c36cd8405ef1a90f39917ee0d3b1c6b13
tree840c0b1e84c97638a1524c5e39aebe102aefca50
parentef4f0c7dc7d0a0ad2f2941ae8035da63756352ec
fortran: calculate elements of a subarray using a provided stride value

The stride value can be a positive or negative integer, but may
not be zero.  If no stride is provided, use the default value
1 to print all elements inside the range.

1| program prog
2|   integer :: ary(10) = (/ (i, i=1, 10) /)
3| end program prog

(gdb) print ary(1:10:2)
$3 = (1, 3, 5, 7, 9)

2013-11-27  Christoph Weinmann  <christoph.t.weinmann>

* eval.c (value_f90_subarray): Add range size calculation
for stride based ranges, and evaluation of user stride
parameters.  Add check for matching user input to array
bounds.
* valops.c (value_slice): Add call parameter with default
stride value for calling value_slice_1.
* valops.c (value_slice_1): Add function parameter for
stride length in the return subarray.  Calculate array
elements based on stride value.
* value.h: Add stride parameter to declaration of
value_slice_1.

Signed-off-by: Christoph Weinmann <christoph.t.weinmann@intel.com>
gdb/eval.c
gdb/valops.c
gdb/value.h