none
Displaying vector as graph in debug window RRS feed

  • Question

  • Is there a way to plot a vector in a debug windows as a series? I am writing the code using Visual Studio C++ Environment.

    e.g., If there is a vector<int> x ={1,2,3}; When I pause at the statement in VS2012. I want to visualize the vector as graph/chart in a debug window.

    In VS 2012, there is "Image Watch" debug window for debugging images. I am looking for something similar to that for viewing vectors as graphs/series.

    Kalyan

    Wednesday, February 12, 2014 10:43 PM

Answers

  • Hi,

    Welcome to MSDN,

    >>If there is a vector<int> x ={1,2,3}; <<

    First, I tested that format, it is not supported in VS2012, but VS2013 supports that format.

    I tested it with the following sample:

    #include "stdafx.h"
    #include <vector>
    using namespace std;
    int _tmain(int argc, _TCHAR* argv[])
    {
    	
    int b[3] = {1,2,3};
    vector<int> x(b,b+3) ;
    return 0; //set breakpoint here
    }

    When step into that breakpoint, we could right click on the variable x, then choose "Add Watch", it will show the information about that vector in Watch window, then we could expand the node of x to get detailed information as following image:

    We could try the way above to debug, but if you want it displays as graph/chart , I am afraid that it is not supported with current versions.

    Regards.


    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.

    Thursday, February 13, 2014 8:27 AM
    Moderator

All replies

  • Hi,

    Welcome to MSDN,

    >>If there is a vector<int> x ={1,2,3}; <<

    First, I tested that format, it is not supported in VS2012, but VS2013 supports that format.

    I tested it with the following sample:

    #include "stdafx.h"
    #include <vector>
    using namespace std;
    int _tmain(int argc, _TCHAR* argv[])
    {
    	
    int b[3] = {1,2,3};
    vector<int> x(b,b+3) ;
    return 0; //set breakpoint here
    }

    When step into that breakpoint, we could right click on the variable x, then choose "Add Watch", it will show the information about that vector in Watch window, then we could expand the node of x to get detailed information as following image:

    We could try the way above to debug, but if you want it displays as graph/chart , I am afraid that it is not supported with current versions.

    Regards.


    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.

    Thursday, February 13, 2014 8:27 AM
    Moderator
  • Thanks for the reply. Are there any plugins which can make it happen?
    Thursday, February 13, 2014 9:03 PM
  • Thanks for the reply. Are there any plugins which can make it happen?

    Hi,

    I am afraid that I did research but could not find any plugins to get that work.

    Sorry for no idea.

    Regards.


    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.

    Friday, February 14, 2014 1:01 AM
    Moderator