locked
Visual Studio 2015 cannot inspect elements of vector RRS feed

  • Question

  • Hi

    Consider the code:

    #include <vector>

    int main()
      {
      std::vector<int> v = { 10, 11, 12 };
      return 0;
      }

    With a <break> at the return it should be possible to investigate the contents of v using the debug tool tips. It works in VS2013 but not in VS2015. I've tried with the Update 2 without success.

    Anyone have ideas. Thanks

    gww

    Saturday, March 26, 2016 5:35 PM

Answers

  • Thanks for help. It's fixed!

    The fact that it worked for Hart suggested there is a problem with my system, but my system information is exactly the same, so I went looking through the debugging options again.

    Turning off "Show raw structure of objects in variables windows" fixed it.

    My original problem was with C++/clr and it's fixed there also but "Use Managed Compatibility Mode" must be off too.

    Best regards

    gww

    • Marked as answer by gwwinn Monday, March 28, 2016 1:42 PM
    Monday, March 28, 2016 10:49 AM

All replies


  • With a <break> at the return it should be possible to investigate the contents of v using the debug tool tips. It works in VS2013 but not in VS2015. I've tried with the Update 2 without success.

    Are you setting the breakpoint at the return statement or at the closing brace?

    In VC++2015 Update 1 a breakpoint at the return statement allows the display of vector elements by hovering the cursor over the vector.  However, a breakpoint at the closing brace after the return statment has executed will yield nothing since the vector's destructor has already executed.

    Saturday, March 26, 2016 6:18 PM
  • Are you debugging in 'Debug->Options->Debugging->General->Use Native Compatibility Mode'?

    With kind regards

    Saturday, March 26, 2016 7:13 PM


  • Hi,

    I cannot reproduce your issue. I have tested a simple C++ project with your code in VS 2015 update 2. My operating system is win10. I can inspect the element of the vector when debugging code.<o:p></o:p>

    The attachment is my system information screenshot.<o:p></o:p>



    Best Regards,<o:p></o:p>



    Hart<o:p></o:p>


    Monday, March 28, 2016 8:40 AM
  • Thanks for help. It's fixed!

    The fact that it worked for Hart suggested there is a problem with my system, but my system information is exactly the same, so I went looking through the debugging options again.

    Turning off "Show raw structure of objects in variables windows" fixed it.

    My original problem was with C++/clr and it's fixed there also but "Use Managed Compatibility Mode" must be off too.

    Best regards

    gww

    • Marked as answer by gwwinn Monday, March 28, 2016 1:42 PM
    Monday, March 28, 2016 10:49 AM
  • Thanks for help. It's fixed!

    The fact that it worked for Hart suggested there is a problem with my system, but my system information is exactly the same, so I went looking through the debugging options again.

    Turning off "Show raw structure of objects in variables windows" fixed it.

    My original problem was with C++/clr and it's fixed there also but "Use Managed Compatibility Mode" must be off too.

    Best regards

    gww

    You need to Mark Hart Suggestion as answer not yours.

    Thanks


    Rupesh Shukla

    Monday, March 28, 2016 2:46 PM