Skip to content

Commit a4ff077

Browse files
committed
Add documentation for LowerBound in ArrayItems
This PR adds in the documentation for the existing LowerBound element in ArrayItems for C++ Natvis.
1 parent 73e5f3c commit a4ff077

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/debugger/create-custom-views-of-native-objects.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,19 @@ You can also specify multi-dimensional arrays. In that case, the debugger needs
479479
<Rank>$T2</Rank>
480480
<Size>_M_extent._M_base[$i]</Size>
481481
<ValuePointer>($T1*) _M_buffer_descriptor._M_data_ptr</ValuePointer>
482+
<LowerBound>0</LowerBound>
482483
</ArrayItems>
483484
</Expand>
484485
</Type>
485486
```
486487

487488
- `Direction` specifies whether the array is in row-major or column-major order.
488489
- `Rank` specifies the rank of the array.
489-
- The `Size` element accepts the implicit `$i` parameter, which it substitutes with the dimension index to find the length of the array in that dimension. In the previous example, the expression `_M_extent.M_base[0]` should give the length of the 0th dimension, `_M_extent._M_base[1]` the 1st, and so on.
490+
- The `Size` element accepts the implicit `$i` parameter, which it substitutes with the dimension index to find the length of the array in that dimension.
491+
- In the previous example, the expression `_M_extent.M_base[0]` should give the length of the 0th dimension, `_M_extent._M_base[1]` the 1st, and so on.
492+
- The `LowerBound` specifies the lower bound of each dimension of the array. For multi-dimensional arrays, you can specify an expression that uses the implicit `$i` parameter. The `$i` parameter will be substituted with the dimension index to find the lower bound of the array in that dimension.
493+
- In the previous example, all dimensions will start at 0. However, if you had `($i == 1) ? 1000 : 100` as the lower bound. The 0th dimension will start at 100, and the 1st dimension will start at 1000.
494+
- E.g. `[100, 1000], [100, 1001], [100, 1002], ... [101, 1000], [101, 1001],...`
490495

491496
Here's how a two-dimensional `Concurrency::array` object looks in the debugger window:
492497

0 commit comments

Comments
 (0)