我在 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
On the File menu, click Open and select Project.
In the Open Project dialog box, click the drop-down list next to the File name box, and select All Project Files.
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/