From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27392 invoked by alias); 23 Nov 2007 16:33:08 -0000 Received: (qmail 27382 invoked by uid 22791); 23 Nov 2007 16:33:08 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.185) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 23 Nov 2007 16:33:03 +0000 Received: by nf-out-0910.google.com with SMTP id b11so2898505nfh for ; Fri, 23 Nov 2007 08:33:00 -0800 (PST) Received: by 10.86.53.8 with SMTP id b8mr9686548fga.1195835580181; Fri, 23 Nov 2007 08:33:00 -0800 (PST) Received: by 10.86.27.20 with HTTP; Fri, 23 Nov 2007 08:33:00 -0800 (PST) Message-ID: <4053daab0711230833xa5091e7ue5494b97ce276049@mail.gmail.com> Date: Fri, 23 Nov 2007 16:33:00 -0000 From: "Pedro Alves" To: gdb-patches@sourceware.org Subject: Re: [RFA] gdb/win32-nat.c: do not call CloseHandle on process and thread handles In-Reply-To: <20071123011754.GB31180@ednor.casa.cgf.cx> 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> <4053daab0711220456q46cca9b4m3714c35bcc805518@mail.gmail.com> <002c01c82d0f$8c789050$a569b0f0$@u-strasbg.fr> <4053daab0711220637h2bc01450ra45a19f4013fd44d@mail.gmail.com> <20071123011754.GB31180@ednor.casa.cgf.cx> X-Google-Sender-Auth: 7215d11595851491 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/msg00430.txt.bz2 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