在 Visual C 上调试特定的可执行文件2008年快报
Visual C++ 2008 有一个很棒的工具,称为“附加到进程”,它开始监视特定进程以调试符号并正确处理断点。这太棒了,但我想要更多。
我想将调试会话附加到可执行文件,以便在执行该文件时,调试器接受命令。因此,我会将调试会话附加到 d:\listener\solver.exe,并启动一个最终将调用此可执行文件的应用程序,然后当它到达时,Visual C++ 将在屏幕上弹出一个断点。
这可能吗?我该怎么做?
Visual C++ 2008 has a great tool called "Attach to Process", which start watching a specific process for debugging symbols and handles correctly your breakpoints. This is fantastic, but I would like some more.
I would like to attach my debugging session to a executable file, such that when it is executed, debugger takes command. So I would, say, attach my debugging session to d:\listener\solver.exe
, and start an app that eventually will call this executable, and then Visual C++ would pop on the screen when it reached a breakpoint.
Is that possible? How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Windows 中有一个内置功能,使您能够启动带有附加调试器的进程。我在另一个问题上写过这个功能。您可以在此处阅读所有相关信息< /a>.
There is a build in feature in windows that enables you to start a process with a debugger attached to it. I wrote about this feature on another SO Question. you can read all about it here.
不确定这会让你走多远,但如果你进入任务管理器,查看进程选项卡,你可以右键单击一个文件并选择“调试”,然后它会将该文件加载到 Visual Studio 中。
尽管如此,它可能只加载机器代码而不是实际代码。但可能值得一试。
Not sure how far this will get you, but if you go into task manager, look at the processes tab, you can right-click a file and choose "Debug" it will then load this file into Visual Studio.
Although, it might just load the machine code and not the actual code. But might be worth checking out.