The answer by Patrick is ok for Byte[] or other simple types. If you need the same for reference types, try !da
of SOS
or !mdt
of the SOSEX
extension.
First, let's see how !da
works:
0:077> *** Get method table to be specific about the object
0:077> !dumpheap -stat -type PointF[]
total 290 objects
Statistics:
MT Count TotalSize Class Name
7ae3a114 290 8360 System.Drawing.PointF[]
Total 290 objects
0:077> *** Get individual arrays
0:077> !dumpheap -mt 7ae3a114
Address MT Size
3be693a4 7ae3a114 28
3be69400 7ae3a114 28
...
total 290 objects
Statistics:
MT Count TotalSize Class Name
7ae3a114 290 8360 System.Drawing.PointF[]
Total 290 objects
0:077> *** Pick one for demo purposes. Output is not that useful.
0:077> !do 3be693a4
Name: System.Drawing.PointF[]
MethodTable: 7ae3a114
EEClass: 7adeb1cc
Size: 28(0x1c) bytes
Array: Rank 1, Number of elements 2, Type VALUETYPE
Element Type: System.Drawing.PointF
Fields:
None
0:077> *** Dump contents of the array
0:077> !da 3be693a4
Name: System.Drawing.PointF[]
MethodTable: 7ae3a114
EEClass: 7adeb1cc
Size: 28(0x1c) bytes
Array: Rank 1, Number of elements 2, Type VALUETYPE
Element Methodtable: 7ae3c3ac
[0] 3be693ac
[1] 3be693b4
Now, you typically want more details about the two objects in the array. You could fiddle around with the .foreach
command, but there's no -short
option, so go the simpler way using !mdt
:
0:077> .load D:\debug\Extensions\sosex\4\32\sosex.dll
0:077> !mdt -e:2 3be693a4
3be693a4 (System.Drawing.PointF[], Elements: 2, ElementMT=7ae3c3ac)
[0] (System.Drawing.PointF) VALTYPE (MT=7ae3c3ac, ADDR=3be693ac)
x:0.000000 (System.Single)
y:-1.000000 (System.Single)
[1] (System.Drawing.PointF) VALTYPE (MT=7ae3c3ac, ADDR=3be693b4)
x:1917.000000 (System.Single)
y:22.000000 (System.Single)
increase depth
Update: PointF was not the best example, because it is also a value type, but it's similar for reference types.