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: [RFA] gdb/win32-nat.c: do not call CloseHandle on process and thread handles


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


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