For each dimension of an array, the full syntax of the print command to slice the array is:
print array-expression [first-expression .. last-expression : stride-expression] |
where:
Expression that should evaluate to an array or pointer type.
First element to be printed. Defaults to 0.
Last element to be printed. Defaults to upper bound.
Length of the stride (the number of elements skipped is stride-expression-1). Defaults to 1.
The first expression, last expression, and stride expression are optional expressions that should evaluate to integers.
For example:
(dbx) print arr[2..4] arr[2..4] = [2] = 2 [3] = 3 [4] = 4 (dbx) print arr[..2] arr[0..2] = [0] = 0 [1] = 1 [2] = 2 (dbx) print arr[2..6:2] arr[2..6:2] = [2] = 2 [4] = 4 [6] = 6 |