【发布时间】:2012-01-08 17:54:15
【问题描述】:
我需要一个变量的大小,并且我想要来自 Windbg 命令行的那个值。 编译代码并添加 C++ sizeof() 只是为了获得该值是困难且无用的。
从文档中我看到 Windbg 可以过滤值 dt /s。但显示该值?
【问题讨论】:
标签: windbg
我需要一个变量的大小,并且我想要来自 Windbg 命令行的那个值。 编译代码并添加 C++ sizeof() 只是为了获得该值是困难且无用的。
从文档中我看到 Windbg 可以过滤值 dt /s。但显示该值?
【问题讨论】:
标签: windbg
我对数据类型使用 dt 命令,然后很容易看到布局和大小。
0:000> dt CRect
CrashTestD!CRect
+0x000 left : Int4B
+0x004 top : Int4B
+0x008 right : Int4B
+0x00c bottom : Int4B
0:000> dt long
Int4B
或者使用 C++ 求值器
0:000> ?? sizeof(CRect)
unsigned int 0x10
0:000> ?? sizeof(Float)
unsigned int 4
【讨论】: