Dumping the contents of a dictionary object using Windbg and SOS.dll在此博客上,此命令如下:
0:009> !dumpvc 000007fe984b57d8 000000018003ead8他想查看数组中的一个元素,这里的元素类型是
System.Collections.Generic.Dictionary`2+Entry[[System.Guid, mscorlib],[Microsoft.TeamFoundation.Framework.Server.TeamFoundationPerformanceCounters, Microsoft.TeamFoundation.Framework.Server]]从我的角度来看,我认为!dumpvc用于探索值类型,即'Dictionary`2+Entry...‘类型。不是值类型。
造成这种情况的原因是什么?
我尝试过这个:转储一个字节数组。
0:000> !da -length 3 -nofields 00000001ba9f63b0
-nofields has no effect unless -details is specified
Name: System.Byte[]
MethodTable: 000007fee3a20b50
EEClass: 000007fee35a2330
Size: 148(0x94) bytes
Array: Rank 1, Number of elements 124, Type Byte
Element Methodtable: 000007fee3a1c168
[0] 00000001ba9f63c0
[1] 00000001ba9f63c1
[2] 00000001ba9f63c2
0:000> !do 00000001ba9f63c0
<Note: this object has an invalid CLASS field>
0:000> !dumpvc 000007fee3a1c168 00000001ba9f63c0
Name: System.Byte
MethodTable: 000007fee3a1c168
EEClass: 000007fee35a03b8
Size: 24(0x18) bytes
File: C:\Windows\Microsoft.Net\assembly\....\mscorlib.dll
Fields:
MT Field Offset Type VT Attr Value Name
000007fee3a1c168 4000276 0 System.Byte 1 instance 62 m_value它显示了我所期望的结果。在我调试的时候!dumpvc可以在任何地方探索数组元素吗?
发布于 2013-12-27 04:08:03
Byte[]是一种引用类型,您可以使用!do转储它。
Byte是一种值类型,如果有很多字节,可以使用!da转储它。
同样的道理也适用于字典:
字典2 is a reference type and dumped with!do`。
这些条目的类型为Dictionary2+Entry which seems to be a struct containing pointers to key and value (something like [KeyValuePair](http://msdn.microsoft.com/en-us/library/vstudio/5tbh8a42%28v=vs.80%29.aspx)). Structs are value types, dumped by!daand you can use!dumpvc`。
https://stackoverflow.com/questions/20543379
复制相似问题