【发布时间】:2014-08-13 13:04:02
【问题描述】:
我正在使用一个包含一些尴尬类型的库。在 Visual Studio 中调试时,我想以可读的形式显示它们。我发现了一些关于如何编辑 autoexp.dat 文件的非常有用的文章。
http://www.idigitalhouse.com/Blog/?p=83
或
http://mariusbancila.ro/blog/2007/04/06/tweaking-autoexpdat-for-custom-types-in-vs2005/
假设我有一个字符串类:
class String {
//...
private:
char *_cbuf;
}
然后我可以轻松添加可视化工具,因为 _cbuf 是一个成员变量。我只是写
String{
preview (
[$c._cbuf]
)
}
在 autoexp.dat 文件中 [Visualizer] 部分的开头,它可以工作。
但是假设我想显示一个更复杂的类型,它没有任何有用的成员变量,但它有非常有用的方法。例如:
class Date {
//...
String asString() const;
private:
long _someReallyStrangeAndUnusefulDateRepresentation;
}
我想显示字符串而不是无用的长。怎么做?写作
Date{
preview (
[$c.asString()]
)
}
在 autoexp.dat 中不起作用。
【问题讨论】:
标签: c++ visual-studio debugging