This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR/2386 [2/2]: MinGW attach to process without an exec file


I have a couple of questions, out of curiosity...

> 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 we are going to have some code that does this natively as suggested
below, why have some code that would work on cygwin only? Is the above
going to cover more cases (windows versions?) than the approach below?

>   - 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 you propose another fallback approach, it means that this would
not necessarily work all the time. Do you know when it wouldn't work?
If you do, then perhaps we could document this in the code.

>   - If that fails, GetModuleFileNameEx from psapi.dll is used.

Same here, if we know the conditions when this would or woudln't work,
a comment would be very helpful for future contributors.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]