From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28661 invoked by alias); 14 Oct 2007 18:03:27 -0000 Received: (qmail 28653 invoked by uid 22791); 14 Oct 2007 18:03:26 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.175) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 Oct 2007 18:03:23 +0000 Received: by ug-out-1314.google.com with SMTP id o2so902202uge for ; Sun, 14 Oct 2007 11:03:20 -0700 (PDT) Received: by 10.67.19.17 with SMTP id w17mr6948246ugi.1192385000693; Sun, 14 Oct 2007 11:03:20 -0700 (PDT) Received: from ?88.210.73.207? ( [88.210.73.207]) by mx.google.com with ESMTPS id q1sm7047846uge.2007.10.14.11.02.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Oct 2007 11:02:57 -0700 (PDT) Message-ID: <471259B2.6050808@portugalmail.pt> Date: Sun, 14 Oct 2007 19:55:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: Support of gdb for Windows 64 native systems References: <20071012222842.GD21800@adacore.com> <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> In-Reply-To: <20071014173921.GD11619@ednor.casa.cgf.cx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00370.txt.bz2 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. 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. Cheers, Pedro Alves