lang=$1 ; shift
texi=$1 ; shift
-o=$1 ; shift
-echo "Creating ${o}-tmp" 1>&2
-rm -f ${o}-tmp
+o=$1
+case $lang in
+ h) tmp=htmp ;;
+ inc) tmp=itmp ;;
+esac
+otmp="`echo $1 | sed -e 's,\.[^.]*$,,'`.$tmp"; shift
+echo "Creating ${otmp}" 1>&2
+rm -f ${otmp}
# Can use any of the following: cat cmp cp diff echo egrep expr false
# grep install-info ln ls mkdir mv pwd rm rmdir sed sleep sort tar
# test touch true
-cat <<EOF >>${o}-tmp
+cat <<EOF >>${otmp}
/* GDB Notifications to Observers.
- Copyright 2004 Free Software Foundation, Inc.
+ Copyright 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
case $lang in
- h) cat <<EOF >>${o}-tmp
+ h) cat <<EOF >>${otmp}
#ifndef OBSERVER_H
#define OBSERVER_H
struct observer;
struct bpstats;
+struct so_list;
EOF
;;
esac
+# We are about to set IFS=:, so DOS-style file names with a drive
+# letter and a colon will be in trouble.
+
+if test -n "$DJGPP"
+then
+ texi=`echo $texi | sed -e 's,^\([a-zA-Z]\):/,/dev/\1/,'`
+fi
# generate a list of events that can be observed
' $texi | while read event formal actual
do
case $lang in
- h) cat <<EOF >>${o}-tmp
+ h) cat <<EOF >>${otmp}
/* ${event} notifications. */
;;
inc)
- cat <<EOF >>${o}-tmp
+ cat <<EOF >>${otmp}
/* ${event} notifications. */
{
struct ${event}_args args;
`echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args.\1 = \1/g'`;
+ if (observer_debug)
+ fprintf_unfiltered (gdb_stdlog, "observer_notify_${event}() called\n");
generic_observer_notify (${event}_subject, &args);
}
EOF
case $lang in
- h) cat <<EOF >>${o}-tmp
+ h) cat <<EOF >>${otmp}
#endif /* OBSERVER_H */
EOF
esac
-echo Moving ${o}-tmp to ${o}
-mv ${o}-tmp ${o}
+echo Moving ${otmp} to ${o}
+mv ${otmp} ${o}