From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1722 invoked by alias); 9 Feb 2006 14:57:59 -0000 Received: (qmail 1713 invoked by uid 22791); 9 Feb 2006 14:57:58 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 09 Feb 2006 14:57:57 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F7DF4-0006bM-17; Thu, 09 Feb 2006 09:57:54 -0500 Date: Thu, 09 Feb 2006 14:57:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: RFA: Support Windows extended error numbers in safe_strerror Message-ID: <20060209145753.GA25270@nevyn.them.org> Mail-Followup-To: Mark Kettenis , Eli Zaretskii , gdb-patches@sourceware.org References: <20060203215455.GA3501@nevyn.them.org> <20060206173550.GB22947@nevyn.them.org> <200602062254.k16MsagK009925@elgar.sibelius.xs4all.nl> <20060206225829.GA31895@nevyn.them.org> <20060208000855.GA5040@nevyn.them.org> <200602082107.k18L7xRh013417@elgar.sibelius.xs4all.nl> <200602082310.k18NAQNe027038@elgar.sibelius.xs4all.nl> <15661.192.87.1.22.1139496247.squirrel@webmail.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15661.192.87.1.22.1139496247.squirrel@webmail.xs4all.nl> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00212.txt.bz2 On Thu, Feb 09, 2006 at 03:44:07PM +0100, Mark Kettenis wrote: > > For example, here's a suggestion for what I think is more seamless > > integration of MinGW and other ``illegal aliens'', here for the > > `select' issue: > > > > int gdb_select (...) > > { > > if (select_hook) > > return (*select_hook) (...); > > else > > return select (...); > > } > > > > We make `select_hook' a global pointer to a function, and then MinGW > > can define its own emulation on win32-something.c and plug its address > > into `select_hook'. > > There is absolutely no reason for this additional complexity. GDB will > never be able to run on two different hosts at once. Just having two > different implementations and have configure.host choose the apprpriate > one will work just fine. FYI, I'm willing to (and now planning to) go ahead with Mark's plan, but let me point out a disadvantage to each of these two options... Right now, we only know of POSIX-ish systems and native Windows as interesting hopes. I'm sure many of us fervently hope that there are no others worth going through this for. But is it really wise to create a host-specific override mechanism which can't scale? If I do this Mark's way, overriding a function requires putting it into "posix-hdep.c" and another implementation in "mingw-hdep.c". There's no way to override only of the functions in posix-hdep.c. If I do it Eli's way, the function can live anywhere, and is overridden by setting "function_hook" (or "function_override"?) in _initialize_mingw_hdep. So a new host could override just select. Of course there's a flip side. If I do it Eli's way, the default version has to compile and link. Which happens to be the case for the two examples we have today, but also a pretty limiting assumption. Neither of them's perfect. Mark's is marginally less intrusive, and I'm halfway to an implementation already. -- Daniel Jacobowitz CodeSourcery