How to customize variables tooltips while debugging native code? RRS feed

  • Question

  • Hello.

    Suppose I have my native project in C++. During debug I can hover a variable in the code editor and there will be displayed a tooltip with the formatted text for content of this variable. I want to somehow intercept this event and display some more complex information at this point. Say, a thumbnail for an image handled by the variable.

    The only solution I'm aware of is to prepare a DLL with Debugging Expression Evaluator Add-In and connect it with the native debugger by adding a record in the Packages\Debugger\autoexp.dat file. But this method has many disadvantages. Among the major ones, this DLL is loaded not only when a tooltip is shown in the editor window, but also when a variable is evaluated in the Watches or Locals windows. There is no way to distinguish such events from inside the DLL.

    Is there a better way to accomplish what I want?

    Friday, June 29, 2012 10:50 PM

All replies

  • Mikail,

    Which version of visual studio are you using? The native debugger was rewritten in VS 2012 and does have the ability to display ui for a native type. This is only available in vs2012 and only when native only debugging (not when managed / native interop debugging).

    The other issue is you'd want the image to be available using an out of process technique like ReadProcessMemory as executing arbitrary native functions from break mode is extremely dangerous due to the loader lock and heap locks.


    Jackson Davis

    Visual Studio Debugger

    Friday, June 29, 2012 11:39 PM
  • I'm currently using Visual Studio 2010, but if there is another (and simpler) way of doing it in Visual Studio 2012, I want to know both.

    I understand this is a potentially dangerous technique, but how else could this be done?

    Saturday, June 30, 2012 6:15 AM