aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/Makefile.in2
-rw-r--r--gdb/infrun.c31
3 files changed, 32 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7825548..ce61a5e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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):
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index d576bf8..c201610 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -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
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 9e5b750..e48f761 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -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);