This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] gdb-events.sh portability update
- To: Keith Seitz <keiths at cygnus dot com>
- Subject: Re: [RFA] gdb-events.sh portability update
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 07 Jun 2001 15:24:01 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <Pine.GSO.4.33.0106071113051.10814-100000@ryobi.cygnus.com>
> 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