Casting complex types doesn't work correctly in C++ debugger visualizers - by Arkady Shapkin

Status : 


Sign in
to vote
ID 756357 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 7/31/2012 2:39:11 PM
Access Restriction Public


Can't cast variable pointer to std::pair class in debugger visualizers or in watch window.
When I declare variable std::pair<int const, bool> p.
This cast work in watch window:
(std::pair<int const ,bool>*)&p
This doesn't work:
(std::pair<int const, bool>*)&p
(std::pair<int const,bool>*)&p
(std::pair<int const , bool>*)&p

If you put spaces in other places it will stop working.

Difference only in whitespace position. Can you fix this problem before VS2012 release?
Sign in to post a comment.
Posted by Arkady Shapkin on 12/3/2012 at 8:56 AM
Somehow now it's gone, maybe because Update 1. Case described here now works ok
Posted by Arkady Shapkin on 12/3/2012 at 8:28 AM
Sorry, it's not related with issue

I tried produce sample that reproduce this issue with debugger visualizer in Visual Studio 2012 Update 1, but somehow problem disappear. I'll try later to reproduce the problem with the original class boost::unordered_map
Posted by Arkady Shapkin on 11/29/2012 at 5:09 PM
Hello Marc,

This issue has acceptable workaround, but related issue doesn't have it. That issue critical for me.

Problem is related, debugger add whitespace before > symbol if one of parameters is template.
std::pair<int const, std::unique_ptr<s>> p;
p - std::pair<int const ,std::unique_ptr<s,std::default_delete<s> > >

std::pair<$T1 const ,$T2> only works with non template types like std::pair<int const ,bool>
std::pair<$T1 const ,$T2 > only works with template types like std::pair<int const, std::unique_ptr<s>>
because of space!
Posted by Microsoft on 11/29/2012 at 11:37 AM

Unfortunately, the straightforward fix for this issue that we tried caused a performance regression when debugging. Fixing without the performance impact requires significant changes in the compiler which we will consider for a future release. You will have to work around this as best you can in the current release.

Marc Paine
Visual Studio Debugger QA Lead
Posted by Arkady Shapkin on 11/13/2012 at 6:01 AM
This bug is critical for my extension . I can't support some types because of him (boost::unordered::unordered_map/set visualizer support only simple types because of that).
Posted by Microsoft on 7/31/2012 at 9:30 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 Microsoft on 7/31/2012 at 2:50 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(