自动将vs2005调试器附加到子进程 [英] Automatically attach vs2005 debugger to a child processes

查看:138
本文介绍了自动将vs2005调试器附加到子进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Visual Studio 2005中构建的主要C ++应用程序,称为A.exe.它产生一个子进程B.exe.我通过按F5键在调试器中运行进程A-我知道在进程B中达到断点的唯一方法是等待A将其启动,然后运行Debug-> Attach to Process,然后手动选择B.exe.如果我需要在流程B中调试初始化代码,那么这种方法就不能很好地工作-我必须从一开始就开始进行10秒钟的睡眠.

vs2005 GUI中缺少一些技巧吗?

顺便说一下,我正在使用本机代码.

谢谢, 内森

解决方案

您可以告诉Windows在启动特定进程时自动附加调试器(通过在注册表设置中指定进程名称).

详细信息在这里: http://msdn.microsoft.com/en -us/library/a329t4ed(v = vs.100).aspx

I have a main C++ app built in Visual Studio 2005, called A.exe. It spawns a child process, B.exe. I run process A in the debugger by hitting F5 -- the only way I know to hit breakpoints in process B is to wait for A to kick it off, then run Debug -> Attach to Process, and manually select B.exe. This doesn't work very well if I need to debug initialization code in process B -- I have to start putting in 10 second sleeps at the beginning.

Is there some trick in the vs2005 GUI that I'm missing?

I'm using native code, by the way.

Thanks, Nathan

解决方案

You can tell Windows to automatically attach the debugger when a certain process is started (by specifying the process name in a registry setting).

The details are here: http://msdn.microsoft.com/en-us/library/a329t4ed(v=vs.100).aspx

这篇关于自动将vs2005调试器附加到子进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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