Search

Natvis: Template parameter mismatch by Jean Geffroy

Closed
as Fixed Help for as Fixed

4
0
Sign in
to vote
Type: Bug
ID: 767225
Opened: 10/12/2012 10:34:18 AM
Access Restriction: Public
0
Workaround(s)
3
User(s) can reproduce this bug
I am currently working on a project which uses STLPort and I want to create a Natvis file so that we can easily debug STL containers. I am however facing a problem with some containers: the template parameters $Tn defined in the natvis file are not properly resolved, except for the very first element that is observed through the debugger within the currently active debugging session.

This is a very important issue for us, since not being able to properly debug STL types with VS2012 slows down the team.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

What category (if any) best represents this feedback?

 

Steps to reproduce

* Download and extract the attached archive.

* Move the natvis file in the appropriate folder.

* Compile the project.

* Start a debugging session.

* Move the mouse cursor over the std::set<int>: the debugger gives the expected results.

* In the same debugging session, move the mouse cursor over the std::set<std::string>: the debugger displays inconsistent stuff, considering that the content of the set is "int" rather than "std::string".

* Restart the debugging session.

* Move the mouse cursor over the std::set<std::string>: everything's fine

* Move the mouse cursor over the std::set<int>: same problem as the one observed before: debugger thinks that template parameter is std::string instead of int.

Product Language

English

Operating System

Windows 7 SP1

Operating System Language

English

Actual results

* During the first debugging session: when observing the std::set<std::string>, the debugger should show integers.
* During the seconddebugging session: when observing the std::set<int>, the debugger shows std::strings.

Expected results

The debugger should always properly resolve the template parameter type, and as a result send a proper $Tn to the Natvis setup.

Locale

 
File Attachments
File Name Submitted By Submitted On File Size  
Natvis_vs2012_bug.zip 10/12/2012 628 KB
Natvis_vs2012_bug.zip 10/12/2012 628 KB
Sign in to post a comment.
Posted by sébastien Wybo on 5/22/2013 at 12:58 AM
Has this issue been fixed in one of the VS2012 updates? Because I'm having a similar problem with Qt 4.8 types when using nested, different template parameters, types.
Posted by Microsoft on 12/18/2012 at 5:24 PM
Thank you for your feedback. We have determined that the problem in question is indeed a bug in our handling of natvis files and are considering fixing this for a future release. In the meantime, you should know that the bug gets triggered when you have a natvis entry for a template class that uses a node type which is not a template class. Given this, you may be able to work around the issue by changing the code so that the tree node is a template class which inherits the parent object's template parameters, rather than a non-template class, requiring $T3 to bind to the 3rd parameter type of the parent object. - Visual Studio Debugger Team
Posted by Microsoft on 10/15/2012 at 1:00 AM
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 Microsoft on 10/12/2012 at 10:51 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)
Sign in to post a workaround.