如何在 Visual Studio 中找到堆栈跟踪?
我问这个问题是因为我在调试发生的异常时无法在 Visual Studio 中找到堆栈跟踪。
I ask because I couldn't find the stack trace in Visual Studio, while debugging an exception that occurred.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
调试时,转到调试 -> 窗口 -> 调用堆栈
While debugging, Go to Debug -> Windows -> Call Stack
调试时和
遇到断点时。
CTRL+ALT+C
While debugging, and
When you hit a break-point.
CTRL+ALT+C
默认快捷键是 Ctrl-Alt-C。
The default shortcut key is Ctrl-Alt-C.
您的意思是找到抛出的异常位置的堆栈跟踪吗? 这要么是“调试/异常”,要么是更好的 - Ctrl-Alt-E。 为您想要中断的异常设置过滤器。
甚至有一种方法可以在捕获异常之后重建抛出器堆栈,但这实际上是不愉快。 在投掷中设置中断要容易得多。
Do you mean finding a stack trace of the thrown exception location? That's either Debug/Exceptions, or better - Ctrl-Alt-E. Set filters for the exceptions you want to break on.
There's even a way to reconstruct the thrower stack after the exception was caught, but it's really unpleasant. Much, much easier to set a break on the throw.
使用“调用堆栈”窗口
要在 Visual Studio 中打开“调用堆栈”窗口,请从“调试”菜单中选择“Windows”>“调用堆栈”。 要将本地上下文设置为堆栈跟踪显示中的特定行,请双击该行的第一列。
http://msdn.microsoft。 com/en-us/library/windows/hardware/hh439516(v=vs.85).aspx
Using the Call Stack Window
To open the Call Stack window in Visual Studio, from the Debug menu, choose Windows>Call Stack. To set the local context to a particular row in the stack trace display, double click the first column of the row.
http://msdn.microsoft.com/en-us/library/windows/hardware/hh439516(v=vs.85).aspx
将此视为当前更新(Windows 10(版本 1803)和 Visual Studio 2017):
我无法查看堆栈跟踪窗口,但找到了一个选项/菜单项来查看它。 经过进一步调查,此功能似乎在 Windows 10 上不可用。有关详细信息,请参阅:
https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/viewing-the-call-stack-in -visual-studio
从上面的链接复制:
“此功能在 Windows 10 版本 1507 及更高版本的 WDK 中不可用。”
Consider this as the current update (Windows 10 (Version 1803) and Visual Studio 2017):
I was unable to view the stack trace window and did find an option/menu item to view it. On investigating further, it seems this feature is not available on Windows 10. For further information please refer:
https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/viewing-the-call-stack-in-visual-studio
Copied from the above link:
"This feature is not available in Windows 10, version 1507 and later versions of the WDK."
对于 Visual Studio 2019,快捷方式(调试时并在断点处停止) 为:
Ctrl+Alt+C 现在您还可以使用 Ctrl+L
屏幕截图相当旧。
这是 Visual Studio 2019 的一个(在调试菜单下):
For Visual Studio 2019, the shortcut (while debugging and stopped at a breakpoint) is:
Ctrl+Alt+C and now you can also use Ctrl+L
The screenshot is pretty old.
Here is one for Visual Studio 2019 (under the debug menu):