From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27216 invoked by alias); 6 Feb 2006 23:17:30 -0000 Received: (qmail 27190 invoked by uid 22791); 6 Feb 2006 23:17:29 -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; Mon, 06 Feb 2006 23:17:28 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F6Fbp-0008Pi-Sh; Mon, 06 Feb 2006 18:17:25 -0500 Date: Mon, 06 Feb 2006 23:17:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: RFA: Various Windows (mingw32) additions, mostly relating to select or serial ports Message-ID: <20060206231725.GA32216@nevyn.them.org> Mail-Followup-To: Mark Kettenis , gdb-patches@sourceware.org References: <20060203220529.GA3578@nevyn.them.org> <20060206210238.GB28917@nevyn.them.org> <200602062301.k16N1hdu008774@elgar.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200602062301.k16N1hdu008774@elgar.sibelius.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/msg00141.txt.bz2 On Tue, Feb 07, 2006 at 12:01:43AM +0100, Mark Kettenis wrote: > > Date: Mon, 6 Feb 2006 16:02:38 -0500 > > From: Daniel Jacobowitz > > > > On Fri, Feb 03, 2006 at 05:05:29PM -0500, Daniel Jacobowitz wrote: > > > Fixes, all for a mingw32-hosted GDB: > > > > Here is a revised version, in which the Windows select magic does not > > live in event-loop.c, and including the NEWS entry. I haven't changed > > the pipe polling code; thanks to Ian for his suggestions, but I'm > > not sufficiently sure they're workable. > > > > Are there any bits of this patch that strike you as too ugly or in the > > wrong place? > > Hmm, can't mingw_select() just be called select()? That'd remove much > of the ugliness. No, it can't. Two reasons. One is the same reason I mentioned for strerror: with __attribute__((dllimport)) in the headers, GCC will generate a load from the import table at call sites, and overriding the function won't work. MinGW doesn't use this today, if compiling with GCC, but from the bits in the header files, it looks like they either did in the past or want to in the future. And I think they do use the equivalent when compiling with MSVC. No, I haven't tried building GDB with MSVC. Another reason is that I don't want to intercept all calls to select. First of all, because select() is a useful function on Windows (works on sockets only, but does work there) and it would be a valid way to implement mingw_select for sockets - I nearly did that. And second because we call select, the socket version, explicitly from ser-tcp.c before the connection and associated serial device are completely set up. If I could get around #1, I would look into handling #2, but it seems likely to be more confusing than helpful, to me. It wouldn't get rid of too much of the ugliness either, I'm afraid :-( For instance you'd still need gdb_select.h; if you want fd_set on Windows, you need or . No to be found. -- Daniel Jacobowitz CodeSourcery