From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18303 invoked by alias); 22 Nov 2007 12:56:39 -0000 Received: (qmail 18293 invoked by uid 22791); 22 Nov 2007 12:56:39 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.188) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Nov 2007 12:56:33 +0000 Received: by nf-out-0910.google.com with SMTP id b11so2509512nfh for ; Thu, 22 Nov 2007 04:56:30 -0800 (PST) Received: by 10.86.76.16 with SMTP id y16mr8412511fga.1195736190548; Thu, 22 Nov 2007 04:56:30 -0800 (PST) Received: by 10.86.27.20 with HTTP; Thu, 22 Nov 2007 04:56:30 -0800 (PST) Message-ID: <4053daab0711220456q46cca9b4m3714c35bcc805518@mail.gmail.com> Date: Thu, 22 Nov 2007 12:56:00 -0000 From: "Pedro Alves" To: "Pierre Muller" Subject: Re: [RFA] gdb/win32-nat.c: do not call CloseHandle on process and thread handles Cc: gdb-patches@sourceware.org In-Reply-To: <002801c82d06$21bdf510$6539df30$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <002801c82d06$21bdf510$6539df30$@u-strasbg.fr> X-Google-Sender-Auth: 2732c03161e2510f X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00408.txt.bz2 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