Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you asking how to break into a debugger when child process procA creates the handle to logB? I'll assume that you're using Windows since you mentioned Process Explorer.</p> <p>One way to do this is to use the <a href="http://msdn.microsoft.com/en-us/library/a329t4ed.aspx" rel="nofollow noreferrer"><code>Image File Execution Options</code></a> registry key to specify that every time <code>procA.exe</code> is started, you want to launch the debugger. When the debugger starts, you can set a breakpoint in the code that creates the handle to logB and then let the process continue. This works with any debugger (such as WinDbg or ntsd, or profiling tools such as AQTime), not just Visual Studio.</p> <p>Another way to do this is to tell the debugger to attach to all child processes. There are several ways to <a href="http://msdn.microsoft.com/en-us/library/cc266362.aspx" rel="nofollow noreferrer">enable this behavior with WinDbg or ntsd</a>. That way, you attach the debugger to the parent process, and it will auto-attach to child process procA, and you can set a breakpoint in the appropriate code.</p> <p>Yet another way is to temporarily modify your code to generate a breakpoint exception using the <a href="http://msdn.microsoft.com/en-us/library/ms679297.aspx" rel="nofollow noreferrer"><code>DebugBreak()</code></a> function when it creates the handle to logB, then attach a debugger using just-in-time debugging. Note that if your code handles structured exceptions without an exception filter expression (which is a bad idea), this won't work, and may have surprising results (deadlock, memory leak, etc.). </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload