Visual Studio debug maximum buffer size

馋奶兔 提交于 2019-12-13 02:08:03

问题


When debugging my project in visual studio (2010) I get the message "no source available" once I step into one of my files. The file is now just a test file with one function:

void foo()
{
    float testbuf[200000] = {0};
}

If i allocate a smaller buffer the debugger enters the file normally. In my debugging view my "call stack location" is empty and there is "no disassembly available".

It looks to me like there is a maximum amount of data that the visual studio debugger can handle or something in this direction.

Could someone tell me if this is the problem and how I can fix it. Maybe some Visual Studio settings can help me out?


回答1:


I have found a way to avoid the problem. If I create the buffer "dynamically" by just malloc-ing the same big buffer then Visual Studio has no problem debugging my source file. Code example:

void foo()
{
    float *testbuf;
    testbuf = (float*) malloc(200000*sizeof(float)); // "dynamic" malloc
    memset(testbuf, 0, 200000*sizeof(float)); // Make sure buffer is empty.
    // Code (irrelevant to example)
    free(testbuf);
}

So this does not answer the question what the maximum capacity of stack memory is for the visual studio debugger but it does provide a workaround to the problem.

I hope this will help someone.



来源:https://stackoverflow.com/questions/33778570/visual-studio-debug-maximum-buffer-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!