Re: How to connect to children process




So you want to communicate with the debugger from the debuggee?
AFAIK there is no direct API for that even in WinDbg, but the communication
can be achieved via OutputDebugString or special exceptions.

In case of OutputDebugString, you use it to pass commands from the debuggee
to the debugger (WinDbg), the commands are preceded by a special prefix,
and the debugger should be made aware of this prefix via .ocommand command.

In case of exceptions, the debuggee raises an application-specific exception
(usually within __try..__except so that it's handled), and the debugger is configured
with sx* command to run a set of user-defined commands when this exception is raised.

I haven't had to use kernel debugger for a long time, so I don't know
if these approaches can work there (OutputDebugString probably does not,
but exception-based approach should probably work).

Oleg


"Metek" <Metek@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D5C71AB9-BDC7-4F24-9E2C-26DCC16D412A@xxxxxxxxxxxxxxxx
Oleg,

Local debug is not always suitable. Therefore we would like to find more
general solution.

Other manual operations are:
(a) Re-starting of process A under WinDbg
(b) Reload symbols at first break (.reload /user)
(c) Restoring of break points (or embedding of DebugBreak(s))

Al




"Oleg Starodumov" wrote:


The problem of locked pdb should not exist in the local scenario
(when debugging the parent process (A) and its children with WinDbg
on the local machine).

What other manual operations are needed at this time (in local scenario)?
(other than recompiling the dll and (optionally) copying the new version
over the old one?)

Oleg

Oleg,

Main problem is amount of manual operations required per debug cycle.
Locking of symbols is only part of this problem.

When I recompile, linker complains that .PDB file cannot be written. For
solve this, I break to WinDbg and invoke .reload /user. After it linker works.

But as I said - loking is only part of the problem. Another part is that
connection to DLL with debugger takes sensible amount of time and manual
operations.

Therefore I'm looking for a method to automate entire procedure.

With best regards,

Al









.



Relevant Pages

  • Re: How to connect to children process
    ... The WinDbg approach is clear for me. ... I have another small question to you related to my debug ... debugger at any place that can require debug. ... This mode is not ideal since VS2003 and WinDbg always try to lock DLL ...
    (microsoft.public.vsnet.debugging)
  • Re: Debugging Tools for Windows - WinDbg
    ... Is it free and better than the debugger built in VS .Net 2005? ... VS and WinDbg are designed with different goals in mind. ... VS debugger is targeted towards better usability and productivity when performing ... E.g. VS2005 introduces some of the most useful commands of WinDbg ...
    (microsoft.public.vc.mfc)
  • Re: How to connect to children process
    ... The WinDbg approach is clear for me. ... I have another small question to you related to my debug ... debugger at any place that can require debug. ... This mode is not ideal since VS2003 and WinDbg always try to lock DLL ...
    (microsoft.public.vsnet.debugging)
  • Problem attaching WinDbg to target after WDK7600 upgrade
    ... I installed the new WDK and get the following output when I run WinDbg ... Microsoft Windows Debugger Version 6.11.0001.404 X86 ... Copyright Microsoft Corporation. ...
    (microsoft.public.development.device.drivers)
  • Re: debugging user mode code with windbg in kd session
    ... You can run the VS debugger on the target ... Until Microsoft gives us a higher level of integration between Windbg ... You can go Tools, External Tools, and you get a dialog ... I use that setup to debug my test applications. ...
    (microsoft.public.development.device.drivers)

Loading