This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] gdb/win32-nat.c: do not call CloseHandle on process and thread handles
On Nov 23, 2007 1:17 AM, Christopher Faylor wrote:
> On Thu, Nov 22, 2007 at 02:37:26PM +0000, Pedro Alves wrote:
> >Don't know, you'll have to check, but I doubt it. It just might be
> >easier to always open a handle to the process (OpenProcess), and not
> >touch the one coming on the event. Then you would always close the
> >process handle, because you know you're the one who opened it. OTTOMH,
> >gdbserver does something similar, but leaks. This uses an extra handle
> >on the normal case, but I don't think I'd care, as long as there are no
> >leaks. Otherwise, you'll just have to keep a flag somewhere.
>
> Are you sure that it's always possible for the debugger to open a handle
> to the process? It is a given that there will always be a handle
> available via the debugging interface but I don't know that it is a
> given that a nonprivileged process would necessarily be able to open a
> handle to a privileged process. I think I'd prefer a flag.
>
I'd be surprised if you could be able to debug/run/'attach to' a
process, but not be
able to get a handle to it. Anyhow, FWIW, I'm OK with a flag as well.
--
Pedro Alves