c++ - 如何在 Visual Studio 中调试命令行实用程序

标签 c++ visual-studio debugging

我在 visual studio 中有 C++ 代码和一个带有 pdb 文件的 exe,该 exe 是一个命令行实用程序。

我想调试可执行文件。我无法在 visual studio 中编译源代码,因为它有一个很大的编号。依赖项。

有没有一种方法可以附加调试器来调试可执行文件。

最佳答案

如果它是用 VC++ 编译的,那么是的。运行您的代码,并从菜单附加调试器:“调试/附加到进程”。

如果您想在已附加调试器的情况下启动该过程,请按照本教程进行操作:

http://msdn.microsoft.com/en-us/library/0bxe8ytt.aspx .

To create an EXE project for an existing executable

  1. On the File menu, click Open and select Project.

  2. In the Open Project dialog box, click the drop-down list next to the File name box, and select All Project Files.

  3. Locate the executable, and click OK.

    This creates a temporary solution that contains the executable.

如果您这样做了,您只需点击“调试”即可。

关于c++ - 如何在 Visual Studio 中调试命令行实用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30098847/

相关文章:

Python 等同于 Data::Dumper - 转储原始数据结构以供检查?

c++ - 类型名和标量常量的可变参数模板

c++ - 如何在 Qt 中创建一个粗体的红色文本标签?

javascript - mvc session 过期后,如何使整个页面重定向到登录?

visual-studio - 在 Visual Studio 2017 的 launchSettings.json 中手动定义端口

android - 如何将 Android 调试 keystore 放入颠覆存储库,然后让 Eclipse 使用它?

debugging - 使用命令行参数在 Visual Studio 代码中调试 powershell

c++ - OpenCV 中的 accumulateWeighted 函数断言失败

c++ - 为什么arduino中有两个if语句?

visual-studio - 在 Visual Studio 2017 中抑制某些文件的警告/错误