autoexp.dat and expression evaluation

We've got a number of classes that for various reasons we've had to implement (in C++ on Visual Studio 2005) via the pimpl idiom e.g. the class declaration looks something like this:

class MyClass
{
private:
    class Impl;    // Impl defined elsewhere
    Impl *m_impl;

};

 These classes are implemented in their own DLL (Common.dll, say). When we try and look at the value of any of these classes in the debugger from a module other than Common.dll, all the debugger is able to display is the address of the m_impl variable (pretty much as we'd expect).

To this end, we've exported a number of functions from the DLL that we can call via the watch window to evaluate the contents of one of our objects. For example, given an instance of MyClass called myClass, we could write:

{evalMyClass(),,Common.dll}evalMyClass({*}myClass.m_impl)

, and this will return a string that the debugger can display which represents the contents of the object.

This works really well, but is a bit cumbersome to use. So we'd really like to have the debugger automatically evaluate this expression for objects of type MyClass. To this end, we've added entries along the following lines to autoexp.dat:

MyClass=<{evalMyClass(),,Common.dll}evalMyClass({*}m_impl),s>

, but this just displays ' ' in the watch window.

Is there anyway the above expression can be made to work with autoexp.dat, or is this just a facet of the way the IDE works

Or are there any alternative solutions that anybody can suggest (we've tried writing an addin DLL, but the contents of the objects are quite complicated so this isn't really viable)

Thanks in advance,

Ralph



Answer this question

autoexp.dat and expression evaluation

  • autoexp.dat and expression evaluation