From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3573 invoked by alias); 14 Oct 2007 22:16:08 -0000 Received: (qmail 3561 invoked by uid 22791); 14 Oct 2007 22:16:07 -0000 X-Spam-Check-By: sourceware.org Received: from pool-71-174-251-188.bstnma.fios.verizon.net (HELO ednor.cgf.cx) (71.174.251.188) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 Oct 2007 22:16:05 +0000 Received: by ednor.cgf.cx (Postfix, from userid 201) id D96CF2B353; Sun, 14 Oct 2007 18:16:03 -0400 (EDT) Date: Sun, 14 Oct 2007 22:22:00 -0000 From: Christopher Faylor To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: Support of gdb for Windows 64 native systems Message-ID: <20071014221603.GA13096@ednor.casa.cgf.cx> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <20071013024116.GB29152@adacore.com> <20071013154715.GE29152@adacore.com> <4711021C.8010805@portugalmail.pt> <20071013205105.GA13789@adacore.com> <47114BB7.1000501@portugalmail.pt> <20071014051622.GC13789@adacore.com> <471200C5.6050609@portugalmail.pt> <20071014173921.GD11619@ednor.casa.cgf.cx> <471259B2.6050808@portugalmail.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <471259B2.6050808@portugalmail.pt> 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/msg00375.txt.bz2 On Sun, Oct 14, 2007 at 07:02:26PM +0100, Pedro Alves wrote: > Christopher Faylor wrote: >>> + flags = DEBUG_ONLY_THIS_PROCESS; >>> + toexec = exec_file; >> This doesn't seem right. You moved this setting outside of an if block >> and didn't accommodate the else condition. > > I didn't move it. The if inside the __CYGWIN__ block sets TOEXEC in both > branches. I'm talking about "flags". > Here is rest of the hunk: >>> + >>> +#ifdef __CYGWIN__ >>> if (!useshell) >>> { >>> - flags = DEBUG_ONLY_THIS_PROCESS; >>> cygwin_conv_to_win32_path (exec_file, real_path); >>> toexec = real_path; >>> } >>> @@ -1784,6 +1798,7 @@ win32_create_inferior (char *exec_file, >>> toexec = shell; >>> flags = DEBUG_PROCESS; >>> } >>> +#endif > > This is what the resulting code looks like after the patch is applied: > > flags = DEBUG_ONLY_THIS_PROCESS; > toexec = exec_file; > > #ifdef __CYGWIN__ > if (!useshell) > { > cygwin_conv_to_win32_path (exec_file, real_path); > toexec = real_path; > } > else > { > char *newallargs; > sh = getenv ("SHELL"); > if (!sh) > sh = "/bin/sh"; > cygwin_conv_to_win32_path (sh, shell); > newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file) > + strlen (allargs) + 2); > sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs); > allargs = newallargs; > toexec = shell; > flags = DEBUG_PROCESS; > } > #endif > > It could be changed into: > > #ifdef __CYGWIN__ > ... > #else > toexec = exec_file; > #endif > > I prefer how it is now, but I'll respect your decision. > >>> +#ifdef __CYGWIN__ >>> add_setshow_boolean_cmd ("shell", class_support, &useshell, _("\ >>> Set use of shell to start subprocess."), _("\ >>> Show use of shell to start subprocess."), NULL, >>> NULL, >>> NULL, /* FIXME: i18n: */ >>> &setlist, &showlist); >>> +#endif >>> >>> add_setshow_boolean_cmd ("cygwin-exceptions", class_support, >>> &cygwin_exceptions, _("\ >>> Break when an exception is detected in the Cygwin DLL itself."), _("\ >> Seems like the above should be ifdef'ed too. > > Not sure why. The cygwin1.dll dll detection doesn't depend on any host > habilities. Having a mingw hosted gdb be able to attach to a cygwin > executable, and being able to debug it, seems useful. I imagine that > it might prove useful to have a gdb that doesn't link to cygwin1.dll > as a resort into debugging Cygwin issues. There should be no cygwin accommodations in a pure windows port of gdb. cgf