XSLT存档  

不及格的程序员-八神

 查看分类:  ASP.NET XML/XSLT JavaScripT   我的MSN空间Blog

 

Many a times data structs like arrays need parsing in windbg. These don't lend themselves as well as the LIST_ENTRY based structs do, because the debugger can parse such lists. Here are 2 simple ways of parsing arrays.
  
typedef struct _RECORD
{
    ULONG Foo;
    ULONG Bar;
} RECORD;

typedef struct _STATE
{
    RECORD Records[100];
} STATE;

int main()
{
    STATE localXyz;
}
Commands used:
  1. for
  2. dx
1: kd>.for (r @$t0 = 0; @$t0 < @@(#RTL_NUMBER_OF(localXyz.Records)); r @$t0 = @$t0 + 1) { ?? localXyz.Records[@$t0] }
 
struct _RECORD
   +0x000 Foo          : 
   +0x004 Bar        : 
 
There is another way of doing this in the latest version of Windbg, and that is using the dx command.

1: kd>dx -r2 -g localXyz.Records

 
Note : This example uses stack based objects, and hence uses the dot operator in the commands, however, if you are using a pointer to the struct you want to display, you will have to use the arrow operator instead of the dot.
posted on 2023-02-26 15:39  不及格的程序员-八神  阅读(12)  评论(0编辑  收藏  举报