在Visual Studio中监视调用堆栈大小 [英] Monitoring call stack size in Visual Studio
问题描述
有没有办法在Visual Studio中监视调用堆栈大小?在运行时提供调用堆栈窗口,但不显示堆栈的大小。我使用C ++和面临堆栈溢出问题。我知道某些递归函数可能是错误的,但是在解决这些问题之前,我想监视调用堆栈的大小,看看发生了什么。
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 facing stack overflow issue. I know something might be wrong about some recursive functions I am using, but before solving these issues I would like to monitor the call stack size to see what is going on.
推荐答案
使用数据断点在这里很有用。无论你碰巧在代码中,只要你在正确的线程,没关系,使用Debug + New Breakpoint + New Data Breakpoint。在地址框中键入 @esp - 250000
。按F5继续运行,并且当可用堆栈空间的四分之一已被消耗时,它将在递归内的某处断开。与esp的准确偏移不是关键。
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.
这篇关于在Visual Studio中监视调用堆栈大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!