Visual Studio 2008:如何暂停正在运行的程序以查看变量值?
我已经开始了一个很长的循环,我不想重新开始(现在已经运行了 3 个小时,我计算它只运行了 1 个小时),我担心我的程序工作不正确,因为它花了很长时间。我太愚蠢了,根本无法为自己输出任何状态值(我不认为这会花费该死的 3 个小时)。
那么,当程序以“发布”模式从 Visual Studio 启动时,是否有某种方法可以监视一个特定的变量值?
I have started a long loop, and i dont want to start it over (been running 3 hours now, i calculated it to run only 1 hour instead), and i am afraid that my program is working incorrectly because its taking so long. I was too stupid to actually output any state values for myself (i didnt think it would take 3 damn hours).
So, is there some way to spy one specific variable value while the program was launched from visual studio in "Release" mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您要做的就是附加到正在运行的进程
此时,您将在调试器中中断并能够检查正在运行的程序
What you want to do is attach to the running process
At this point you will be broken in the debugger and able to inspect the running program
将调试器附加到正在运行的程序。设置断点。沐浴在荣耀之中。
当然,这一切都假设您构建了 PDB。如果你不这样做,那你就很不走运了。
Attach the debugger to the running program. Set a breakpoint. Bask in the glory.
Of course, this all assumes you built PDBs. If you didn't, you're pretty much out of luck.
如果程序是从 Visual Studio 启动的,则它可能已经有一个附加到该进程的调试器 (Visual Studio)。
Visual Studio 的工具栏上将有类似 VCR/DVD 的按钮,用于执行“执行”、“停止”、“暂停”等操作。按“停止”按钮,或进入“调试”菜单并选择“全部中断”。
If the program was launched from Visual Studio it is possible that it already has a debugger (Visual Studio) attached to the process.
Visual Studio will have VCR/DVD looking buttons on the toolbar for Go, Stop, Pause, etc. Press the Stop button, or go into the Debug menu and choose Break All.