From: Sergio Durigan Junior Date: Tue, 24 Apr 2012 18:10:31 +0000 (+0000) Subject: 2012-04-24 Sergio Durigan Junior X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7fc7e0c3280f9c7c4f8447869b219627ec39d054;p=binutils-gdb.git 2012-04-24 Sergio Durigan Junior * observer.sh: Conditionally declare `args', thus cleaning up unused instances of this variable. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5b2b105ea49..991792fea0a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-04-24 Sergio Durigan Junior + + * observer.sh: Conditionally declare `args', thus cleaning up + unused instances of this variable. + 2012-04-24 Yao Qi Revert this patch to allow breakpoint always-inserted diff --git a/gdb/observer.sh b/gdb/observer.sh index b5c49ac9391..c98afd07ce0 100755 --- a/gdb/observer.sh +++ b/gdb/observer.sh @@ -136,8 +136,17 @@ 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<>${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 <>${otmp} + notify (${notify_args}); } struct observer *