在MS DEBUGGER中显示自定义数组内容(Show Custom Object In MS Debugger)MS DEBUGGER中可以显示标准C++类型信息,如vector等,对于自己定义的数组也是很容易实现的,只需要修改VS目录下COMM7\Packages\Debugger中的autoexp.dat 即可。 例如,我的数组: ![]() 1 template<typename T,typename SizeType=unsigned> 2 class Array 3 { 4 public: 5 ///ctor 6 ///... 7 8 ///dtor 9 ///... 10 11 inline T& operator[](SizeType &i){return mdata[i];} 12 inline const T& operator[]const(SizeType &i){return mdata[i];} 13 14 ///other codes 15 ///... 16 17 private: 18 T* mdata; 19 SizeType msize; 20 }; 打开autoexp.dat,定位到文件末尾,在倒数第二行([hresult])之前插入以下内容即可: ;------------------------------------------------------------------------------ 运行调试,自定义数组也可以像vector那样显示出内容了,呵呵是不是很爽啊。 该方法在VC++ 2008 Express Edition + WIN7 64bit下通过测试 |
|