Home Dashboard Directory Help
Search

Failed to parse expression: class "std::_Ref_count_base" has no member "Uses" by mloskot


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 707067
Opened: 11/21/2011 5:00:14 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
1
Workaround(s)
view
1
User(s) can reproduce this bug

Description

In file %VSINSTALLDIR%\Common7\Packages\Debugger\Visualizers\defaultvis.natvis definition of <DisplayString> for shared_ptr refer to non-existing (private) member std::_Ref_count_base::Uses:

<DisplayString Condition="(_Rep->Uses == 1) && (_Rep->_Weaks - 1 > 0) && (_Rep->_Weaks - 1 == 1)">shared_ptr {*_Ptr} [{_Rep->_Uses} strong ref, {_Rep->_Weaks - 1} weak ref] [{*_Rep}] </DisplayString>

This leads to parsing error of the visualizer:

Natvis: Evaluating visualizer expression (_Rep->Uses == 1) && (_Rep->_Weaks - 1 > 0) && (_Rep->_Weaks - 1 == 1) in context std::shared_ptr<int>. Failed to parse expression: class "std::_Ref_count_base" has no member "Uses".

The fix is to replace the Uses with _Uses to correctly refer to member std::_Ref_count_base::_Uses

By the way, this may be related to http://connect.microsoft.com/VisualStudio/feedback/details/705993/
Details
Sign in to post a comment.
Posted by Microsoft on 6/14/2012 at 5:25 PM
Hi,

Thanks for reporting this bug. We've already fixed it, and the fix will be available in VC11.

(I resolved this as Fixed back in December, but while I'm virtually certain that I replied through the Connect interface, my reply doesn't seem to have gotten onto the website. So I'm trying again.)

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by mloskot on 12/2/2011 at 4:34 PM
You are following correct steps which should allow you to reproduce the problem.
Perhaps you are using different build of Visual Studio 11, so you have fixed files installed.
I'm using Microsoft Visual Studio 11 Version 11.0.40825.2 PREREL

I have attached screenshot presenting the problem. However, because I've been having problems with attaching files to Microsoft Connect feedbacks, here is a copy of the screenshot: http://www.flickr.com/photos/mloskot/6444042229/
Posted by MS-Moderator09 [Feedback Moderator] on 11/27/2011 at 9:46 PM
Thank you for reporting this issue.

Unfortunately, we are unable to reproduce the issue with the steps you provided. We tried to repro with the following steps:

1. Copy file C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\Debugger\Visualizers\defaultvis.natvis
into
C:\Users\<YOUR USERNAME>\Documents\Visual Studio 11\Visualizers\myvisualizers.natvis
2. Open myvisualizers.natvis and replace all the exist "std::tr1::" with "std::", then save it.
3. Add the DWORD value EnableNatvisDiagnostics with value "1" under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\Debugger
4. Launch debugger with the sample listed on the connect site http://connect.microsoft.com/VisualStudio/feedback/details/705993/

In my boxes, the output window only contains a sequence of duplicate type info.

Could you please help to point out the steps misundertood or omitted?

It would be greatly appreciated if you could provide us this information as quickly as possible.

Thank you
Posted by MS-Moderator01 on 11/21/2011 at 5:43 PM
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.
Posted by mloskot on 11/21/2011 at 5:01 PM
1) Apply workaround from http://connect.microsoft.com/VisualStudio/feedback/details/705993/
2) Open file %VSINSTALLDIR%\Common7\Packages\Debugger\Visualizers\defaultvis.natvis in editor
3) Find

(_Rep->Uses == 1)

and replace with

(_Rep->_Uses == 1)
File Name Submitted By Submitted On File Size  
microsoft-connect-feedback-707067.png 12/2/2011 129 KB