[gnu.gdb.bug] gdb on MIPS

hartzell@boulder.colorado.edu (George Hartzell) (03/04/90)

After applying Per Bothner's mips patches to the gdb3.5 sources, the
following "trivial" fix to munch will produce a working (so far,
anyway.  I haven't tried much) version of gdb on my MIPS M-2000 in the
BSD environment.  The problem is that the default behavior for nm is
system V, so we need to add the -B arguement to force BSD behavior.

Maybe MIPS could make a /bsd43/bin/nm that defaulted to the BSD
behaviour!!! 

Change:
    nm -p $* | egrep 'T *_?_initialize_' | \
to:
    nm -B -p $* | egrep 'T *_?_initialize_' | \

Here is the complete script:
#! /bin/sh

# create an initialization procedure from a list of .o files

echo '/* Do not modify this file.  It is created automatically by "munch". */'
echo 'void initialize_all_files () {'

if test "$1" = "-DSYSV" ; then
    shift;
    nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
	sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
else
    nm -B -p $* | egrep 'T *_?_initialize_' | \
	sed -e 's/^.*T *_*\(.*\)/    _\1 ();/'
fi

echo '}'



George Hartzell			                  (303) 492-4535
 MCD Biology, University of Colorado-Boulder, Boulder, CO 80309
hartzell@Boulder.Colorado.EDU           ..!ncar!boulder!hartzell