From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31061 invoked by alias); 24 Oct 2007 08:40:06 -0000 Received: (qmail 31052 invoked by uid 22791); 24 Oct 2007 08:40:06 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.191) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 24 Oct 2007 08:40:01 +0000 Received: by nf-out-0910.google.com with SMTP id b11so119079nfh for ; Wed, 24 Oct 2007 01:39:59 -0700 (PDT) Received: by 10.78.140.17 with SMTP id n17mr181202hud.1193215198754; Wed, 24 Oct 2007 01:39:58 -0700 (PDT) Received: by 10.78.188.17 with HTTP; Wed, 24 Oct 2007 01:39:58 -0700 (PDT) Message-ID: <4053daab0710240139o1898369jc54fbb75c6c48cef@mail.gmail.com> Date: Wed, 24 Oct 2007 08:51:00 -0000 From: "Pedro Alves" To: "Pierre Muller" Subject: Re: [RFC] win32-nat.c: Handle EXCEPTION_INVALID_HANDLE as SIGSYS Cc: gdb-patches@sourceware.org In-Reply-To: <001301c81613$d5492730$7fdb7590$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <008101c814b1$9aeb2dd0$d0c18970$@u-strasbg.fr> <20071023214730.GB5570@ednor.casa.cgf.cx> <001301c81613$d5492730$7fdb7590$@u-strasbg.fr> X-Google-Sender-Auth: 86e43dbfd214f14c 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-10/txt/msg00568.txt.bz2 Pierre Muller wrote: > > If I cut my patch into three parts: > 3) Remove wrong CloseHandle calls I'd prefer if this went in first. I'm convinced this is the correct thing to do everywhere. (Hey, I'm happy in that allows me to remove an ugly #ifdef in gdbserver/win32-low.c.) ( ( ( If it isn't [the correct thing to do everywhere], then we can follow Cygwin's lead, and install a top level SEH handler in gdb that handles this exception. It could have always have been done in gdb the first place, even for Cygwin. Remember, the exception is only thrown iff a debugger is attached, and a debugger can easilly not pass it to the inferior. That would mean 0 changes to win32-nat.c debug API usage. Of course, any other inferior that throws that exception will have the same problem. ) ) ) > 1) Handle EXCEPTION_INVALID_HANDLE exception as a SIGSYS target signal > 2) Add the stoponinvalidhandle EXCEPTION_INVALID_HANDLE is not quite a SIGSYS. Plus, a Cygwin inferior should never see this, as you shouldn't be using CloseHandle in user apps there anyway. Maybe we can take the oportunity to implement more generic Windows exceptions support, not just EXCEPTION_INVALID_HANDLE. Something similar to the "handle" command. > > then, after the 1) is applied, > you will get several SIGSYS when debugging gdb with itself. > I suppose that this would introduce lots of > new failures to the testsuite, especially in the gdb.gdb subdirectory. > Only on MinGW gdb, so they wouldn't qualify as "new" failures. And only on tests that load gdb in gdb, or that have a `close' with a broken argument. > I would really prefer to keep trace of > the old CloseHandles, in case we discover that under special > circumstances, or for some versions of the system, > these calls are needed. > I'd prefer we don't add such ugliness. Cheers, Pedro Alves