This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PR/2386 [2/2]: MinGW attach to process without an exec file
> Date: Fri, 28 Dec 2007 22:34:08 +0000
> From: Pedro Alves <pedro_alves@portugalmail.pt>
>
> Christopher Faylor wrote:
> > I'm not going to comment on the MinGW aspects of this other than to note
> > that I think it is rather intrusive and I don't worrying about ancient
> > Windows versions is a good idea.
> >
> [...]
> Can we reach a compromise here ? I've removed the 9x support from this
> patch. With the changes inplace, win32_pid_to_exec_file
>
> - looks in the Cygwin processes using cygwin_internal (CW_GETPINFO, ...).
> This is what's done currently, so Cygwin processes will be detected
> like before.
> - If that fails, tries to get at the filename associated with the file
> handle that the debug api gives us in the CREATE_PROCESS_DEBUG_EVENT.
> Previously, it was just closed; we now store it in a global variable.
> This relies on the internal NT name of the HANDLE, and it may change
> in future releases, hence,
> - If that fails, GetModuleFileNameEx from psapi.dll is used.
I'm not sure this version is significantly less intrusive than the
original one, but that's for Chris to judge (FWIW, I didn't see much
of intrusiveness in the original patch).