From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7782 invoked by alias); 8 Dec 2006 20:43:47 -0000 Received: (qmail 7771 invoked by uid 22791); 8 Dec 2006 20:43:46 -0000 X-Spam-Check-By: sourceware.org Received: from pool-71-248-179-54.bstnma.fios.verizon.net (HELO cgf.cx) (71.248.179.54) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Dec 2006 20:43:42 +0000 Received: by cgf.cx (Postfix, from userid 201) id 9C86C13D4E6; Fri, 8 Dec 2006 15:43:40 -0500 (EST) Date: Fri, 08 Dec 2006 20:43:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org Subject: Re: [RFA] win32-nat.c: Simplify generation of Windows environment Message-ID: <20061208204340.GA18363@trixie.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org References: <20061207095839.GA14487@calimero.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 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: 2006-12/txt/msg00136.txt.bz2 Sorry for the delay in responding. I'm on a business trip this week. On Thu, Dec 07, 2006 at 11:37:02PM +0200, Eli Zaretskii wrote: >> Date: Thu, 7 Dec 2006 10:58:39 +0100 >> From: Corinna Vinschen >> >> the below patch simplifies the code which translates the Cygwin >> environment into the native Windows environment. So far this is >> done in GDB manually. However, there's a Cygwin specific function >> call which does the same for the calling process. Using this call >> has three advantages. > >Is win32-nat.c used only for the Cygwin build? I thought the native >Windows build used it as well (perhaps with a few patches that are not >yet part of the CVS), but maybe I was mistaken. > >If I am right, then please make this change, and especially the call >to cygwin_internal, conditioned on __CYGWIN__, or some other >Cygwin-specific symbol. There is no need for an ifdef. % grep -C 2 cygwin_internal win32-nat.c { /* Try fall back to Cygwin pid */ pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid); if (pid > 0) -- struct external_pinfo *pinfo; cygwin_internal (CW_LOCK_PINFO, 1000); for (cpid = 0; (pinfo = (struct external_pinfo *) cygwin_internal (CW_GETPINFO, cpid | CW_NEXTPID)); cpid = pinfo->pid) { -- } } cygwin_internal (CW_UNLOCK_PINFO); return path_ptr; } Corinna, please go ahead and check in your patch. cgf