Problem with debugger visualizer $Tn macros substitution for linked list elements - by Arkady Shapkin

Status : 

  Duplicate<br /><br />
		This item appears to be a duplicate of another existing Connect or internal item.<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 757151 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 8/5/2012 5:07:22 PM
Access Restriction Public


I've create debugger visualizer for boost::unordered_map<*, *>, but I can't correctly cast list element to std::pair because $Tn macros differs for container and items

I've create debugging visualizer for testing:
<Type Name="boost::unordered::unordered_map&lt;*,*&gt;">
    <DisplayString>{{ size={table_.size_} }}</DisplayString>
		<Synthetic Name="T1">  
		<Synthetic Name="T2">  
            <!--ValueNode>*((std::pair&lt;$T1 const ,$T2&gt;*)this - 1)</ValueNode-->
            <ValueNode>"T1: $T1; T2: $T2"</ValueNode>

It show me that T1 and T2 somehow differ types for list elements. How that possible?
Test variable boost::unordered_map<unsigned int, std::list<int>> uml
-		uml	{ size=2 }	boost::unordered::unordered_map<unsigned int,std::list<int,std::allocator<int> >,boost::hash<unsigned int>,std::equal_to<unsigned int>,std::allocator<std::pair<unsigned int const ,std::list<int,std::allocator<int> > > > >
		T1	"unsigned int"	
		T2	"std::list<int,std::allocator<int> >"	
+		[0]	"T1: std::string; T2: int"	char[82]
+		[1]	"T1: std::string; T2: int"	char[82]

I've found some comments about that problem:
Sign in to post a comment.
Posted by Microsoft on 12/19/2012 at 12:52 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 list 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 Arkady Shapkin on 8/6/2012 at 5:09 PM
In this comment problem described more detailed. Problem only when one of template parameters is template class.
Posted by Microsoft on 8/5/2012 at 11:01 PM
Thank you for submitting feedback on Visual Studio 11 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by Microsoft on 8/5/2012 at 5:53 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(