Article View: gnu.gdb.bug
Article #382minor bug in gdb-4.5
From: Eric Valette
Date: Tue, 18 Aug 1992 13:03
Date: Tue, 18 Aug 1992 13:03
53 lines
2130 bytes
2130 bytes
I'm currently enhancing gdb-4.5 for multi-threading, cross debugging
using SUN's rpc (sparc->386). While doing this I found a small
inconsistency inside the gdb sources :
in gdb-4.5/gdb/environ.c, in the function "set_in_environ", I think
the SHELL variable sould also be exported : If the user wants
to use another shell for starting his debugged program, he can't
because child_create_inferior use getenv("SHELL") to get the
pathname of the shell for starting the program. I also used getenv
for creating remote debugged programs BUT the shell on the host and
on the target where not located at the same place. I used the command
(gdb) set env SHELL = "/usr/local/bin/ksh"
before starting the remote program but getenv("SHELL) continued to
return : "/usr/bin/ksh" and thus the remote exec failed.
void
set_in_environ (e, var, value)
struct environ *e;
const char *var;
const char *value;
{
...
/* Certain variables get exported back to the parent (e.g. our)
environment, too. */
if (!strcmp(var, "PATH") /* Object file location */
|| !strcmp (var, "G960BASE") /* Intel 960 downloads */
|| !strcmp (var, "G960BIN") /* Intel 960 downloads */
|| !strcmp (var, "GNUTARGET") /* BFD object file type */
+ || !strcmp (var, "SHELL") /* my FIX */
) {
putenv (strsave (s));
}
...
}
It is a minor bug but I think the correction is so simple...
Thanks for good free software,
Regards,
__
/ ` Eric Valette
/-- __ o _. Chorus Systemes
(___, / (_(_(__ 6 avenue Gustave Eiffel
F-78182, St-Quentin-en-Yvelines-Cedex
Tel: +33 (1) 30 64 82 00 Fax: +33 (1) 30 57 00 66
E-mail: ev@chorus.fr
Technical Details
Message-ID:
<9208180903.AA00268@larsen.chorus.fr>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!chorus.FR!evShow Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!chorus.FR!ev From: ev@chorus.FR (Eric Valette) Subject: minor bug in gdb-4.5 Message-ID: <9208180903.AA00268@larsen.chorus.fr> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Tue, 18 Aug 1992 13:03:27 GMT Approved: bug-gdb@prep.ai.mit.edu Lines: 54