如果数组包含100000000项,则输出所有项目的时间太长,所以我可能知道是否只想用windbg输出数组的十个项目,例如!da 前10名地址,如何处理?
答案 0 :(得分:4)
sos !da
命令需要-start
和-length
参数:
-start <startIndex>: optional, only supported for single dimension array.
Specify from which index the command shows the elements.
-length <length>: optional, only supported for single dimension array.
Specify how many elements to show.
在sosex中,您可以将!mdt
与-start:
和-count:
参数一起使用:
!sosex.mdt [typename | paramname | localname | MT] [ADDR]
[-r[:level]] [-e[:level]] [-start:index] [-count:n]
或者您可以使用NetExt。 !wdo
命令适用于数组,并具有/start
和/end
参数来限制索引:
!wdo [/forcearray] [/shownull] [/noheader] [/noindex] [/mt <expr>]
[/start <expr>] [/end <expr>] <expr>
/mt <expr> - mt,Method table for value objects (space-delimited)
<expr> - Address,Object Address
/start <expr> - Starting index to show in an array (space-delimited)
/end <expr> - Ending index to show in an array (space-delimited)
/forcearray - For Byte[] and Char[] arrays show items not the string
/shownull - For arrays will show items that are null
/noheader - Display only object address and field and values
/noindex - For arrays it will show values without the index
/tokens - show class and type tokens for fields