# Make certain that the script is not running in an internationalized
# environment.
-LANG=c ; export LANG
-LC_ALL=c ; export LC_ALL
+LANG=C ; export LANG
+LC_ALL=C ; export LC_ALL
if test $# -ne 3
then
cat <<EOF >>${otmp}
/* GDB Notifications to Observers.
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004-2015 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
--
struct bpstats;
struct so_list;
struct objfile;
+struct thread_info;
+struct inferior;
+struct trace_state_variable;
EOF
;;
esac
static struct observer_list *${event}_subject = NULL;
+EOF
+ if test "$formal" != "void"; then
+ cat<<EOF >>${otmp}
struct ${event}_args { `echo "${formal}" | sed -e 's/,/;/g'`; };
+EOF
+ fi
+ cat <<EOF >>${otmp}
static void
observer_${event}_notification_stub (const void *data, const void *args_data)
{
observer_${event}_ftype *notify = (observer_${event}_ftype *) data;
+EOF
+
+ notify_args=`echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args->\1/g'`
+
+ if test ! -z "${notify_args}"; then
+ cat<<EOF >>${otmp}
const struct ${event}_args *args = args_data;
- notify (`echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args->\1/g'`);
+EOF
+ fi
+ cat <<EOF >>${otmp}
+ notify (${notify_args});
}
struct observer *
void
observer_notify_${event} (${formal})
{
+EOF
+ if test "$formal" != "void"; then
+ cat<<EOF >>${otmp}
struct ${event}_args args;
`echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args.\1 = \1/g'`;
+
+EOF
+ else
+ echo "char *args = NULL;" >> ${otmp}
+ fi
+ cat<<EOF >>${otmp}
if (observer_debug)
fprintf_unfiltered (gdb_stdlog, "observer_notify_${event}() called\n");
generic_observer_notify (${event}_subject, &args);