Get sizeof (type) in Windbg

房东的猫 提交于 2019-12-05 10:48:13

问题


I need the size of a variable and I want that value from Windbg command line. It's hard and useless to compile the code and add a C++ sizeof() only to get that value.

From documentation I see that Windbg can filter after value dt /s. but displayng that value ?


回答1:


I use the dt command on the data type and then it’s easy see the layout and size.

0:000> dt CRect
 CrashTestD!CRect
   +0x000 left             : Int4B
   +0x004 top              : Int4B
   +0x008 right            : Int4B
   +0x00c bottom           : Int4B
0:000> dt long
Int4B

Or use the C++ evaluator

0:000> ?? sizeof(CRect) 
unsigned int 0x10
0:000> ??  sizeof(Float)
unsigned int 4


来源:https://stackoverflow.com/questions/8309970/get-sizeof-type-in-windbg

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!