none
Visual Studio 2015 Update 1, clang shows incorrect vector state during debugging

    Question

  • When debugging with clang provided with VS2015 Up1, clang doesn't show correctly vector. That is, if I push_back couple of times into that vector, clang doesn't show what the content size or anything else really is in aforementioned vector.
    Any ideas why?
    Thursday, December 3, 2015 9:28 AM

All replies

  • Hi Artur1977,

    Are you using the default Clang template in Visual Studio? Please provide some code snippet and some screenshot to help us reproduce this problem and understanding what is the correctly vector and what is the incorrect.

    In addition, please try to move the Update 1 from Control Panel -> Installed Updates to make sure whether this problem is caused by the clang which provided by Update 1.

    Best Regards,
    Weiwei

    Friday, December 4, 2015 8:08 AM
    Moderator

  • Sorry guy, if you are too lazy and can't be bothered of checking what's happening to vector after my first post in which I describe precisely what's the problem is, am affraid I cannot waste time. Either you want to help or not. If you want help, you have enough info in the first post.
    Monday, December 7, 2015 7:57 AM
  • Hi Artur1977,

    Really want to help you resolve this issue!

    Not the real developing forum, you know that this forum is to discuss the VS IDE, but to really repro this issue, we have to make sure that how to write the same app, what the real result is in your side.

    But what I know is that it seems the debug watch window doesn't share the correct value for a variable, am I right?

    We could set the same VS Environment as yours, but it would be better if you could share us the repro steps with the main code. Thank you for your support and co-operation, Artur1977:)

    In addition, like this blog here:

    http://blogs.msdn.com/b/vcblog/archive/2015/12/04/introducing-clang-with-microsoft-codegen-in-vs-2015-update-1.aspx

    It seems that it really has some feedbacks now, but to really repro that whether it is the feedback of the VS 2015 IDE or the update, would you mind sharing me a simple sample using one drive? I will debug it in my side, if I get the same issue as yours, I will help you submit a feedback to the product team directly.

    If there's any concern, please feel free to let me know.

    Update:

    Not the real Clang expert, but one idea is that you could also add a comment in this blog, so the Clang experts could really repro this issue for you, maybe we could get better response there, at least, they could repro this issue more easy than VS IDE members and me:)

    Sincerely,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Wednesday, December 9, 2015 1:06 PM
    Moderator
  • Ok, here are the steps:

    1. New Project (go through all the steps necessary to create win32 console app, don't change any settings, just press finish on New Project window)

    2. Right click on newly created project in Solution Explorer and select properties

    3. Configuration Properties/General and on the left hand side select clang as a Platform Toolset

    4. Close that window

    5. #include <vector>

    6. Define variable of that vector in main:

    std::vector<int> vec{1,2,3};

    7. Debug it and see if in watch window you can check size of that vector for example.

    8. Code should look like this:

    #include "stdafx.h"
    #include <vector>
    int main()
    { 
       std::vector<int> vec{ 1,2,3 };    
       return 0;//<--Breakpoint here
    }

    Link to One-Drive:

    https://onedrive.live.com/redir?resid=2E12499246EDA734!106&authkey=!AOQyZTIvPd_fFPQ&ithint=file%2c7z

    File is compressed by 7z app. No pass required.

    • Edited by Artur1977 Friday, December 11, 2015 6:57 AM
    Friday, December 11, 2015 6:51 AM
  • Hi Artur1977,

    Thanks for your friendly response.

    It seems that I get many compiled error in the error list window in my side, did you get any error message in your error list or output window?

    One issue is that I could debug it even if it has some build error messages, I could get the result like this screen shot:

    I'm not very sure that whethe it would be related to the 135 Errors, but the debug watch window really has a wrong result.

    To get the issue confirmed and diagnose by product team, would you please create connect report for it? You will get email notification for update.http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 14, 2015 8:35 AM
    Moderator
  • Could you please tell me how is it possible that you're getting compile errors with that simple program? Did you investigate it or simply are not bothered, you've seen there are errors, posted screenshot and happily went back to playing whatever you play this days? I mean, seriously, the lack of any engagement from your side is appoling.
    Wednesday, December 16, 2015 8:48 AM
  • Hi Artur1977,

    So you don't get any compiled error in your side, am I right? If so, maybe it is my Environment issue.I will setup the new VS2015 machine and repro this issue again after we discuss this issue with VC++ members, you know that actually this forum is to discuss the VS IDE, not the real developing forum. If I get the latest information, I will share it here.

    Thanks,

    Jack

    Update:

    I found that it still couldn't share it in the watch window even if I didn't change the platform toolset =clang. So one issue is that: could you get it in your debug watch window even if you use the default platform toolset?

    In addition, to watch the "std::vector<int>", it seems that other members also got the same issue before:

    http://stackoverflow.com/questions/1788702/visual-studio-fails-to-display-some-watched-expressions

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/c09f4fe4-4783-4dbb-8d36-85489fa2a4ae/watching-vector-values?forum=vsdebug

    Sincerely,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, December 16, 2015 4:52 PM
    Moderator