我想使用“dt”或“??”更改某些类型的显示方式 其方式与使用 autoexp.dat 类似。 有没有办法做到这一点?
例如,我有一个类似这样的结构:
struct Foo
{
union Bar
{
int a;
void *p;
} b;
};
我有一个包含数百个这样的数组,我知道所有这些都指向一个结构 Bar。 有没有办法告诉 cdb,无论如何,在这个表达式中,“p”是指向 Bar 的指针? 这就是你可以用 autoexp 做的事情。 (这里的具体示例是,我有一个可以包含任何类型的键的存储表,但我知道它们的键是字符串。实现将它们存储为空指针)。
提前致谢!
I'd like to change the way some types are displayed using either 'dt' or '??' in a manner similar to how you can do that with autoexp.dat. Is there a way to do this?
For example, I have a structure something like this:
struct Foo
{
union Bar
{
int a;
void *p;
} b;
};
And I've got an array of a few hundred of these, all of which I know point to a structure Bar. Is there any way to tell cdb that, in this expression anyway, that 'p' is a pointer to Bar? This is the kind of thing you could do with autoexp. (The concrete example here is that I've got a stashtable that can have keys of any type, but I know they keys are strings. the implementation stores them as void pointers).
Thanks in advance!
发布评论
评论(2)
我认为没有像 autoexp.dat 这样简单的东西。
您有几个潜在的选择 - 您可以使用调试器命令编写一个简单的脚本文件,以您想要的方式转储数据结构,并使用“
$”命令(或其其中之一)变体)。 与用户别名相结合,您可以使其使用起来非常简单和自然。
第二个选项涉及更多,但随之而来的是更强大的功能 - 编写一个扩展 DLL 来转储您的数据结构。 对于像你所说的这样的事情,这可能有点过分了。 但是,您可以通过调试器扩展获得巨大的能力(事实上,调试工具包中的大部分功能都是通过这种方式实现的)。 SDK 与调试器打包在一起,因此很容易确定这是否是您可能需要的。
I don't think there's anything as simple as autoexp.dat.
You have a couple potential options - you can write a simple script file with the debugger commands to dump the data structure in the way you want and use the "
$<filename
" command (or one of its variants). Combined with user aliases you can get this to be pretty easy and natural to use.The second option is quite a bit more involved, but with it comes much more power - write an extension DLL that dumps your data structure. For something like what you're talking about this is probably overkill. But you have immense power with debugger extensions (in fact, much of the power that comes in the Debugging tools package is implemented this way). The SDK is packaged with the debugger, so it's easy to determine if this is what you might need.
您可以说
du
或da
来获取它 将内存转储为 unicode 或 ascii 字符串。You can say
du
orda
to have it dump memory as unicode or ascii strings.