Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com> List-Archive: <http://sources.redhat.com/ml/cygwin/> List-Post: <mailto:cygwin AT sources DOT redhat DOT com> List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sat, 30 Jun 2001 22:20:24 -0700 (PDT) Message-Id: <20010630.222024.57970718.Takaaki.Ota@am.sony.com> To: cygwin AT cygwin DOT com, cgf AT redhat DOT com Cc: gdb AT sources DOT redhat DOT com Subject: Re: gdb run < file From: Tak Ota <Takaaki DOT Ota AT am DOT sony DOT com> In-Reply-To: <20010630.172314.42414222.Takaaki.Ota@am.sony.com> References: <1438-Sat30Jun2001093330+0300-eliz AT is DOT elta DOT co DOT il> <20010630132556 DOT E12695 AT redhat DOT com> <20010630 DOT 172314 DOT 42414222 DOT Takaaki DOT Ota AT am DOT sony DOT com> X-Mailer: Mew version 1.95b126 on Emacs 21.0.103.1 / Mule 5.0 (SAKAKI) X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 Organization: Sony Electronics Inc. Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit This is much simpler and cleaner than the previous attempt. And it is the *CORRECT* implementation from UNIX point of view. The existence of "SHELL" environment variable does not necessarily guaranty that it is usable for this purpose. This needs to be improved. -Tak *** win32-nat.org.c Wed Apr 18 13:27:11 2001 --- win32-nat.c Sat Jun 30 21:59:29 2001 *************** *** 1084,1090 **** static void child_create_inferior (char *exec_file, char *allargs, char **env) { ! char real_path[MAXPATHLEN]; char *winenv; char *temp; int envlen; --- 1084,1090 ---- static void child_create_inferior (char *exec_file, char *allargs, char **env) { ! char *shell; char *winenv; char *temp; int envlen; *************** *** 1101,1108 **** memset (&si, 0, sizeof (si)); si.cb = sizeof (si); - cygwin_conv_to_win32_path (exec_file, real_path); - flags = DEBUG_ONLY_THIS_PROCESS; if (new_group) --- 1101,1106 ---- *************** *** 1111,1122 **** if (new_console) flags |= CREATE_NEW_CONSOLE; ! args = alloca (strlen (real_path) + strlen (allargs) + 2); ! ! strcpy (args, real_path); ! ! strcat (args, " "); ! strcat (args, allargs); /* Prepare the environment vars for CreateProcess. */ { --- 1109,1132 ---- if (new_console) flags |= CREATE_NEW_CONSOLE; ! shell = getenv ("SHELL"); ! if (shell) ! { ! char *exec_format = "%s -c 'exec %s %s'"; ! ! args = alloca (strlen (exec_format) + strlen (shell) + strlen (exec_file) + strlen (allargs)); ! sprintf(args, exec_format, shell, exec_file, allargs); ! } ! else ! { ! char real_path[MAXPATHLEN]; ! ! cygwin_conv_to_win32_path (exec_file, real_path); ! args = alloca (strlen (real_path) + strlen (allargs) + 2); ! strcpy (args, real_path); ! strcat (args, " "); ! strcat (args, allargs); ! } /* Prepare the environment vars for CreateProcess. */ { -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/