From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31719 invoked by alias); 29 Oct 2007 03:06:02 -0000 Received: (qmail 31707 invoked by uid 22791); 29 Oct 2007 03:06:01 -0000 X-Spam-Check-By: sourceware.org Received: from pool-70-20-17-24.bstnma.fios.verizon.net (HELO cgf.cx) (70.20.17.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 29 Oct 2007 03:05:58 +0000 Received: by cgf.cx (Postfix, from userid 201) id 9A18113C304; Sun, 28 Oct 2007 23:05:56 -0400 (EDT) Date: Mon, 29 Oct 2007 03:07:00 -0000 From: Christopher Faylor To: Pedro Alves , gdb-patches@sourceware.org, Pierre Muller Subject: Re: [RFC] win32-nat.c: Handle EXCEPTION_INVALID_HANDLE as SIGSYS Message-ID: <20071029030556.GA18776@trixie.casa.cgf.cx> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org, Pierre Muller References: <008101c814b1$9aeb2dd0$d0c18970$@u-strasbg.fr> <20071023214730.GB5570@ednor.casa.cgf.cx> <001301c81613$d5492730$7fdb7590$@u-strasbg.fr> <4053daab0710240139o1898369jc54fbb75c6c48cef@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4053daab0710240139o1898369jc54fbb75c6c48cef@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) 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/msg00746.txt.bz2 On Wed, Oct 24, 2007 at 09:39:58AM +0100, Pedro Alves wrote: >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. I agree. I thought that I noticed that these handles needed to be closed so I'd rather that my confusion go away as soon as possible. >(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. That seems like a better way to go to me. However, even if it isn't the need to do something like: if (something) DoSomething(arg) should really make you think "Hey, I guess I'd better use a function" which tests something and then calls DoSomething with the arg. >> 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. Ditto. cgf