From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Keith Seitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] gdb-events.sh portability update Date: Thu, 07 Jun 2001 12:24:00 -0000 Message-id: <3B1FD4D1.2070401@cygnus.com> References: X-SW-Source: 2001-06/msg00150.html > Hi, > > gdb-events.sh will only run on a linux box (maybe BSD, too). It does not > run on Solaris, SunOS, or almost any other host OS because the script does > things like: > > 1) Assumes that /bin/sh's "if" has built-in logical not. > > if ! test -r file_exits > then > # stuf > fi > > and > > if ! diff ... > then > # stuff > fi > > 2) Some commands assume that IFS is a space: > > for arg in `echo ${args} | tr '[,]' '[ ]'`; do > # stuff > done > > At the top of this script, we explicitly set it to ":". This bug prevents > using event notifiers with more than one argument, i.e., > > f:void:my_new_event_notifier:int a, void *b:a, b > > would produce output like: > > void > my_new_event_notifier_event (int a, void *b) > { > if (gdb_events_debug) > fprintf_unfiltered (gdb_stdlog, "my_new_event_notifier_event\n"); > if (!current_event_hooks->my_new_event_notifier) > return; > current_event_hooks->my_new_event_notifier (a b); > } > > 3) Uses "echo" to put strings containing special characters (e.g. \n) into > files: > > echo "" > echo "fprintf_unfiltered (gdb_stderr, \"This is an error\\n\");" Yes, ok. On the last one, gdbarch.sh now uses printf but it doesn't matter either way. Andrew