From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Seitz To: Subject: [RFA] gdb-events.sh: event notifications w/o args Date: Thu, 09 Aug 2001 13:58:00 -0000 Message-id: X-SW-Source: 2001-08/msg00092.html Hi, It may happen (sometime soon ;-) that an event notification will occur with no arguments, e.g., f:void:foo_bar:void This patch allows gdb-events.sh to deal with such cases. It is currently emitting code like: case foo_bar: vector->foo_bar ); break; and struct foo_bar { void; }; Keith ChangeLog 2001-08-09 Keith Seitz * gdb-events.sh: Deal with event notifications with no arguments. Patch Index: gdb-events.sh =================================================================== RCS file: /cvs/src/src/gdb/gdb-events.sh,v retrieving revision 1.9 diff -u -p -r1.9 gdb-events.sh --- gdb-events.sh 2001/06/07 20:18:45 1.9 +++ gdb-events.sh 2001/08/09 20:57:02 @@ -64,6 +64,7 @@ f:void:breakpoint_modify:int b:b f:void:tracepoint_create:int number:number f:void:tracepoint_delete:int number:number f:void:tracepoint_modify:int number:number +f:void:foo_bar:void #*:void:annotate_starting_hook:void #*:void:annotate_stopped_hook:void #*:void:annotate_signalled_hook:void @@ -419,11 +420,13 @@ function_list | while eval read $read do case "${class}" in "f" ) - echo "struct ${function}" - echo " {" - echo " `echo ${formal} | tr '[,]' '[;]'`;" - echo " };" - echo "" + if test ${actual}; then + echo "struct ${function}" + echo " {" + echo " `echo ${formal} | tr '[,]' '[;]'`;" + echo " };" + echo "" + fi ;; esac done @@ -441,7 +444,9 @@ function_list | while eval read $read do case "${class}" in "f" ) - echo " struct ${function} ${function};" + if test ${actual}; then + echo " struct ${function} ${function};" + fi ;; esac done @@ -517,15 +522,19 @@ do case "${class}" in "f" ) echo " case ${function}:" - echo " vector->${function}" - sep=" (" - ass="" - for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do - ass="${ass}${sep}event->data.${function}.${arg}" - sep=", - " - done - echo "${ass});" + if test ${actual}; then + echo " vector->${function}" + sep=" (" + ass="" + for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do + ass="${ass}${sep}event->data.${function}.${arg}" + sep=", + " + done + echo "${ass});" + else + echo " vector->${function} ();" + fi echo " break;" ;; esac