如何使用代码调试进程? [英] How to debug a Process using in Code?

查看:94
本文介绍了如何使用代码调试进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,

我有这样的代码



Hi Team,
I have code like this

ProcessStartInfo proc = new ProcessStartInfo( "D:\MyAPP\Test.exe", Arguments );
proc.CreateNoWindow = true;
proc.UseShellExecute = false;
proc.WorkingDirectory = Path.GetDirectoryName( D:\MyAPP\Test.exe );

Process MyProcess = Process.Start( proc );





我想调试过程(测试。 exe)我的调试器来到那个代码部分。

请帮帮我。



谢谢

Dileep



I want to debug the process (Test.exe) when my debugger comes to that code part.
Please help me.

Thanks
Dileep

推荐答案

你不能从调试会话进入Text.EXE的代码 - 它是一个单独的进程,没有与之关联的调试器,并且它与开始运行的线程不共享相同的进程空间。



话虽如此,你可以做到:但它不是那么简单你可能想要的,你可能不得不在Test.EXE中调用Debug.Break来开始调试,否则你什么都看不到。

开始阅读:http://msdn.microsoft.com/en-us/library/a329t4ed%28v=VS.90%29 .aspx [ ^ ]如果您的整个系统开始出现奇怪或缓慢的行为,请不要责怪我!
You can't "step into" the code of Text.EXE from your debug session - it's a separate process and doesn't have a debugger associated with it, and it doesn't share the same "process space" as the thread that started it running.

Having said that, you can do it: but it's not as simple as you might want, and you will probably have to call Debug.Break in Test.EXE to start debugging or you won't see anything.
Start reading: http://msdn.microsoft.com/en-us/library/a329t4ed%28v=VS.90%29.aspx[^] and don't blame me if your whole system starts to behave oddly or slows down!


这篇关于如何使用代码调试进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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