Re: How to connect to children process
- From: Metek <Metek@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Feb 2007 04:52:01 -0800
Hi Oleg,
Thank you very much for the hint. The WinDbg approach is clear for me.
I also read your article - it's really very interesting and helpful - thank
you very much. I have another small question to you related to my debug
situation.
For your understanding: I have neither source nor symbols for process "A"
and "B". My task is to create several (about 200) DLLs "C". Process "A" is
almost always working (however this is a User process in Administrative
account).
Because of huge number of DLLs, I need to decrease amount of manual
operations to minimum.
DLLs are created in VS2003 with huge amount of tracings and breaks to
debugger at any place that can require debug. However connection to debugger
is time consuming. Right now I'm using remote PC and WinDbg started in kernel
mode. This mode is not ideal since VS2003 and WinDbg always try to lock DLL
..PDB file and I have to reload symbols to WinDbg after each rebuild. I would
prefer to use VS debugger or WinDbg on local PC, if possible.
I'm looking for the method that allow to start debugger and load proper
symbols for DLL automatically (either at DLL WinMain or at first break). It
could be some code added to checked version of DLL and dealing with Debug API
or any kind of script in debugger.
Do you have any experience with such kind of tasks? Can you indicate any
sample of code that doing similar task?
With best regards,
Al
"Oleg Starodumov" wrote:
.
I have following debug situation:
Process "A" randomly starts process "B". Process "B" works for short (2-5
sec) time and during execution links dynamically to DLL "C". I debug DLL "C"
and need catch debug tracing from it.
The problem is that I cannot start process "B" in debugger (since I do not
start it directly) and cannot attach to running process since ptocess "B"
appears in the list of running process for very short time.
Any recommendation how configure Visual Studio debugger and/or WinDbg will
be highly appreciated.
There are many ways to achieve it. The easiest but intrusive way is to
suspend the dll "C" temporarily while it is called (using MessageBox or Sleep)
and use this timeout to attach debugger. DebugBreak and the like can also
be used to break into that process.
If you don't want to modify the code to be able to debug, the easiest approach
is with WinDbg. Attach debugger to process "A" and use '.childdbg 1' command
to enable debugging of child processes. After this command, WinDbg will
automatically start debugging any process launched by process "A".
Visual Studio does not support .childdbg-like approach, but similar effect
still can be achieved e.g. using IFEO approach. You can find more details about it here:
http://www.debuginfo.com/articles/debugstartup.html
--
Oleg
[VC++ MVP http://www.debuginfo.com/]
- Follow-Ups:
- Re: How to connect to children process
- From: Oleg Starodumov
- Re: How to connect to children process
- References:
- Re: How to connect to children process
- From: Oleg Starodumov
- Re: How to connect to children process
- Prev by Date: Re: How to connect to children process
- Next by Date: How to Enable Mixed Mode Debugging in VS2005 Asp.Net Web Site?
- Previous by thread: Re: How to connect to children process
- Next by thread: Re: How to connect to children process
- Index(es):
Relevant Pages
|
Loading