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: [RFA] gdb-events.sh portability update


> 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



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