On Jan 27 15:12, Jon Turney wrote: > On 26/01/2024 11:52, Corinna Vinschen wrote: > > > - Create a named mutex with a reproducible name (no need to use > > > the name as parameter) and immediately grab it. > > > - Call CreateProcess to start the debugger with CREATE_SUSPENDED > > > flag. > > > - Create a HANDLE array with the mutex and the process HANDLE. > > > > On second thought, it might be a good idea to make this > > interruptible as well, but given this is called from the > > exception handler this may have weird results... > > > - Call ResumeThread on the primary debugger thread. > > > - Call WFMO with timeout. > > > > > > Later on, the debugger either fails and exits or it calls > > > ReleaseMutex after having attached to the process. > > > > > > - WFMO returns > > > - If the mutex has triggered, we're being debugged (but check > > > IsDebuggerPresent() just to be sure) > > > - If the process has triggered, the debugger exited > > > - If the timeout triggers... oh well. > > This seems like quite a lot of work, for very marginal benefit. > > And doing lots of complex work inside the process when we're in the middle > of handling a SEGV seems like asking for trouble. > > I think I'll leave this alone for the moment, and we can see what (if any) > problems surface.
Ok, no worries. Corinna