Roll VERSION to 3.98.1. Use path to find $SHELL in "run" command.
authorJohn Gilmore <gnu@cygnus>
Fri, 2 Aug 1991 07:15:20 +0000 (07:15 +0000)
committerJohn Gilmore <gnu@cygnus>
Fri, 2 Aug 1991 07:15:20 +0000 (07:15 +0000)
gdb/ChangeLog
gdb/Makefile.in
gdb/infrun.c

index 782554807e330efa1e4348104e9798fdf1f5553e..ce61a5ed64bdc1b3d5ff438345ca1dadacc0bce0 100644 (file)
@@ -1,3 +1,10 @@
+Fri Aug  2 00:13:06 1991  John Gilmore  (gnu at cygint.cygnus.com)
+
+       * Makefile.in:  Bump VERSION to 3.98.1
+       * infrun.c (child_create_process):  Use execlp to find the
+       shell to exec our target program.  This requires some fiddling
+       with `environ' since there is no execlpe().
+
 Thu Aug  1 15:35:17 1991  Roland H. Pesch  (pesch at fowanton.cygnus.com)
 
        * Makefile.in, doc/gdbrc.tex, doc/rc-* (new files):
index d576bf8daa8a5898c9a32c60ffeb81f69497e05b..c20161000fbf3d74087e7d39c49bab544606f868 100644 (file)
@@ -132,7 +132,7 @@ CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB}
 ADD_FILES = ${REGEX} ${ALLOCA}  ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
 ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
 
-VERSION = 3.98
+VERSION = 3.98.1
 DIST=gdb
 
 LINT=/usr/5bin/lint
index 9e5b750b34b4029a88d6725652c23d2219ad5748..e48f76136ff383b15fbe1adea130c22c32ea88e1 100644 (file)
@@ -3,19 +3,19 @@
 
 This file is part of GDB.
 
-GDB is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* Notes on the algorithm used in wait_for_inferior to determine if we
    just did a subroutine call when stepping.  We have the following
@@ -148,6 +148,7 @@ extern int original_stack_limit;
 #endif /* SET_STACK_LIMIT_HUGE */
 
 extern char *getenv ();
+extern char **environ;
 
 extern struct target_ops child_ops;    /* In inftarg.c */
 
@@ -472,6 +473,7 @@ child_create_inferior (exec_file, allargs, env)
   /* This is set to the result of setpgrp, which if vforked, will be visible
      to you in the parent process.  It's only used by humans for debugging.  */
   static int debug_setpgrp = 657473;
+  char **save_our_env;
 
   /* The user might want tilde-expansion, and in general probably wants
      the program to behave the same way as if run from
@@ -500,6 +502,11 @@ child_create_inferior (exec_file, allargs, env)
   /* exec is said to fail if the executable is open.  */
   close_exec_file ();
 
+  /* Retain a copy of our environment variables, since the child will
+     replace the value of  environ  and if we're vforked, we have to 
+     restore it.  */
+  save_our_env = environ;
+
 #if defined(USG) && !defined(HAVE_VFORK)
   pid = fork ();
 #else
@@ -547,7 +554,14 @@ child_create_inferior (exec_file, allargs, env)
         for the inferior.  */
 
       call_ptrace (0, 0, 0, 0);                /* "Trace me, Dr. Memory!" */
-      execle (shell_file, shell_file, "-c", shell_command, (char *)0, env);
+
+      /* There is no execlpe call, so we have to set the environment
+        for our child in the global variable.  If we've vforked, this
+        clobbers the parent, but environ is restored a few lines down
+        in the parent.  By the way, yes we do need to look down the
+        path to find $SHELL.  Rich Pixley says so, and I agree.  */
+      environ = env;
+      execlp (shell_file, shell_file, "-c", shell_command, (char *)0);
 
       fprintf (stderr, "Cannot exec %s: %s.\n", shell_file,
               errno < sys_nerr ? sys_errlist[errno] : "unknown error");
@@ -555,6 +569,9 @@ child_create_inferior (exec_file, allargs, env)
       _exit (0177);
     }
 
+  /* Restore our environment in case a vforked child clob'd it.  */
+  environ = save_our_env;
+
   /* Now that we have a child process, make it our target.  */
   push_target (&child_ops);
 
This page took 0.031683 seconds and 4 git commands to generate.