From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27380 invoked by alias); 29 Dec 2007 03:50:52 -0000 Received: (qmail 27365 invoked by uid 22791); 29 Dec 2007 03:50:50 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 29 Dec 2007 03:50:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 46F142A963E; Fri, 28 Dec 2007 22:50:38 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wIi1aWzuxeU9; Fri, 28 Dec 2007 22:50:38 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7700D2A963B; Fri, 28 Dec 2007 22:50:37 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 5C26236A4A3; Sat, 29 Dec 2007 07:50:30 +0400 (RET) Date: Sat, 29 Dec 2007 05:42:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: PR/2386 [2/2]: MinGW attach to process without an exec file Message-ID: <20071229035030.GC30002@adacore.com> References: <47744F9C.8040604@portugalmail.pt> <20071228013457.GB7602@ednor.casa.cgf.cx> <477579E0.5010809@portugalmail.pt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <477579E0.5010809@portugalmail.pt> User-Agent: Mutt/1.4.2.2i 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-12/txt/msg00444.txt.bz2 I have a couple of questions, out of curiosity... > Can we reach a compromise here ? I've removed the 9x support from this > patch. With the changes inplace, win32_pid_to_exec_file > > - looks in the Cygwin processes using cygwin_internal (CW_GETPINFO, ...). > This is what's done currently, so Cygwin processes will be detected > like before. If we are going to have some code that does this natively as suggested below, why have some code that would work on cygwin only? Is the above going to cover more cases (windows versions?) than the approach below? > - If that fails, tries to get at the filename associated with the file > handle that the debug api gives us in the CREATE_PROCESS_DEBUG_EVENT. > Previously, it was just closed; we now store it in a global variable. > This relies on the internal NT name of the HANDLE, and it may change > in future releases, hence, If you propose another fallback approach, it means that this would not necessarily work all the time. Do you know when it wouldn't work? If you do, then perhaps we could document this in the code. > - If that fails, GetModuleFileNameEx from psapi.dll is used. Same here, if we know the conditions when this would or woudln't work, a comment would be very helpful for future contributors. -- Joel