This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb patches update


> I will be posting a new gdb in a day or two with fixes to the gdbserver
> too.
> If you have any comments on the code I sent please let me know.

you probably want to re-indent it with the attached (remember to not 
look at the output).  the first thing that will happen, after the 
commit, is a re-indent anyway.

andrew

#!/bin/sh

# Try to find a GNU indent.  There could be a BSD indent in front of a
# GNU gindent so when indent is found, keep looking.

gindent=
indent=
paths=`echo $PATH | sed \
	-e 's/::/:.:/g' \
	-e 's/^:/.:/' \
	-e 's/:$/:./' \
	-e 's/:/ /g'`
for path in $paths
do
    if test ! -n "${gindent}" -a -x ${path}/gindent
    then
	gindent=${path}/gindent
	break
    elif test ! -n "${indent}" -a -x ${path}/indent
    then
	indent=${path}/indent
    fi
done

if test -n "${gindent}"
then
    indent=${gindent}
elif test -n "${indent}"
then
    :
else
    echo "GNU Indent not found" 1>&2
fi


# Check that it really is a GNU indent

if ${indent} --version 2>&1 | grep GNU > /dev/null 2>&1
then
    :
else
    echo "${indent} is not a GNU indent" 1>&2
fi


# Check that we're in the GDB source directory
case `pwd` in
    */gdb ) ;;
    * ) echo "Not in GDB directory" 1>&2 ; exit 1 ;;
esac

types="-T FILE `cat *.h | sed -n \
    -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \
    -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_func\).*$/-T \1/p' \
    -e 's/^typedef.*[^a-zA-Z0-9_]\([a-zA-Z0-9_]*[a-zA-Z0-9_]\);$/-T \1/p' \
    | sort -u`"

# Run indent per GDB specs

${indent} ${types} "$@"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]