开发者

WinDbg .for loop

开发者 https://www.devze.com 2022-12-12 05:37 出处:网络
I am having trouble getting the WinDbg .for command to work. I would like to dump an array of c++ structs.

I am having trouble getting the WinDbg .for command to work.

I would like to dump an array of c++ structs.

?? gpTranData->mpApplCodes[0] works for 开发者_StackOverflowa single entry but I would like to loop through n of these.

.for ($t0=0;$t0<(gpTranData->miApplCodeCount);$t0++){ ?? &gpTranData->mpApplCodes[$t0] }

sound logical to me but I get

Numeric expression missing from '>miApplCodeCount);$t0++){ ?? &gpTranData->m_pApplCodes[$t0] }'

Any ideas?

Scott


You cannot use C++ operators to modify pseudo-register l-values in Windbg. You can use instead r $t0=@$t0+1 . This will work as you want:

.for (r $t0=0;@$t0<@@c++(g_pTranData->m_iApplCodeCount);r $t0=@$t0+1){ ?? &g_pTranData->m_pApplCodes[@$t0] } 


I guess the masm evaluator is missing some data on your gpTranData->miApplCodeCount input. Wrap your expression with either @@c++() or @@().

0

精彩评论

暂无评论...
验证码 换一张
取 消