Monitoring call stack size in Visual Studio

前端 未结 3 1313
栀梦
栀梦 2021-01-13 07:17

Is there a way to monitor the call stack size in Visual Studio ? A call stack window is provided while running but does not show the size of the stack. I am using C++ and fa

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-13 07:36

    Using a data breakpoint can be helpful here. Wherever you happen to be in the code, it doesn't matter as long as you are on the right thread, use Debug + New Breakpoint + New Data Breakpoint. In the address box type @esp - 250000. Press F5 to continue running and it will break somewhere inside the recursion when a quarter of the available stack space has been consumed. The exact offset from esp isn't critical.

提交回复
热议问题