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
- From: "Pedro Alves" <pedro_alves at portugalmail dot pt>
- To: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 22 Nov 2007 12:56:30 +0000
- Subject: Re: [RFA] gdb/win32-nat.c: do not call CloseHandle on process and thread handles
- References: <002801c82d06$21bdf510$6539df30$@u-strasbg.fr>
Hi Pierre,
Pierre Muller wrote:
> Following the discussion
> http://sourceware.org/ml/gdb/2007-10/msg00131.html
> and
> http://sourceware.org/ml/gdb-patches/2007-10/msg00502.html
>
> I resubmit a part of my original patch that only contains the
> removal of all calls to the win32 API CloseHandle
> with thread or process handles.
>
You'll still have to somehow close this process handle (current_process_handle):
/* Called in pathological case where Windows fails to send a
CREATE_PROCESS_DEBUG_EVENT after an attach. */
static DWORD
fake_create_process (void)
{
current_process_handle = OpenProcess (PROCESS_ALL_ACCESS, FALSE,
current_event.dwProcessId);
main_thread_id = current_event.dwThreadId;
current_thread = win32_add_thread (main_thread_id,
current_event.u.CreateThread.hThread);
return main_thread_id;
}
--
Pedro Alves