This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: 'char **environ' woes with cygwin
- To: gdb at sourceware dot cygnus dot com
- Subject: Re: 'char **environ' woes with cygwin
- From: Chris Faylor <cgf at cygnus dot com>
- Date: Fri, 25 Aug 2000 15:39:20 -0400
- References: <200008251825.LAA32754@train2.cygnus.com>
- Reply-To: gdb at sources dot redhat dot com
On Fri, Aug 25, 2000 at 11:25:32AM -0700, Michael Elizabeth Chastain wrote:
>Ok, here's a patch against sourceware that rips out the "environ" crap.
>I haven't even built with it.
>
>After doing the math, the fixed address "&environ" cancels out. So this
>won't make things any worse (or better) for djgpp or other systems where
>malloc() does more than increment an sbrk pointer.
>
>Chris, do you think this makes your life easier enough to warrant some
>testing and integration into sourceware?
It doesn't really affect me. I proposed eliminating the use of 'extern
char **environ' throughout gdb. Your patch removes the extern... just
like mine does, so it's fine with me.
I do agree that we shouldn't be using environ like this, though, so
eliminating it is a good idea.
However, I tried your patch and it failed here on cygwin:
i686-pc-cygwin-gcc -c -g -O2 -I. -I/cygnus/src/sourceware/gdb -I/cygnus/src/sourceware/gdb/config -DHAVE_CONFIG_H -I/cygnus/src/sourceware/gdb/../include/opcode -I/cygnus/src/sourceware/gdb/../readline/.. -I../bfd -I/cygnus/src/sourceware/gdb/../bfd -I/cygnus/src/sourceware/gdb/../include -I../intl -I/cygnus/src/sourceware/gdb/../intl -DGDBTK -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized /cygnus/src/sourceware/gdb/event-top.c
/cygnus/src/sourceware/gdb/event-top.c: In function `command_handler':
/cygnus/src/sourceware/gdb/event-top.c:550: invalid operands to binary -
/cygnus/src/sourceware/gdb/event-top.c: In function `command_line_handler_continuation':
/cygnus/src/sourceware/gdb/event-top.c:582: invalid operands to binary -
Coercing 'sbrk(0)' to '(char *) sbrk(0)' fixed this.
cgf