From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tak Ota To: cygwin@cygwin.com, cgf@redhat.com Cc: gdb@sources.redhat.com Subject: Re: gdb run < file Date: Sat, 30 Jun 2001 17:23:00 -0000 Message-id: <20010630.172314.42414222.Takaaki.Ota@am.sony.com> References: <20010629165352.B8545@redhat.com> <1438-Sat30Jun2001093330+0300-eliz@is.elta.co.il> <20010630132556.E12695@redhat.com> X-SW-Source: 2001-06/msg00257.html On Sat, 30 Jun 2001 13:25:57 -0400, Christopher Faylor wrote: > Perhaps. However, implementing this the UNIX way should be relatively > trivial. It at least deserves study before we throw in the towel. This You are right. > I really regret not suggesting that the original poster explore the > "follow fork" solution. I also forgot to preload the expectation that > an assignment form was necessary. That was probably discouraging. Don't regret. I think I am doing the right thing. As I've said before what I tried first was admittedly a kludge solution. I am done with that and now exploring the correct unix way. This is experimental (shell is hard coded as "bash") however the mechanism seems to be working. I only need to add some more code to figure out what the user's shell is. -Tak *** win32-nat.org.c Wed Apr 18 13:27:11 2001 --- win32-nat.c Sat Jun 30 16:51:52 2001 *************** *** 1094,1099 **** --- 1094,1100 ---- BOOL ret; DWORD flags; char *args; + char *shell = "bash -c 'exec %s %s'"; if (!exec_file) error ("No executable specified, use `target exec'.\n"); *************** *** 1101,1107 **** memset (&si, 0, sizeof (si)); si.cb = sizeof (si); ! cygwin_conv_to_win32_path (exec_file, real_path); flags = DEBUG_ONLY_THIS_PROCESS; --- 1102,1108 ---- memset (&si, 0, sizeof (si)); si.cb = sizeof (si); ! /*cygwin_conv_to_win32_path (exec_file, real_path);*/ flags = DEBUG_ONLY_THIS_PROCESS; *************** *** 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. */ { --- 1112,1120 ---- if (new_console) flags |= CREATE_NEW_CONSOLE; ! args = alloca (strlen(shell) + strlen (exec_file) + strlen (allargs) + 2); ! sprintf(args, shell, exec_file, allargs); /* Prepare the environment vars for CreateProcess. */ {