如何在 Visual Studio 2005 中获取完整的调用堆栈?
如何获得使用 Visual Studio 2005 开发的 C++ 应用程序的完整调用堆栈? 我想要一个完整的调用堆栈,包括系统库中的代码。
我是否必须更改 Visual Studio 中的某些设置,或者是否必须安装其他软件?
How can I get a full call stack for a c++ application developed with Visual Studio 2005? I would like to have a full call stack including the code in the system libraries.
Do I have to change some settings in Visual Studio, or do I have to install additional software?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
或者,(假设未安装 Visual Studio),获取 Windows 的副本调试工具,安装并从调试器 (windbg.exe) 中运行您的应用程序,或者将其附加到已运行的应用程序:
在要观察堆栈跟踪的点处中断调试器 (Ctrl+Break)。 切换到感兴趣的线程(很可能是执行的主线程):
修复系统模块的符号(如果可用,也可能修复应用程序的符号):
发出调用堆栈命令:
Or, optionally (assuming that Visual Studio is not installed), grab a copy of Windows Debugging Tools, install and either run your app from within the debugger (windbg.exe) or have it attach to an already running app:
Break in the debugger at the point you want to observe for stack trace (Ctrl+Break). Switch to the thread of interest (most probably the main thread of execution):
Fix up symbols for system modules (and probably for the app as well if available):
Issue a call stack command:
同意 Clay 的观点,但对于 Symbols Server,您应该从“Windows 调试工具”(Microsoft 免费下载)获取最新的 symsrv.DLL。
(既然你明确询问需要下载什么,我认为你还没有)
Agree with Clay, but for Symbols Server you should get the latest symsrv.DLL from "Debugging Tools For Windows", a free Microsoft download.
(Since you explicitly asked what you need to download, I presume you don't have it yet)
获取所有项目依赖项的调试信息。 这是在项目属性的“配置属性 -> C/C++ -> 常规”部分下指定的。
在菜单上,转到“工具 -> 选项”,然后选择“调试 -> 符号”。
添加一个新的符号位置(文件夹图标),该位置指向 Microsoft 的免费符号服务器“symsrvsymsrv.dllc:\symbols*http://msdl.microsoft.com/downloads/symbols“
在本地某个位置填写“缓存符号”字段,这样您就不会一直访问互联网。
Get debug information for all project dependencies. This is specified under the "Configuration Properties -> C/C++ -> General" section of the project properties.
On the menu, go to "Tools -> Options" then select "Debugging -> Symbols".
Add a new symbol location (the folder icon) that points to Microsoft's free symbol server “symsrvsymsrv.dllc:\symbols*http://msdl.microsoft.com/downloads/symbols“
Fill out the "cache symbols" field with some place locally so you don't go to the internet all the time.