The target_pid_to_exec_file MinGW implementation win32-nat.c:win32_pid_to_exec_file is currently an empty stub, as I mentioned on http://sourceware.org/ml/gdb/2007-10/msg00104.html. This patch fills the gap. The patch covers 9x/NT, and tries to work even if psapi.dll isn't present, as it isn't part of the OS. To do that, it has to resort to non documented NT funcionality... If that doesn't work, it falls back into using psapi.dll. I'd be very happy if someone could point me at better ways to get at executable from a PID on Windows, or at a filename from a file handle. Note that de documented way to use a mapping relies on psapi.dll. This is also useful when debugging a native win32 app from a Cygwin gdb. Tested on XP Pro SP2, i686-pc-cygwin, no changes. OK ? -- Pedro Alves