外部测试环境 - C ++时程序崩溃 [英] Program crashes when outside test environment - C++

查看:169
本文介绍了外部测试环境 - C ++时程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序运行时从Visual Studio 2010 Express中运行时,但是当构建和取出,它有问题。我已经设置外部测试环境与从Visual Studio中运行时相同,这不应该是问题。我想将它附加到.exe以查看崩溃的地方,但我没有非快速版本。

I have a program that runs fantastically when run from inside Visual Studio 2010 Express but when built and taken out, it has problems. I have set up the external test environment the same as when it is run from within Visual Studio so that shouldn't be the problem. I want to attach it to the .exe to see where the crash is but I don't have the non-Express versions.

有任何建议吗?为什么程序会在VSC ++ 2010 Express环境之外崩溃,但在内部运行得很好。

Any suggestions? Why would a program crash outside of the the VSC++ 2010 Express environment but run perfectly inside.

我会发布代码,但它是一个巨大的项目,错误。

I would post code but it's a huge project, not a line that would cause an error.

非常感谢您的时间。

推荐答案

您可以使用免费提供的 Windows的调试工具调试此功能。有大量文档和快速入门指南,特别是安装中包含的chm。在您的情况下,您可以尝试以下操作:

You could debug this using the freely available Debugger Tools for Windows. There's plenty of documentation and quick start guides available, especially the chm included in the install. In your case, you may want to try the following:


  1. 确保您的应用程序的PDB位于共享位置。 / li>
  2. 附加到正在运行的应用程序实例: windbg -p< PID> 。注意,您也可以通过执行 windbg -g foo.exe ,在调试器的上下文中启动该程序。

  3. 重新启动崩溃

  4. 将符号路径更改为符号和Microsoft公共符号服务器,以获取组件的正确符号: .sympath x:\YourPathToPDBs; SRV * x:\symbols * http://msdl.microsoft.com/download/symbols

  5. 告诉调试器使用以下路径重新加载符号: code> .reload

  6. 通过在调试器中打开 k li>
  1. Make sure you have the PDBs for your app available somewhere on a share.
  2. Attach to the running instance of the app: windbg -p <PID>. Note that you can also start the program under the context of the debugger by doing windbg -g foo.exe.
  3. Repro the crash.
  4. Change the symbol path to your symbols and the Microsoft public symbol server to get proper symbols for components: .sympath x:\YourPathToPDBs; SRV*x:\symbols*http://msdl.microsoft.com/download/symbols
  5. Tell the debugger to reload symbols using your path: .reload
  6. Get a callstack by hitting k in the debugger.

这是你需要弄清楚它在哪里崩溃的准系统。然后,您可以更深入地尝试通过查看调试器chm或MSDN或 Tess的博客。一个有用的命令是 dv 来转储特定框架的局部变量。如果callstack没有给出行号,输入 .lines ,然后点击 k kb

That's the barebones you need to figure out where it's crashing. You can then go deeper and try to analyze exactly why it's crashing by looking at the debugger chm or other resources on MSDN or Tess's blog. One useful command is dv to dump local variables for a particular frame. If the callstack doesn't give line numbers, type .lines and then hit k or kb.

这篇关于外部测试环境 - C ++时程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆