WINDBG,如何查看数组的内容?

发布于 2024-08-20 09:23:07 字数 1511 浏览 7 评论 0原文

我正在使用 WINDBG 来分析内存使用率过高的程序的转储文件。

涉及的对象之一是保存一个对象数组,引用许多我想查看的对象,以尝试找出分配它们的原因。

这是我尝试过的:

首先,我的 ServiceContainer 对象集合:

0:000> !do 05633014 
Name: System.Collections.Generic.List`1[[LVK.IoC.ServiceContainer, LVK.Core]]
MethodTable: 08b3c7fc
EEClass: 6f70ca78
Size: 24(0x18) bytes
 (C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6f924324  40009d8        4      System.Object[]  0 instance 1da226ec _items
6f952da0  40009d9        c         System.Int32  1 instance     5356 _size
6f952da0  40009da       10         System.Int32  1 instance     5538 _version
6f950770  40009db        8        System.Object  0 instance 00000000 _syncRoot
6f924324  40009dc        0      System.Object[]  0   shared   static _emptyArray
    >> Domain:Value dynamic statics NYI
 002b2a28:NotInit  <<

_items 数组中有我想要查看的数组,因此我发出了以下命令:

0:000> !do 1da226ec

产生了:

Name: System.Object[]
MethodTable: 6f924324
EEClass: 6f70da64
Size: 32784(0x8010) bytes
Array: Rank 1, Number of elements 8192, Type CLASS
Element Type: LVK.IoC.ServiceContainer
Fields:
None

查看网络,我发现迹象表明我可以使用一个-v选项来生成数组值,但这似乎不起作用。

我如何查看这个数组的元素?

I'm using WINDBG to analyze a dump file for a program that exhibits a bit too high memory usage.

One of the objects involved is holding an object array, referencing a lot of objects I'd like to look at, to try to find out why they were allocated.

Here's what I've tried:

First, my collection of ServiceContainer objects:

0:000> !do 05633014 
Name: System.Collections.Generic.List`1[[LVK.IoC.ServiceContainer, LVK.Core]]
MethodTable: 08b3c7fc
EEClass: 6f70ca78
Size: 24(0x18) bytes
 (C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
6f924324  40009d8        4      System.Object[]  0 instance 1da226ec _items
6f952da0  40009d9        c         System.Int32  1 instance     5356 _size
6f952da0  40009da       10         System.Int32  1 instance     5538 _version
6f950770  40009db        8        System.Object  0 instance 00000000 _syncRoot
6f924324  40009dc        0      System.Object[]  0   shared   static _emptyArray
    >> Domain:Value dynamic statics NYI
 002b2a28:NotInit  <<

The _items array there is the one I want to look at, so I issued this command:

0:000> !do 1da226ec

which produced:

Name: System.Object[]
MethodTable: 6f924324
EEClass: 6f70da64
Size: 32784(0x8010) bytes
Array: Rank 1, Number of elements 8192, Type CLASS
Element Type: LVK.IoC.ServiceContainer
Fields:
None

Looking at the web, I've found indications that there was a -v option I could use on something to produce the array values, but this doesn't seem to work.

How do I look at the elements of this array?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゝ杯具 2024-08-27 09:23:07

您正在寻找

!da 1da226ec

转储数组对象。

You're looking for

!da 1da226ec

To dump the array objects.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文