Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在WinDbg中查看.NET并发集合?_.net_Debugging_Windbg - Fatal编程技术网

如何在WinDbg中查看.NET并发集合?

如何在WinDbg中查看.NET并发集合?,.net,debugging,windbg,.net,Debugging,Windbg,有没有什么有效的方法可以查看并发集合的内容,如ConcurrentQueue,ConcurrentDictionary阻止收集等 有一个好的,但这只能转储旧的&good字典和哈希表 老实说,我很惊讶,我没有找到任何支持这一点的证据,因为在实例中,通过桶、尾和头是一种缓慢的方法 ”!如果您有一个支持DML的WinDbg版本,mdt命令似乎很正常,因为您可以单击链接来显示和扩展阵列 ConcurrentQueue(请注意,m_array是一个可单击的链接): NetExt现在正在实施!感谢Mikha

有没有什么有效的方法可以查看并发集合的内容,如
ConcurrentQueue
ConcurrentDictionary
<代码>阻止收集等

有一个好的,但这只能转储旧的&good
字典
哈希表

老实说,我很惊讶,我没有找到任何支持这一点的证据,因为在实例中,通过桶、尾和头是一种缓慢的方法

!如果您有一个支持DML的WinDbg版本,mdt
命令似乎很正常,因为您可以单击链接来显示和扩展阵列

ConcurrentQueue(请注意,
m_array
是一个可单击的链接):


NetExt现在正在实施!感谢Mikhail Polgun代码的贡献

!wconcurrentdict <address>
<address> - Address of the dictionary.

Examples:

Dumps a dictionary
------------------------
0:000> wconcurrentdict 00000001557d3920
Items   : 1
[0]:==============================================
System.__Canon key = 00000001557d2a70 CompilerVersion
System.__Canon value = 00000001557d2aa8 v2.0

!wconcurrentdict

谢谢,我明天会看一看。仍然没有听说过DML,我总是学到一些新的东西:)可能有用,尽管它不是很友好。。我会接受这个答案,因为现在看来没有比这更好的了。
0:000> !mdt 0000000002614820 -r:6
0000000002614820 (System.Collections.Concurrent.ConcurrentDictionary`2[[System.String, mscorlib],[System.String, mscorlib]])
    m_tables:0000000002614eb0 (System.Collections.Concurrent.ConcurrentDictionary`2+Tables[[System.String, mscorlib],[System.String, mscorlib]])
        m_buckets:0000000002614d98 (System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.String, mscorlib],[System.String, mscorlib]][], Elements: 32)
        m_locks:00000000026148e8 (System.Object[], Elements: 32)
        m_countPerLock:0000000002614d00 (System.Int32[], Elements: 32)
        m_comparer:00000000026148d0 (System.Collections.Generic.GenericEqualityComparer`1[[System.String, mscorlib]])
    m_comparer:NULL (System.Collections.Generic.IEqualityComparer`1[[System.__Canon, mscorlib]])
    m_growLockArray:true (System.Boolean)
    m_keyRehashCount:0x0 (System.Int32)
    m_budget:0x1 (System.Int32)
    m_serializationArray:NULL (System.Collections.Generic.KeyValuePair`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]][])
    m_serializationConcurrencyLevel:0x0 (System.Int32)
    m_serializationCapacity:0x0 (System.Int32)

0:000> !mdt 0000000002614d98
0000000002614d98 (System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.String, mscorlib],[System.String, mscorlib]][], Elements: 32)
expand all 32 items                                        <--- DML Link

0:000> !mdt -e:2 0000000002614d98
0000000002614d98 (System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.String, mscorlib],[System.String, mscorlib]][], Elements: 32)
[...]
[18] 0000000002618148 (System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.String, mscorlib],[System.String, mscorlib]])
    m_key:00000000026180b8 (System.String) Length=7, String="Hello 8"
    m_value:0000000002618118 (System.String) Length=8, String="WinDbg 8"
    m_next:NULL (System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.__Canon, mscorlib],[System.__Canon, mscorlib]])
    m_hashcode:0xd0fe55d2 (System.Int32)
[19] 00000000026182b0 (System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.String, mscorlib],[System.String, mscorlib]])
    m_key:0000000002618220 (System.String) Length=7, String="Hello 9"
    m_value:0000000002618280 (System.String) Length=8, String="WinDbg 9"
    m_next:NULL (System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.__Canon, mscorlib],[System.__Canon, mscorlib]])
    m_hashcode:0xd0fe55d3 (System.Int32)
!wconcurrentdict <address>
<address> - Address of the dictionary.

Examples:

Dumps a dictionary
------------------------
0:000> wconcurrentdict 00000001557d3920
Items   : 1
[0]:==============================================
System.__Canon key = 00000001557d2a70 CompilerVersion
System.__Canon value = 00000001557d2aa8 v2.0