]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2004-05-07 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Fri, 7 May 2004 22:51:55 +0000 (22:51 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 7 May 2004 22:51:55 +0000 (22:51 +0000)
* observer.c: Include "commands.h" and "gdbcmd.h".
(observer_debug, _initialize_observer): Add the
command "set/show debug observer".
* observer.sh: When observer debugging, log notify calls.
* Makefile.in (observer.o): Update dependencies.

Index: doc/ChangeLog
2004-05-07  Andrew Cagney  <cagney@redhat.com>

* observer.texi (GDB Observers): Add "Debugging" section.  Include
cross reference to "set/show debug observer".
* gdb.texinfo (Debugging Output): Document "set/show debug
observer".

gdb/ChangeLog
gdb/Makefile.in
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/doc/observer.texi
gdb/observer.c
gdb/observer.sh

index 8c187a4ed4554de38e395b2c52a81668901ba933..d7d33e6aba8fd3f472c1e401e663fa4599078e2b 100644 (file)
@@ -1,3 +1,11 @@
+2004-05-07  Andrew Cagney  <cagney@redhat.com>
+
+       * observer.c: Include "commands.h" and "gdbcmd.h".
+       (observer_debug, _initialize_observer): Add the
+       command "set/show debug observer".
+       * observer.sh: When observer debugging, log notify calls.
+       * Makefile.in (observer.o): Update dependencies.
+
 2004-05-07  Jason Molenda  (jmolenda@apple.com)
 
        * cli/cli-decode.c: Fix "SHOW_DOR" comment typeos.
index 89ddd42a3f9bbcf3a009f180bdbd77adc92159ff..45ad2bb777d33c722012ca1508cfcaa516451b2b 100644 (file)
@@ -2118,7 +2118,8 @@ objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
        $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_assert_h) \
        $(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) $(hashtab_h) \
        $(breakpoint_h) $(block_h) $(dictionary_h)
-observer.o: observer.c $(defs_h) $(observer_h) $(observer_inc)
+observer.o: observer.c $(defs_h) $(observer_h) $(observer_inc) \
+       $(command_h) $(gdbcmd_h)
 ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
        $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
        $(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h)
index 977a00ff75646cc7d18e183995cdc9ae8bdfa9b8..00f666d03fbed9fe547a331dfa15e6a92318a3b0 100644 (file)
@@ -1,3 +1,10 @@
+2004-05-07  Andrew Cagney  <cagney@redhat.com>
+
+       * observer.texi (GDB Observers): Add "Debugging" section.  Include
+       cross reference to "set/show debug observer".
+       * gdb.texinfo (Debugging Output): Document "set/show debug
+       observer".
+
 2004-05-01  Andrew Cagney  <cagney@redhat.com>
 
        * gdbint.texinfo (Target Architecture Definition): Delete
index 80d32257b7383d20c0d26b1a486bbabff91c691b..aa82d06b5525fc080e9a47325b075d772c5404fd 100644 (file)
@@ -13404,6 +13404,13 @@ default is off.
 @item show debug frame
 Displays the current state of displaying @value{GDBN} frame debugging
 info.
+@kindex set debug observer
+@item set debug observer
+Turns on or off display of @value{GDBN} observer debugging.  This
+includes info such as the notification of observable events.
+@kindex show debug observer
+@item show debug observer
+Displays the current state of observer debugging.
 @kindex set debug overload
 @item set debug overload
 Turns on or off display of @value{GDBN} C@t{++} overload debugging
index 5c1c2c52f4e8ea53c7165264155d8d60a66dc0a3..fa7e1c3f0e73af3a2d8e0800da19cd1c628be7db 100644 (file)
@@ -35,6 +35,11 @@ The observer implementation is also currently not reentrant.
 In particular, it is therefore not possible to call the attach
 or detach routines during a notification.
 
+@section Debugging
+Observer notifications can be traced using the command @samp{set debug
+observer 1} (@pxref{Debugging Output, , Optional messages about
+internal happenings, gdb, Debugging with @var{GDBN}}).
+
 @section @code{normal_stop} Notifications
 @cindex @code{normal_stop} observer
 @cindex notification about inferior execution stop
index 53916ced5dac28a37293812b42630d71d758d19e..6bdcdf5b45299254331d0fd1bc65dd9a9a9a9787 100644 (file)
 
 #include "defs.h"
 #include "observer.h"
+#include "command.h"
+#include "gdbcmd.h"
+
+static int observer_debug;
 
 /* The internal generic observer.  */
 
@@ -189,4 +193,18 @@ observer_test_third_notification_function (struct bpstats *bs)
   observer_test_third_observer++;
 }
 
+extern initialize_file_ftype _initialize_observer; /* -Wmissing-prototypes */
+
+void
+_initialize_observer (void)
+{
+  add_setshow_zinteger_cmd ("observer", class_maintenance, &observer_debug, "\
+Set observer debugging.\n\
+When non-zero, observer debugging is enabled.",  "\
+Show observer debugging.\n\
+When non-zero, observer debugging is enabled.",
+                           NULL, NULL,
+                           &setdebuglist, &showdebuglist);
+}
+
 #include "observer.inc"
index c5d37799d613cbb349ac68fa8081e56f5ea04961..2cc0e7fe90a42fc55c9d61d454cd1e5f8a97c3a9 100755 (executable)
@@ -134,6 +134,8 @@ observer_notify_${event} (${formal})
 {
   struct ${event}_args args;
   `echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args.\1 = \1/g'`;
+  if (observer_debug)
+    fprintf_unfiltered (gdb_stdlog, "observer_notify_${event}() called\n");
   generic_observer_notify (${event}_subject, &args);
 }
 EOF