Subject: Re: gdb run < file
From: Tak Ota <[email-masked]>
To: [email-masked], [email-masked]
Cc: [email-masked]
Date: Sat, 30 Jun 2001 17:23:14 -0700 (PDT)

On Sat, 30 Jun 2001 13:25:57 -0400, Christopher Faylor <[email-masked]> 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.  */
    {

--
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/