C++ Debugger visualizer (natvis file) : Display the most derived class - by François1

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 777381 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/24/2013 6:22:38 AM
Access Restriction Public



In Visual Studio 2012, there is no way to display the most derived type in the debugger watch panel, if Edit and Continue is disable.

In previous version, programmer could edit 'autoexp.dat' file, and add the simple syntax : "MyInterface =<,t>" (in '[AutoExpand]' section).
But with '.natvis' file, I try lot of syntax, watch on Microsoft documentation, ask on MSDN forum (http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/ad667f74-6132-44a5-ba8d-8aa8d5d365ef), but I don't find any solution.

In VS 2008, with the syntax "<,t>", when you display a pointer on a class ("MyInheratedClass") which inherit from "MyInterface", the debugger display the pointer address and the most derived type "{MyInheratedClass}".

It could be great to have the same feature with VS 2012, using the natvis file.

Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:29 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by Eric [MSFT] on 1/29/2013 at 4:19 PM
Thank you for your feedback. We are considering adding support in a future release to allow <DisplayString> elements to make use of the most derived type, similar to how <,t> works in autoexp.dat. In the meantime, you can work around the problem by creating a separate <Type> entry for each possible derived class, rather than one single entry for the base class, and having the <Type> entry for each derived class simply specify the class name directly as part of <DisplayString> text. For example, <Type Name="MyInheritedClass"><DisplayString>{{MyInheritedClass}}</DisplayString></Type>.
Posted by Helen [MSFT] on 1/24/2013 at 6:47 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Macy [MSFT] on 1/24/2013 at 6:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)