* RFA: Remove gdb-events
@ 2008-07-13 0:16 Tom Tromey
2008-07-13 3:26 ` Stan Shebs
` (3 more replies)
0 siblings, 4 replies; 29+ messages in thread
From: Tom Tromey @ 2008-07-13 0:16 UTC (permalink / raw)
To: gdb-patches
My understanding is that the gdb "events" mechanism is deprecated in
favor of using observers.
This patch removes events and adds observers where needed.
Most of this patch is straightforward. There are a few odd pieces:
* Removing the call to clear_gdb_event_hooks. In theory I think this
could confuse some caller. However, in practice I think it is
probably nothing to worry about.
* The architecture_changed observer is needed for gdbtk, but the only
place where this is notified is deprecated. Since my goal here is
to remove events, I think this is probably fine. It certainly
doesn't seem any worse.
* MI installs a new set of event handlers, does some work, then
uninstalls them. Instead of trying to replicate this behavior --
say by deinstalling other observers -- I just made the MI observer
conditional on a global flag, which is set and reset at the
appropriate points.
I think this is probably the friendliest approach; my thinking here
is that any given module should not be able to mess around with
observers installed by a separate module.
* Insight does not build. My patch does not make this worse; I did
attempt to build it and my changes do not cause any new errors.
I built (with a hack to work around the mi-main.c build failure) and
regression-tested this on x86 F8.
BTW, why is there a separate doc/ChangeLog? I don't think it adds
much value; in fact it partly hides the way that code and
documentation change may be tied. The same applies to
testsuite/ChangeLog.
Ok?
Tom
ChangeLog:
2008-07-12 Tom Tromey <tromey@redhat.com>
* tui/tui-hooks.c: Include observer.h.
(tui_event_default, tui_old_event_hooks, tui_event_hooks):
Remove.
(tui_bp_created_observer, tui_bp_deleted_observer,
tui_bp_modified_observer): New globals.
(tui_install_hooks): Use observers, not events.
(tui_remove_hooks): Likewise.
* mi/mi-cmd-break.c: Include observer.h, not gdb-events.h.
(mi_breakpoint_observers_installed, mi_can_breakpoint_notify): New
globals.
(breakpoint_notify): Check mi_can_breakpoint_notify.
(breakpoint_hooks): Remove.
(mi_cmd_break_insert): Attach observers. Don't use events.
* tracepoint.c: Include observer.h, not gdb-events.h.
(tracepoint_operation, trace_pass_command): Notify observer.
* interps.c: Don't include gdb-events.h.
(clear_interpreter_hooks): Don't call clear_gdb_event_hooks.
* gdbarch.c: Include observer.h, not gdb-events.h.
(deprecated_current_gdbarch_select_hack): Notify observer.
* breakpoint.h: Don't include gdb-events.h.
* breakpoint.c: Don't include gdb-events.h.
(condition_command): Notify observer.
(commands_command): Likewise.
(commands_from_control_command): Likewise.
(mention, delete_breakpoint, set_ignore_count): Likewise.
(disable_breakpoint, do_enable_breakpoint): Likewise.
* Makefile.in (gdb_events_h): Remove.
(breakpoint_h): Update.
(COMMON_OBS): Remove gdb-events.o.
(gdb-events.o): Remove.
(breakpoint.o, gdbarch.o, interps.o, tracepoint.o, gdbtk-bp.o,
gdbtk-hooks.o, mi-cmd-break.o, tui-hooks.o): Update.
* gdb-events.c: Remove.
* gdb-events.h: Remove.
* gdb-events.sh: Remove.
doc/ChangeLog:
2008-07-12 Tom Tromey <tromey@redhat.com>
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdbtk/ChangeLog:
2008-07-12 Tom Tromey <tromey@redhat.com>
* generic/gdbtk-hooks.c: Include observer.h, not gdb-events.h.
(gdbtk_add_hooks): Use observers, not events.
(gdbtk_architecture_changed): Add argument, for observer.
* generic/gdbtk-bp.c: Include observer.h.
(gdb_set_bp): Notify observer.
(gdb_set_bp_addr): Likewise.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.1035
diff -u -r1.1035 Makefile.in
--- Makefile.in 11 Jul 2008 11:07:38 -0000 1.1035
+++ Makefile.in 13 Jul 2008 00:04:57 -0000
@@ -742,7 +742,7 @@
bcache_h = bcache.h
bfd_target_h = bfd-target.h
block_h = block.h
-breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h) $(vec_h)
+breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(vec_h)
bsd_kvm_h = bsd-kvm.h
bsd_uthread_h = bsd-uthread.h
buildsym_h = buildsym.h
@@ -787,7 +787,6 @@
gdbcore_h = gdbcore.h $(bfd_h)
gdb_curses_h = gdb_curses.h
gdb_dirent_h = gdb_dirent.h
-gdb_events_h = gdb-events.h
gdb_h = gdb.h
gdb_expat_h = gdb_expat.h
gdb_locale_h = gdb_locale.h
@@ -1062,7 +1061,6 @@
findcmd.o \
std-regs.o \
signals.o \
- gdb-events.o \
exec.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o coff-pe-read.o \
dwarf2read.o mipsread.o stabsread.o corefile.o \
@@ -1972,7 +1970,7 @@
$(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \
$(objfiles_h) $(source_h) $(linespec_h) $(completer_h) $(gdb_h) \
$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(solib_h) \
- $(solist_h) $(observer_h) $(exceptions_h) $(gdb_events_h) \
+ $(solist_h) $(observer_h) $(exceptions_h) \
$(mi_common_h) $(memattr_h) $(ada_lang_h) $(top_h) $(hashtab_h)
bsd-kvm.o: bsd-kvm.c $(defs_h) $(cli_cmds_h) $(command_h) $(frame_h) \
$(regcache_h) $(target_h) $(value_h) $(gdbcore_h) $(gdb_assert_h) \
@@ -2167,9 +2165,8 @@
$(gdb_assert_h)
gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
$(symcat_h) $(floatformat_h) $(gdb_assert_h) $(gdb_string_h) \
- $(gdb_events_h) $(reggroups_h) $(osabi_h) $(gdb_obstack_h)
+ $(reggroups_h) $(osabi_h) $(gdb_obstack_h) $(observer_h)
gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) $(interps_h)
-gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h)
gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
$(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \
$(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \
@@ -2341,7 +2338,7 @@
$(gdb_assert_h) $(gdb_string_h) $(inf_child_h) $(inf_ttrace_h)
interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
$(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \
- $(gdb_events_h) $(gdb_assert_h) $(top_h) $(exceptions_h)
+ $(gdb_assert_h) $(top_h) $(exceptions_h)
iq2000-tdep.o: iq2000-tdep.c $(defs_h) $(frame_h) $(frame_base_h) \
$(frame_unwind_h) $(dwarf2_frame_h) $(gdbtypes_h) $(value_h) \
$(dis_asm_h) $(gdb_string_h) $(arch_utils_h) $(regcache_h) \
@@ -2933,9 +2930,9 @@
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \
$(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \
$(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \
- $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) \
+ $(linespec_h) $(regcache_h) $(completer_h) \
$(block_h) $(dictionary_h) $(ax_h) $(ax_gdb_h) $(readline_h) \
- $(readline_history_h)
+ $(readline_history_h) $(observer_h)
trad-frame.o: trad-frame.c $(defs_h) $(frame_h) $(trad_frame_h) \
$(regcache_h) $(frame_unwind_h) $(value_h)
tramp-frame.o: tramp-frame.c $(defs_h) $(tramp_frame_h) $(frame_unwind_h) \
@@ -3151,7 +3148,7 @@
$(srcdir)/gdbtk/generic/gdbtk.h \
$(srcdir)/gdbtk/generic/gdbtk-cmds.h \
$(defs_h) $(breakpoint_h) $(tracepoint_h) \
- $(symfile_h) $(symtab_h) $(gdb_string_h)
+ $(symfile_h) $(symtab_h) $(gdb_string_h) $(observer_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \
@@ -3172,7 +3169,7 @@
$(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
$(symtab_h) $(inferior_h) $(command_h) \
$(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \
- $(tracepoint_h)
+ $(tracepoint_h) $(observer_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
$(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
@@ -3232,7 +3229,7 @@
mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
$(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \
- $(mi_getopt_h) $(gdb_events_h) $(gdb_h)
+ $(mi_getopt_h) $(gdb_h) $(observer_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \
$(mi_cmds_h) $(mi_getopt_h) $(gdb_string_h) $(ui_out_h) $(disasm_h)
@@ -3325,7 +3322,7 @@
tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(defs_h) $(symtab_h) $(inferior_h) \
$(command_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) \
$(gdbcore_h) $(event_loop_h) $(event_top_h) $(frame_h) \
- $(breakpoint_h) $(gdb_events_h) $(ui_out_h) $(top_h) $(observer_h) \
+ $(breakpoint_h) $(ui_out_h) $(top_h) $(observer_h) \
$(tui_h) $(tui_hooks_h) $(tui_data_h) $(tui_layout_h) $(tui_io_h) \
$(tui_regs_h) $(tui_win_h) $(tui_stack_h) $(tui_windata_h) \
$(tui_winsource_h) $(gdb_curses_h) $(readline_h)
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.335
diff -u -r1.335 breakpoint.c
--- breakpoint.c 12 Jul 2008 19:25:42 -0000 1.335
+++ breakpoint.c 13 Jul 2008 00:04:58 -0000
@@ -57,7 +57,6 @@
#include "top.h"
#include "wrapper.h"
-#include "gdb-events.h"
#include "mi/mi-common.h"
/* Prototypes for local functions. */
@@ -619,7 +618,7 @@
}
}
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return;
}
@@ -658,7 +657,7 @@
free_command_lines (&b->commands);
b->commands = l;
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return;
}
error (_("No breakpoint number %d."), bnum);
@@ -704,7 +703,7 @@
list after it finishes execution. */
b->commands = copy_command_lines (cmd->body_list[0]);
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return simple_control;
}
error (_("No breakpoint number %d."), bnum);
@@ -4894,7 +4893,7 @@
been done for deprecated_delete_breakpoint_hook and so on. */
if (deprecated_create_breakpoint_hook)
deprecated_create_breakpoint_hook (b);
- breakpoint_create_event (b->number);
+ observer_notify_breakpoint_created (b->number);
if (b->ops != NULL && b->ops->print_mention != NULL)
b->ops->print_mention (b);
@@ -7215,7 +7214,7 @@
if (deprecated_delete_breakpoint_hook)
deprecated_delete_breakpoint_hook (bpt);
- breakpoint_delete_event (bpt->number);
+ observer_notify_breakpoint_deleted (bpt->number);
if (breakpoint_chain == bpt)
breakpoint_chain = bpt->next;
@@ -7720,7 +7719,7 @@
count, bptnum);
}
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return;
}
@@ -7870,7 +7869,7 @@
if (deprecated_modify_breakpoint_hook)
deprecated_modify_breakpoint_hook (bpt);
- breakpoint_modify_event (bpt->number);
+ observer_notify_breakpoint_modified (bpt->number);
}
static void
@@ -7995,7 +7994,7 @@
if (deprecated_modify_breakpoint_hook)
deprecated_modify_breakpoint_hook (bpt);
- breakpoint_modify_event (bpt->number);
+ observer_notify_breakpoint_modified (bpt->number);
}
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.75
diff -u -r1.75 breakpoint.h
--- breakpoint.h 9 Jul 2008 22:23:05 -0000 1.75
+++ breakpoint.h 13 Jul 2008 00:04:58 -0000
@@ -24,8 +24,6 @@
#include "value.h"
#include "vec.h"
-#include "gdb-events.h"
-
struct value;
struct block;
Index: gdb-events.c
===================================================================
RCS file: gdb-events.c
diff -N gdb-events.c
--- gdb-events.c 1 Jan 2008 22:53:09 -0000 1.25
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,349 +0,0 @@
-/* User Interface Events.
-
- Copyright (C) 1999, 2001, 2002, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
-
- Contributed by Cygnus Solutions.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Work in progress */
-
-/* This file was created with the aid of ``gdb-events.sh''.
-
- The bourn shell script ``gdb-events.sh'' creates the files
- ``new-gdb-events.c'' and ``new-gdb-events.h and then compares
- them against the existing ``gdb-events.[hc]''. Any differences
- found being reported.
-
- If editing this file, please also run gdb-events.sh and merge any
- changes into that script. Conversely, when making sweeping changes
- to this file, modifying gdb-events.sh and using its output may
- prove easier. */
-
-
-#include "defs.h"
-#include "gdb-events.h"
-#include "gdbcmd.h"
-
-static struct gdb_events null_event_hooks;
-static struct gdb_events queue_event_hooks;
-static struct gdb_events *current_event_hooks = &null_event_hooks;
-
-int gdb_events_debug;
-static void
-show_gdb_events_debug (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- fprintf_filtered (file, _("Event debugging is %s.\n"), value);
-}
-
-
-void
-breakpoint_create_event (int b)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "breakpoint_create_event\n");
- if (!current_event_hooks->breakpoint_create)
- return;
- current_event_hooks->breakpoint_create (b);
-}
-
-void
-breakpoint_delete_event (int b)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "breakpoint_delete_event\n");
- if (!current_event_hooks->breakpoint_delete)
- return;
- current_event_hooks->breakpoint_delete (b);
-}
-
-void
-breakpoint_modify_event (int b)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "breakpoint_modify_event\n");
- if (!current_event_hooks->breakpoint_modify)
- return;
- current_event_hooks->breakpoint_modify (b);
-}
-
-void
-tracepoint_create_event (int number)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "tracepoint_create_event\n");
- if (!current_event_hooks->tracepoint_create)
- return;
- current_event_hooks->tracepoint_create (number);
-}
-
-void
-tracepoint_delete_event (int number)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "tracepoint_delete_event\n");
- if (!current_event_hooks->tracepoint_delete)
- return;
- current_event_hooks->tracepoint_delete (number);
-}
-
-void
-tracepoint_modify_event (int number)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "tracepoint_modify_event\n");
- if (!current_event_hooks->tracepoint_modify)
- return;
- current_event_hooks->tracepoint_modify (number);
-}
-
-void
-architecture_changed_event (void)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "architecture_changed_event\n");
- if (!current_event_hooks->architecture_changed)
- return;
- current_event_hooks->architecture_changed ();
-}
-
-struct gdb_events *
-deprecated_set_gdb_event_hooks (struct gdb_events *vector)
-{
- struct gdb_events *old_events = current_event_hooks;
- if (vector == NULL)
- current_event_hooks = &queue_event_hooks;
- else
- current_event_hooks = vector;
- return old_events;
-}
-
-void
-clear_gdb_event_hooks (void)
-{
- deprecated_set_gdb_event_hooks (&null_event_hooks);
-}
-
-enum gdb_event
-{
- breakpoint_create,
- breakpoint_delete,
- breakpoint_modify,
- tracepoint_create,
- tracepoint_delete,
- tracepoint_modify,
- architecture_changed,
- nr_gdb_events
-};
-
-struct breakpoint_create
- {
- int b;
- };
-
-struct breakpoint_delete
- {
- int b;
- };
-
-struct breakpoint_modify
- {
- int b;
- };
-
-struct tracepoint_create
- {
- int number;
- };
-
-struct tracepoint_delete
- {
- int number;
- };
-
-struct tracepoint_modify
- {
- int number;
- };
-
-struct event
- {
- enum gdb_event type;
- struct event *next;
- union
- {
- struct breakpoint_create breakpoint_create;
- struct breakpoint_delete breakpoint_delete;
- struct breakpoint_modify breakpoint_modify;
- struct tracepoint_create tracepoint_create;
- struct tracepoint_delete tracepoint_delete;
- struct tracepoint_modify tracepoint_modify;
- }
- data;
- };
-struct event *pending_events;
-struct event *delivering_events;
-
-static void
-append (struct event *new_event)
-{
- struct event **event = &pending_events;
- while ((*event) != NULL)
- event = &((*event)->next);
- (*event) = new_event;
- (*event)->next = NULL;
-}
-
-static void
-queue_breakpoint_create (int b)
-{
- struct event *event = XMALLOC (struct event);
- event->type = breakpoint_create;
- event->data.breakpoint_create.b = b;
- append (event);
-}
-
-static void
-queue_breakpoint_delete (int b)
-{
- struct event *event = XMALLOC (struct event);
- event->type = breakpoint_delete;
- event->data.breakpoint_delete.b = b;
- append (event);
-}
-
-static void
-queue_breakpoint_modify (int b)
-{
- struct event *event = XMALLOC (struct event);
- event->type = breakpoint_modify;
- event->data.breakpoint_modify.b = b;
- append (event);
-}
-
-static void
-queue_tracepoint_create (int number)
-{
- struct event *event = XMALLOC (struct event);
- event->type = tracepoint_create;
- event->data.tracepoint_create.number = number;
- append (event);
-}
-
-static void
-queue_tracepoint_delete (int number)
-{
- struct event *event = XMALLOC (struct event);
- event->type = tracepoint_delete;
- event->data.tracepoint_delete.number = number;
- append (event);
-}
-
-static void
-queue_tracepoint_modify (int number)
-{
- struct event *event = XMALLOC (struct event);
- event->type = tracepoint_modify;
- event->data.tracepoint_modify.number = number;
- append (event);
-}
-
-static void
-queue_architecture_changed (void)
-{
- struct event *event = XMALLOC (struct event);
- event->type = architecture_changed;
- append (event);
-}
-
-void
-gdb_events_deliver (struct gdb_events *vector)
-{
- /* Just zap any events left around from last time. */
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- delivering_events = event->next;
- xfree (event);
- }
- /* Process any pending events. Because one of the deliveries could
- bail out we move everything off of the pending queue onto an
- in-progress queue where it can, later, be cleaned up if
- necessary. */
- delivering_events = pending_events;
- pending_events = NULL;
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- switch (event->type)
- {
- case breakpoint_create:
- vector->breakpoint_create
- (event->data.breakpoint_create.b);
- break;
- case breakpoint_delete:
- vector->breakpoint_delete
- (event->data.breakpoint_delete.b);
- break;
- case breakpoint_modify:
- vector->breakpoint_modify
- (event->data.breakpoint_modify.b);
- break;
- case tracepoint_create:
- vector->tracepoint_create
- (event->data.tracepoint_create.number);
- break;
- case tracepoint_delete:
- vector->tracepoint_delete
- (event->data.tracepoint_delete.number);
- break;
- case tracepoint_modify:
- vector->tracepoint_modify
- (event->data.tracepoint_modify.number);
- break;
- case architecture_changed:
- vector->architecture_changed ();
- break;
- }
- delivering_events = event->next;
- xfree (event);
- }
-}
-
-void _initialize_gdb_events (void);
-void
-_initialize_gdb_events (void)
-{
- struct cmd_list_element *c;
- queue_event_hooks.breakpoint_create = queue_breakpoint_create;
- queue_event_hooks.breakpoint_delete = queue_breakpoint_delete;
- queue_event_hooks.breakpoint_modify = queue_breakpoint_modify;
- queue_event_hooks.tracepoint_create = queue_tracepoint_create;
- queue_event_hooks.tracepoint_delete = queue_tracepoint_delete;
- queue_event_hooks.tracepoint_modify = queue_tracepoint_modify;
- queue_event_hooks.architecture_changed = queue_architecture_changed;
-
- add_setshow_zinteger_cmd ("event", class_maintenance,
- &gdb_events_debug, _("\
-Set event debugging."), _("\
-Show event debugging."), _("\
-When non-zero, event/notify debugging is enabled."),
- NULL,
- show_gdb_events_debug,
- &setdebuglist, &showdebuglist);
-}
Index: gdb-events.h
===================================================================
RCS file: gdb-events.h
diff -N gdb-events.h
--- gdb-events.h 1 Jan 2008 22:53:09 -0000 1.20
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,94 +0,0 @@
-/* User Interface Events.
-
- Copyright (C) 1999, 2001, 2002, 2004, 2007, 2008
- Free Software Foundation, Inc.
-
- Contributed by Cygnus Solutions.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Work in progress */
-
-/* This file was created with the aid of ``gdb-events.sh''.
-
- The bourn shell script ``gdb-events.sh'' creates the files
- ``new-gdb-events.c'' and ``new-gdb-events.h and then compares
- them against the existing ``gdb-events.[hc]''. Any differences
- found being reported.
-
- If editing this file, please also run gdb-events.sh and merge any
- changes into that script. Conversely, when making sweeping changes
- to this file, modifying gdb-events.sh and using its output may
- prove easier. */
-
-
-#ifndef GDB_EVENTS_H
-#define GDB_EVENTS_H
-
-
-/* COMPAT: pointer variables for old, unconverted events.
- A call to set_gdb_events() will automatically update these. */
-
-
-
-/* Type definition of all hook functions. Recommended pratice is to
- first declare each hook function using the below ftype and then
- define it. */
-
-typedef void (gdb_events_breakpoint_create_ftype) (int b);
-typedef void (gdb_events_breakpoint_delete_ftype) (int b);
-typedef void (gdb_events_breakpoint_modify_ftype) (int b);
-typedef void (gdb_events_tracepoint_create_ftype) (int number);
-typedef void (gdb_events_tracepoint_delete_ftype) (int number);
-typedef void (gdb_events_tracepoint_modify_ftype) (int number);
-typedef void (gdb_events_architecture_changed_ftype) (void);
-
-
-/* gdb-events: object. */
-
-struct gdb_events
- {
- gdb_events_breakpoint_create_ftype *breakpoint_create;
- gdb_events_breakpoint_delete_ftype *breakpoint_delete;
- gdb_events_breakpoint_modify_ftype *breakpoint_modify;
- gdb_events_tracepoint_create_ftype *tracepoint_create;
- gdb_events_tracepoint_delete_ftype *tracepoint_delete;
- gdb_events_tracepoint_modify_ftype *tracepoint_modify;
- gdb_events_architecture_changed_ftype *architecture_changed;
- };
-
-
-/* Interface into events functions.
- Where a *_p() predicate is present, it must be called before
- calling the hook proper. */
-extern void breakpoint_create_event (int b);
-extern void breakpoint_delete_event (int b);
-extern void breakpoint_modify_event (int b);
-extern void tracepoint_create_event (int number);
-extern void tracepoint_delete_event (int number);
-extern void tracepoint_modify_event (int number);
-extern void architecture_changed_event (void);
-
-/* Install custom gdb-events hooks. */
-extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gdb_events *vector);
-
-/* Deliver any pending events. */
-extern void gdb_events_deliver (struct gdb_events *vector);
-
-/* Clear event handlers. */
-extern void clear_gdb_event_hooks (void);
-
-#endif
Index: gdb-events.sh
===================================================================
RCS file: gdb-events.sh
diff -N gdb-events.sh
--- gdb-events.sh 1 Jan 2008 22:53:09 -0000 1.29
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,509 +0,0 @@
-#!/bin/sh
-
-# User Interface Events.
-#
-# Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# Contributed by Cygnus Solutions.
-#
-# This file is part of GDB.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-IFS=:
-
-read="class returntype function formal actual attrib"
-
-function_list ()
-{
- # category:
- # # -> disable
- # * -> compatibility - pointer variable that is initialized
- # by set_gdb_events().
- # ? -> Predicate and function proper.
- # f -> always call (must have a void returntype)
- # return-type
- # name
- # formal argument list
- # actual argument list
- # attributes
- # description
- cat <<EOF |
-f:void:breakpoint_create:int b:b
-f:void:breakpoint_delete:int b:b
-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:architecture_changed:void
-EOF
- grep -v '^#'
-}
-
-copyright ()
-{
- cat <<EOF
-/* User Interface Events.
-
- Copyright (C) 1999, 2001, 2002, 2004, 2005, 2007
- Free Software Foundation, Inc.
-
- Contributed by Cygnus Solutions.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Work in progress */
-
-/* This file was created with the aid of \`\`gdb-events.sh''.
-
- The bourn shell script \`\`gdb-events.sh'' creates the files
- \`\`new-gdb-events.c'' and \`\`new-gdb-events.h and then compares
- them against the existing \`\`gdb-events.[hc]''. Any differences
- found being reported.
-
- If editing this file, please also run gdb-events.sh and merge any
- changes into that script. Conversely, when making sweeping changes
- to this file, modifying gdb-events.sh and using its output may
- prove easier. */
-
-EOF
-}
-
-#
-# The .h file
-#
-
-exec > new-gdb-events.h
-copyright
-cat <<EOF
-
-#ifndef GDB_EVENTS_H
-#define GDB_EVENTS_H
-EOF
-
-# pointer declarations
-echo ""
-echo ""
-cat <<EOF
-/* COMPAT: pointer variables for old, unconverted events.
- A call to set_gdb_events() will automatically update these. */
-EOF
-echo ""
-function_list | while eval read $read
-do
- case "${class}" in
- "*" )
- echo "extern ${returntype} (*${function}_event) (${formal})${attrib};"
- ;;
- esac
-done
-
-# function typedef's
-echo ""
-echo ""
-cat <<EOF
-/* Type definition of all hook functions. Recommended pratice is to
- first declare each hook function using the below ftype and then
- define it. */
-EOF
-echo ""
-function_list | while eval read $read
-do
- echo "typedef ${returntype} (gdb_events_${function}_ftype) (${formal});"
-done
-
-# gdb_events object
-echo ""
-echo ""
-cat <<EOF
-/* gdb-events: object. */
-EOF
-echo ""
-echo "struct gdb_events"
-echo " {"
-function_list | while eval read $read
-do
- echo " gdb_events_${function}_ftype *${function}${attrib};"
-done
-echo " };"
-
-# function declarations
-echo ""
-echo ""
-cat <<EOF
-/* Interface into events functions.
- Where a *_p() predicate is present, it must be called before
- calling the hook proper. */
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "*" ) continue ;;
- "?" )
- echo "extern int ${function}_p (void);"
- echo "extern ${returntype} ${function}_event (${formal})${attrib};"
- ;;
- "f" )
- echo "extern ${returntype} ${function}_event (${formal})${attrib};"
- ;;
- esac
-done
-
-# our set function
-cat <<EOF
-
-/* Install custom gdb-events hooks. */
-extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gdb_events *vector);
-
-/* Deliver any pending events. */
-extern void gdb_events_deliver (struct gdb_events *vector);
-
-/* Clear event handlers. */
-extern void clear_gdb_event_hooks (void);
-EOF
-
-# close it off
-echo ""
-echo "#endif"
-exec 1>&2
-#../move-if-change new-gdb-events.h gdb-events.h
-if test -r gdb-events.h
-then
- diff -c gdb-events.h new-gdb-events.h
- if [ $? = 1 ]
- then
- echo "gdb-events.h changed? cp new-gdb-events.h gdb-events.h" 1>&2
- fi
-else
- echo "File missing? mv new-gdb-events.h gdb-events.h" 1>&2
-fi
-
-
-
-#
-# C file
-#
-
-exec > new-gdb-events.c
-copyright
-cat <<EOF
-
-#include "defs.h"
-#include "gdb-events.h"
-#include "gdbcmd.h"
-
-static struct gdb_events null_event_hooks;
-static struct gdb_events queue_event_hooks;
-static struct gdb_events *current_event_hooks = &null_event_hooks;
-
-int gdb_events_debug;
-static void
-show_gdb_events_debug (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- fprintf_filtered (file, _("Event debugging is %s.\\n"), value);
-}
-
-EOF
-
-# function bodies
-function_list | while eval read $read
-do
- case "${class}" in
- "*" ) continue ;;
- "?" )
-cat <<EOF
-
-int
-${function}_event_p (${formal})
-{
- return current_event_hooks->${function};
-}
-
-${returntype}
-${function}_event (${formal})
-{
- return current_events->${function} (${actual});
-}
-EOF
- ;;
- "f" )
-cat <<EOF
-
-void
-${function}_event (${formal})
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "${function}_event\n");
- if (!current_event_hooks->${function})
- return;
- current_event_hooks->${function} (${actual});
-}
-EOF
- ;;
- esac
-done
-
-# Set hooks function
-echo ""
-cat <<EOF
-struct gdb_events *
-deprecated_set_gdb_event_hooks (struct gdb_events *vector)
-{
- struct gdb_events *old_events = current_event_hooks;
- if (vector == NULL)
- current_event_hooks = &queue_event_hooks;
- else
- current_event_hooks = vector;
- return old_events;
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "*" )
- echo " ${function}_event = hooks->${function};"
- ;;
- esac
-done
-cat <<EOF
-}
-EOF
-
-# Clear hooks function
-echo ""
-cat <<EOF
-void
-clear_gdb_event_hooks (void)
-{
- deprecated_set_gdb_event_hooks (&null_event_hooks);
-}
-EOF
-
-# event type
-echo ""
-cat <<EOF
-enum gdb_event
-{
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo " ${function},"
- ;;
- esac
-done
-cat <<EOF
- nr_gdb_events
-};
-EOF
-
-# event data
-echo ""
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- if test ${actual}
- then
- echo "struct ${function}"
- echo " {"
- echo " `echo ${formal} | tr '[,]' '[;]'`;"
- echo " };"
- echo ""
- fi
- ;;
- esac
-done
-
-# event queue
-cat <<EOF
-struct event
- {
- enum gdb_event type;
- struct event *next;
- union
- {
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- if test ${actual}
- then
- echo " struct ${function} ${function};"
- fi
- ;;
- esac
-done
-cat <<EOF
- }
- data;
- };
-struct event *pending_events;
-struct event *delivering_events;
-EOF
-
-# append
-echo ""
-cat <<EOF
-static void
-append (struct event *new_event)
-{
- struct event **event = &pending_events;
- while ((*event) != NULL)
- event = &((*event)->next);
- (*event) = new_event;
- (*event)->next = NULL;
-}
-EOF
-
-# schedule a given event
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo ""
- echo "static void"
- echo "queue_${function} (${formal})"
- echo "{"
- echo " struct event *event = XMALLOC (struct event);"
- echo " event->type = ${function};"
- for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do
- echo " event->data.${function}.${arg} = ${arg};"
- done
- echo " append (event);"
- echo "}"
- ;;
- esac
-done
-
-# deliver
-echo ""
-cat <<EOF
-void
-gdb_events_deliver (struct gdb_events *vector)
-{
- /* Just zap any events left around from last time. */
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- delivering_events = event->next;
- xfree (event);
- }
- /* Process any pending events. Because one of the deliveries could
- bail out we move everything off of the pending queue onto an
- in-progress queue where it can, later, be cleaned up if
- necessary. */
- delivering_events = pending_events;
- pending_events = NULL;
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- switch (event->type)
- {
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo " case ${function}:"
- 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
-done
-cat <<EOF
- }
- delivering_events = event->next;
- xfree (event);
- }
-}
-EOF
-
-# Finally the initialization
-echo ""
-cat <<EOF
-void _initialize_gdb_events (void);
-void
-_initialize_gdb_events (void)
-{
- struct cmd_list_element *c;
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo " queue_event_hooks.${function} = queue_${function};"
- ;;
- esac
-done
-cat <<EOF
-
- add_setshow_zinteger_cmd ("event", class_maintenance,
- &gdb_events_debug, _("\\
-Set event debugging."), _("\\
-Show event debugging."), _("\\
-When non-zero, event/notify debugging is enabled."),
- NULL,
- show_gdb_events_debug,
- &setdebuglist, &showdebuglist);
-}
-EOF
-
-# close things off
-exec 1>&2
-#../move-if-change new-gdb-events.c gdb-events.c
-# Replace any leading spaces with tabs
-sed < new-gdb-events.c > tmp-gdb-events.c \
- -e 's/\( \)* /\1 /g'
-mv tmp-gdb-events.c new-gdb-events.c
-# Move if changed?
-if test -r gdb-events.c
-then
- diff -c gdb-events.c new-gdb-events.c
- if [ $? = 1 ]
- then
- echo "gdb-events.c changed? cp new-gdb-events.c gdb-events.c" 1>&2
- fi
-else
- echo "File missing? mv new-gdb-events.c gdb-events.c" 1>&2
-fi
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.429
diff -u -r1.429 gdbarch.c
--- gdbarch.c 11 Jun 2008 22:03:49 -0000 1.429
+++ gdbarch.c 13 Jul 2008 00:04:58 -0000
@@ -2,7 +2,7 @@
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GDB.
@@ -44,10 +44,10 @@
#include "gdb_assert.h"
#include "gdb_string.h"
-#include "gdb-events.h"
#include "reggroups.h"
#include "osabi.h"
#include "gdb_obstack.h"
+#include "observer.h"
/* Static function declarations */
@@ -3650,7 +3650,7 @@
gdb_assert (current_gdbarch != NULL);
gdb_assert (new_gdbarch->initialized_p);
current_gdbarch = new_gdbarch;
- architecture_changed_event ();
+ observer_notify_architecture_changed (new_gdbarch);
reinit_frame_cache ();
}
Index: interps.c
===================================================================
RCS file: /cvs/src/src/gdb/interps.c,v
retrieving revision 1.26
diff -u -r1.26 interps.c
--- interps.c 12 Jul 2008 19:25:42 -0000 1.26
+++ interps.c 13 Jul 2008 00:04:58 -0000
@@ -37,7 +37,6 @@
#include "interps.h"
#include "completer.h"
#include "gdb_string.h"
-#include "gdb-events.h"
#include "gdb_assert.h"
#include "top.h" /* For command_loop. */
#include "exceptions.h"
@@ -352,7 +351,6 @@
deprecated_error_hook = 0;
deprecated_error_begin_hook = 0;
deprecated_command_loop_hook = 0;
- clear_gdb_event_hooks ();
}
/* This is a lazy init routine, called the first time the interpreter
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.106
diff -u -r1.106 tracepoint.c
--- tracepoint.c 27 May 2008 19:29:51 -0000 1.106
+++ tracepoint.c 13 Jul 2008 00:04:58 -0000
@@ -34,9 +34,9 @@
#include "linespec.h"
#include "regcache.h"
#include "completer.h"
-#include "gdb-events.h"
#include "block.h"
#include "dictionary.h"
+#include "observer.h"
#include "ax.h"
#include "ax-gdb.h"
@@ -570,11 +570,11 @@
{
case enable_op:
t->enabled_p = 1;
- tracepoint_modify_event (t->number);
+ observer_notify_tracepoint_modified (t->number);
break;
case disable_op:
t->enabled_p = 0;
- tracepoint_modify_event (t->number);
+ observer_notify_tracepoint_modified (t->number);
break;
case delete_op:
if (tracepoint_chain == t)
@@ -587,7 +587,7 @@
break;
}
- tracepoint_delete_event (t->number);
+ observer_notify_tracepoint_deleted (t->number);
if (t->addr_string)
xfree (t->addr_string);
@@ -739,7 +739,7 @@
if (t1 == (struct tracepoint *) -1 || t1 == t2)
{
t2->pass_count = count;
- tracepoint_modify_event (t2->number);
+ observer_notify_tracepoint_modified (t2->number);
if (from_tty)
printf_filtered ("Setting tracepoint %d's passcount to %d\n",
t2->number, count);
Index: doc/observer.texi
===================================================================
RCS file: /cvs/src/src/gdb/doc/observer.texi,v
retrieving revision 1.16
diff -u -r1.16 observer.texi
--- doc/observer.texi 10 Jun 2008 10:23:54 -0000 1.16
+++ doc/observer.texi 13 Jul 2008 00:04:58 -0000
@@ -2,7 +2,7 @@
@c This file is part of the GDB manual.
@c
-@c Copyright (C) 2003, 2004, 2005, 2006
+@c Copyright (C) 2003, 2004, 2005, 2006, 2008
@c Free Software Foundation, Inc.
@c
@c See the file gdbint.texinfo for copying conditions.
@@ -142,3 +142,38 @@
thread was resume, and may be RESUME_ALL if all threads are resumed.
@end deftypefun
+@deftypefun void breakpoint_created (int @var{bpnum})
+A new breakpoint has been created. The argument @var{bpnum} is the
+number of the newly-created breakpoint.
+@end deftypefun
+
+@deftypefun void breakpoint_deleted (int @var{bpnum})
+A breakpoint has been destroyed. The argument @var{bpnum} is the
+number of the newly-destroyed breakpoint.
+@end deftypefun
+
+@deftypefun void breakpoint_modified (int @var{bpnum})
+A breakpoint has been modified in some way. The argument @var{bpnum}
+is the number of the modified breakpoint.
+@end deftypefun
+
+@deftypefun void tracepoint_created (int @var{tpnum})
+A new tracepoint has been created. The argument @var{tpnum} is the
+number of the newly-created tracepoint.
+@end deftypefun
+
+@deftypefun void tracepoint_deleted (int @var{tpnum})
+A tracepoint has been destroyed. The argument @var{tpnum} is the
+number of the newly-destroyed tracepoint.
+@end deftypefun
+
+@deftypefun void tracepoint_modified (int @var{tpnum})
+A tracepoint has been modified in some way. The argument @var{tpnum}
+is the number of the modified tracepoint.
+@end deftypefun
+
+@deftypefun void architecture_changed (struct gdbarch *@var{newarch})
+The current architecture has changed. The argument @var{newarch} is
+the new architecture.
+@end deftypefun
+
Index: gdbtk/generic/gdbtk-bp.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v
retrieving revision 1.26
diff -u -r1.26 gdbtk-bp.c
--- gdbtk/generic/gdbtk-bp.c 23 Dec 2005 18:23:15 -0000 1.26
+++ gdbtk/generic/gdbtk-bp.c 13 Jul 2008 00:04:58 -0000
@@ -1,5 +1,5 @@
/* Tcl/Tk command definitions for Insight - Breakpoints.
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2008 Free Software Foundation, Inc.
This file is part of GDB.
@@ -29,6 +29,7 @@
#include <tcl.h>
#include "gdbtk.h"
#include "gdbtk-cmds.h"
+#include "observer.h"
/* From breakpoint.c */
extern struct breakpoint *breakpoint_chain;
@@ -541,7 +542,7 @@
free(buf);
/* now send notification command back to GUI */
- breakpoint_create_event (b->number);
+ observer_notify_breakpoint_created (b->number);
return TCL_OK;
}
@@ -609,7 +610,7 @@
b->addr_string = xstrdup (saddr);
/* now send notification command back to GUI */
- breakpoint_create_event (b->number);
+ observer_notify_breakpoint_created (b->number);
return TCL_OK;
}
\f
Index: gdbtk/generic/gdbtk-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
retrieving revision 1.42
diff -u -r1.42 gdbtk-hooks.c
--- gdbtk/generic/gdbtk-hooks.c 3 Mar 2008 23:25:03 -0000 1.42
+++ gdbtk/generic/gdbtk-hooks.c 13 Jul 2008 00:04:58 -0000
@@ -1,6 +1,6 @@
/* Startup code for Insight.
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 200, 2002, 2003, 2004
+ Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 200, 2002, 2003, 2004, 2008
Free Software Foundation, Inc.
Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
@@ -29,10 +29,10 @@
#include "gdbcore.h"
#include "tracepoint.h"
#include "demangle.h"
-#include "gdb-events.h"
#include "top.h"
#include "annotate.h"
#include "cli/cli-decode.h"
+#include "observer.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
@@ -75,7 +75,7 @@
extern void gdbtk_delete_tracepoint (int);
extern void gdbtk_modify_tracepoint (int);
-static void gdbtk_architecture_changed (void);
+static void gdbtk_architecture_changed (struct gdbarch *);
static void gdbtk_trace_find (char *arg, int from_tty);
static void gdbtk_trace_start_stop (int, int);
static void gdbtk_attach (void);
@@ -119,17 +119,14 @@
void
gdbtk_add_hooks (void)
{
- static struct gdb_events handlers;
-
- /* Gdb event handlers */
- handlers.breakpoint_create = gdbtk_create_breakpoint;
- handlers.breakpoint_modify = gdbtk_modify_breakpoint;
- handlers.breakpoint_delete = gdbtk_delete_breakpoint;
- handlers.tracepoint_create = gdbtk_create_tracepoint;
- handlers.tracepoint_modify = gdbtk_modify_tracepoint;
- handlers.tracepoint_delete = gdbtk_delete_tracepoint;
- handlers.architecture_changed = gdbtk_architecture_changed;
- deprecated_set_gdb_event_hooks (&handlers);
+ /* Gdb observers */
+ observer_attach_breakpoint_created (gdbtk_create_breakpoint);
+ observer_attach_breakpoint_modified (gdbtk_modify_breakpoint);
+ observer_attach_breakpoint_deleted (gdbtk_delete_breakpoint);
+ observer_attach_tracepoint_created (gdbtk_create_tracepoint);
+ observer_attach_tracepoint_modified (gdbtk_modify_tracepoint);
+ observer_attach_tracepoint_deleted (gdbtk_delete_tracepoint);
+ observer_attach_architecture_changed (gdbtk_architecture_changed);
/* Hooks */
deprecated_call_command_hook = gdbtk_call_command;
@@ -832,7 +829,7 @@
/* Called from gdbarch_update_p whenever the architecture changes. */
static void
-gdbtk_architecture_changed (void)
+gdbtk_architecture_changed (struct gdbarch *ignore)
{
Tcl_Eval (gdbtk_interp, "gdbtk_tcl_architecture_changed");
}
Index: mi/mi-cmd-break.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-break.c,v
retrieving revision 1.20
diff -u -r1.20 mi-cmd-break.c
--- mi/mi-cmd-break.c 25 Jun 2008 15:15:41 -0000 1.20
+++ mi/mi-cmd-break.c 13 Jul 2008 00:04:58 -0000
@@ -24,32 +24,32 @@
#include "breakpoint.h"
#include "gdb_string.h"
#include "mi-getopt.h"
-#include "gdb-events.h"
#include "gdb.h"
#include "exceptions.h"
+#include "observer.h"
enum
{
FROM_TTY = 0
};
-/* Output a single breakpoint. */
+/* True if MI breakpoint observers have been registered. */
+
+static int mi_breakpoint_observers_installed;
+
+/* Control whether breakpoint_notify may act. */
+
+static int mi_can_breakpoint_notify;
+
+/* Output a single breakpoint, when allowed. */
static void
breakpoint_notify (int b)
{
- gdb_breakpoint_query (uiout, b, NULL);
+ if (mi_can_breakpoint_notify)
+ gdb_breakpoint_query (uiout, b, NULL);
}
-
-struct gdb_events breakpoint_hooks =
-{
- breakpoint_notify,
- breakpoint_notify,
- breakpoint_notify,
-};
-
-
enum bp_type
{
REG_BP,
@@ -132,7 +132,15 @@
address = argv[optind];
/* Now we have what we need, let's insert the breakpoint! */
- old_hooks = deprecated_set_gdb_event_hooks (&breakpoint_hooks);
+ if (! mi_breakpoint_observers_installed)
+ {
+ observer_attach_breakpoint_created (breakpoint_notify);
+ observer_attach_breakpoint_modified (breakpoint_notify);
+ observer_attach_breakpoint_deleted (breakpoint_notify);
+ mi_breakpoint_observers_installed = 1;
+ }
+
+ mi_can_breakpoint_notify = 1;
/* Make sure we restore hooks even if exception is thrown. */
TRY_CATCH (e, RETURN_MASK_ALL)
{
@@ -163,7 +171,7 @@
_("mi_cmd_break_insert: Bad switch."));
}
}
- deprecated_set_gdb_event_hooks (old_hooks);
+ mi_can_breakpoint_notify = 0;
if (e.reason < 0)
throw_exception (e);
}
Index: tui/tui-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v
retrieving revision 1.37
diff -u -r1.37 tui-hooks.c
--- tui/tui-hooks.c 1 Jan 2008 22:53:22 -0000 1.37
+++ tui/tui-hooks.c 13 Jul 2008 00:04:59 -0000
@@ -31,7 +31,6 @@
#include "event-top.h"
#include "frame.h"
#include "breakpoint.h"
-#include "gdb-events.h"
#include "ui-out.h"
#include "top.h"
#include "observer.h"
@@ -157,23 +156,6 @@
tui_update_all_breakpoint_info ();
}
-static void
-tui_event_default (int number)
-{
- ;
-}
-
-static struct gdb_events *tui_old_event_hooks;
-
-static struct gdb_events tui_event_hooks = {
- tui_event_create_breakpoint,
- tui_event_delete_breakpoint,
- tui_event_modify_breakpoint,
- tui_event_default,
- tui_event_default,
- tui_event_default
-};
-
/* Called when going to wait for the target.
Leave curses mode and setup program mode. */
static ptid_t
@@ -262,6 +244,11 @@
tui_display_main ();
}
+/* Observers created when installing TUI hooks. */
+static struct observer *tui_bp_created_observer;
+static struct observer *tui_bp_deleted_observer;
+static struct observer *tui_bp_modified_observer;
+
/* Install the TUI specific hooks. */
void
tui_install_hooks (void)
@@ -273,7 +260,12 @@
deprecated_query_hook = tui_query_hook;
/* Install the event hooks. */
- tui_old_event_hooks = deprecated_set_gdb_event_hooks (&tui_event_hooks);
+ tui_bp_created_observer
+ = observer_attach_breakpoint_created (tui_event_create_breakpoint);
+ tui_bp_deleted_observer
+ = observer_attach_breakpoint_deleted (tui_event_delete_breakpoint);
+ tui_bp_modified_observer
+ = observer_attach_breakpoint_modified (tui_event_modify_breakpoint);
deprecated_register_changed_hook = tui_register_changed_hook;
deprecated_detach_hook = tui_detach_hook;
@@ -290,8 +282,13 @@
deprecated_register_changed_hook = 0;
deprecated_detach_hook = 0;
- /* Restore the previous event hooks. */
- deprecated_set_gdb_event_hooks (tui_old_event_hooks);
+ /* Remove our observers. */
+ observer_detach_breakpoint_created (tui_bp_created_observer);
+ tui_bp_created_observer = NULL;
+ observer_detach_breakpoint_deleted (tui_bp_deleted_observer);
+ tui_bp_deleted_observer = NULL;
+ observer_detach_breakpoint_modified (tui_bp_modified_observer);
+ tui_bp_modified_observer = NULL;
}
void _initialize_tui_hooks (void);
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-13 0:16 RFA: Remove gdb-events Tom Tromey
@ 2008-07-13 3:26 ` Stan Shebs
2008-07-13 21:56 ` Tom Tromey
2008-07-14 17:10 ` Joel Brobecker
` (2 subsequent siblings)
3 siblings, 1 reply; 29+ messages in thread
From: Stan Shebs @ 2008-07-13 3:26 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
Tom Tromey wrote:
> BTW, why is there a separate doc/ChangeLog? I don't think it adds
> much value; in fact it partly hides the way that code and
> documentation change may be tied. The same applies to
> testsuite/ChangeLog.
>
doc/ChangeLog is purely inertia; I would be fine with merging it up in
some way.
testsuite/ChangeLog, both here and in many other components, is an
artifact of the old habit of packaging testsuites separately. I think
that the separation of change entries still makes some sense, because
the kinds of files and the testsuite structure is so different, but now
that I set my intuition down in writing, it doesn't seem that brilliant. :-)
Stan
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-13 3:26 ` Stan Shebs
@ 2008-07-13 21:56 ` Tom Tromey
2008-08-01 16:20 ` Tom Tromey
0 siblings, 1 reply; 29+ messages in thread
From: Tom Tromey @ 2008-07-13 21:56 UTC (permalink / raw)
To: Stan Shebs; +Cc: gdb-patches
>>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:
Tom> BTW, why is there a separate doc/ChangeLog? I don't think it adds
Tom> much value; in fact it partly hides the way that code and
Tom> documentation change may be tied. The same applies to
Tom> testsuite/ChangeLog.
Stan> doc/ChangeLog is purely inertia; I would be fine with merging it up in
Stan> some way.
Stan> testsuite/ChangeLog, both here and in many other components, is an
Stan> artifact of the old habit of packaging testsuites separately.
FWIW -- in libjava we did this for a while, inheriting the old Cygnus
tradition. But, it was just more work for no good reason. So, we
just renamed the testsuite ChangeLog to ChangeLog.old and moved on.
I'd like to propose changing this for gdb. I don't think merging is
even needed. Folks can always look in subdir ChangeLog.old...
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-13 0:16 RFA: Remove gdb-events Tom Tromey
2008-07-13 3:26 ` Stan Shebs
@ 2008-07-14 17:10 ` Joel Brobecker
2008-07-14 20:33 ` Tom Tromey
2008-07-17 23:41 ` Tom Tromey
2008-07-20 11:46 ` Eli Zaretskii
2008-07-21 17:13 ` Vladimir Prus
3 siblings, 2 replies; 29+ messages in thread
From: Joel Brobecker @ 2008-07-14 17:10 UTC (permalink / raw)
To: Tom Tromey, vladimir; +Cc: gdb-patches
Eli: if you could take a look at the documentation of the new observers,
that would be great! I'm going to approve the technical part, and we'll
follow any suggestion you might have either before or after commit.
Vladimir: This patch touches MI. Could you take a look at this part
of the patch? The changes seem fine to me, but see below my suggestion.
Hi Tom,
First of all, thanks very much for undertaking this task. I think
we have been talking of getting rid of hooks for at least since
the day we introduced the observers.
Here are my comments on the patch.
> * Removing the call to clear_gdb_event_hooks. In theory I think this
> could confuse some caller. However, in practice I think it is
> probably nothing to worry about.
We do have to be a little bit careful - because we don't want TUI
observers to trigger when TUI is inactive, or MI observers to trigger
when the interpreter is CLI. But I see that you definitely handled that.
My thought on this is that the observers should be installed permanently
and should have a way of determining whether the current interpreter is
the one they have been installed for before doing anything else. For
instance, inside MI, you'd have:
current_interp_is_mi ()
{
return (current_interpreter () == ...
|| current_interpreter () == ...)
}
mi_breakpoint_notify (int b)
{
if (!current_interp_is_mi ())
return;
gdb_breakpoint_query (uiout, b, NULL)
}
But, for now, the way you implemented things makes this unnecessary.
This should be discussed as a separate change, however, as I think
it would simplify things a bit inside mi and tui.
> * The architecture_changed observer is needed for gdbtk, but the only
> place where this is notified is deprecated. Since my goal here is
> to remove events, I think this is probably fine. It certainly
> doesn't seem any worse.
The gdbtk team will probably be grateful that you took a look at their
code, but it's actually maintained by a different group, with a different
discussion list. I took a look, and the changes certainly look reasonable.
Let's send them a copy of the gdbtk patch (insight@sourceware.org) when
we're happy about the changes in GDB.
> * MI installs a new set of event handlers, does some work, then
> uninstalls them. Instead of trying to replicate this behavior --
> say by deinstalling other observers -- I just made the MI observer
> conditional on a global flag, which is set and reset at the
> appropriate points.
>
> I think this is probably the friendliest approach; my thinking here
> is that any given module should not be able to mess around with
> observers installed by a separate module.
I would like Vladimir to review this part. It seems fine to me,
except that I would simply install the observer during the _init
phase instead of doing it on the fly with a static global used
to make sure they are installed only once.
Regarding the set/reset thing, see discussion above about interpreters
being able to know which interpreter is current.
> ChangeLog:
> 2008-07-12 Tom Tromey <tromey@redhat.com>
>
> * tui/tui-hooks.c: Include observer.h.
> (tui_event_default, tui_old_event_hooks, tui_event_hooks):
> Remove.
> (tui_bp_created_observer, tui_bp_deleted_observer,
> tui_bp_modified_observer): New globals.
> (tui_install_hooks): Use observers, not events.
> (tui_remove_hooks): Likewise.
> * mi/mi-cmd-break.c: Include observer.h, not gdb-events.h.
> (mi_breakpoint_observers_installed, mi_can_breakpoint_notify): New
> globals.
> (breakpoint_notify): Check mi_can_breakpoint_notify.
> (breakpoint_hooks): Remove.
> (mi_cmd_break_insert): Attach observers. Don't use events.
> * tracepoint.c: Include observer.h, not gdb-events.h.
> (tracepoint_operation, trace_pass_command): Notify observer.
> * interps.c: Don't include gdb-events.h.
> (clear_interpreter_hooks): Don't call clear_gdb_event_hooks.
> * gdbarch.c: Include observer.h, not gdb-events.h.
> (deprecated_current_gdbarch_select_hack): Notify observer.
> * breakpoint.h: Don't include gdb-events.h.
> * breakpoint.c: Don't include gdb-events.h.
> (condition_command): Notify observer.
> (commands_command): Likewise.
> (commands_from_control_command): Likewise.
> (mention, delete_breakpoint, set_ignore_count): Likewise.
> (disable_breakpoint, do_enable_breakpoint): Likewise.
> * Makefile.in (gdb_events_h): Remove.
> (breakpoint_h): Update.
> (COMMON_OBS): Remove gdb-events.o.
> (gdb-events.o): Remove.
> (breakpoint.o, gdbarch.o, interps.o, tracepoint.o, gdbtk-bp.o,
> gdbtk-hooks.o, mi-cmd-break.o, tui-hooks.o): Update.
> * gdb-events.c: Remove.
> * gdb-events.h: Remove.
> * gdb-events.sh: Remove.
Overall, this looks OK to me. Let's wait for Vladimir to provide
his comments the MI part of your changes. There are a few nits that
need fixing before this is checked in, but except for the MI part,
this is pre-approved.
First nit: gdbarch.c is a generated file. You'll need to modify gdbarch.sh
instead, and regenerate gdbarch.c. You'll see that the changes should
be identical to the ones you made, but in a different file.
> doc/ChangeLog:
> 2008-07-12 Tom Tromey <tromey@redhat.com>
>
> * observer.texi (GDB Observers): Document new observers:
> breakpoint_created, breakpoint_deleted, breakpoint_modified,
> tracepoint_created, tracepoint_deleted, tracepoint_modified,
> architecture_changed.
OK.
> gdbtk/ChangeLog:
> 2008-07-12 Tom Tromey <tromey@redhat.com>
>
> * generic/gdbtk-hooks.c: Include observer.h, not gdb-events.h.
> (gdbtk_add_hooks): Use observers, not events.
> (gdbtk_architecture_changed): Add argument, for observer.
> * generic/gdbtk-bp.c: Include observer.h.
> (gdb_set_bp): Notify observer.
> (gdb_set_bp_addr): Likewise.
This is insight "territory".
> Index: Makefile.in
> ===================================================================
> RCS file: /cvs/src/src/gdb/Makefile.in,v
> retrieving revision 1.1035
> diff -u -r1.1035 Makefile.in
> --- Makefile.in 11 Jul 2008 11:07:38 -0000 1.1035
> +++ Makefile.in 13 Jul 2008 00:04:57 -0000
For this part, could you re-do a pass to check that the dependencies
have all been correctly updated. For instance, I noticed that for
tracepoint.c, you correctly removed the dependency on gdb-events.h,
but forgot to add the one on observer.h. As far as I can tell, this
is the only case were something was missed.
Let's isolate the Makefile.in changes related to gdbtk and send them
to the insight list together with your other gdbtk changes.
--
Joel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-14 17:10 ` Joel Brobecker
@ 2008-07-14 20:33 ` Tom Tromey
2008-07-15 6:54 ` Joel Brobecker
2008-07-17 23:41 ` Tom Tromey
1 sibling, 1 reply; 29+ messages in thread
From: Tom Tromey @ 2008-07-14 20:33 UTC (permalink / raw)
To: Joel Brobecker; +Cc: vladimir, gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> My thought on this is that the observers should be installed
Joel> permanently and should have a way of determining whether the
Joel> current interpreter is the one they have been installed for
Joel> before doing anything else.
Ok. Either way is fine by me -- I'll implement whatever Vladimir says.
Joel> The gdbtk team will probably be grateful that you took a look at their
Joel> code, but it's actually maintained by a different group, with a different
Joel> discussion list. I took a look, and the changes certainly look reasonable.
Joel> Let's send them a copy of the gdbtk patch (insight@sourceware.org) when
Joel> we're happy about the changes in GDB.
I sent a note and Keith replied, saying that this patch is ok.
Joel> Let's isolate the Makefile.in changes related to gdbtk and send them
Joel> to the insight list together with your other gdbtk changes.
So -- you would want this patch separated into two commits?
I am happy to do that, but it seems weird. Logically it is a single
change.
I will address your other comments and submit an updated patch once I
hear back from Vladimir and, possibly, the TUI maintainer.
thanks,
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-14 20:33 ` Tom Tromey
@ 2008-07-15 6:54 ` Joel Brobecker
0 siblings, 0 replies; 29+ messages in thread
From: Joel Brobecker @ 2008-07-15 6:54 UTC (permalink / raw)
To: Tom Tromey; +Cc: vladimir, gdb-patches
> Joel> Let's send them a copy of the gdbtk patch (insight@sourceware.org) when
> Joel> we're happy about the changes in GDB.
>
> I sent a note and Keith replied, saying that this patch is ok.
>
> Joel> Let's isolate the Makefile.in changes related to gdbtk and send them
> Joel> to the insight list together with your other gdbtk changes.
>
> So -- you would want this patch separated into two commits?
> I am happy to do that, but it seems weird. Logically it is a single
> change.
Oh, if the gdbtk changes have been approved too, then I agree there is
no reason to split them.
--
Joel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-14 17:10 ` Joel Brobecker
2008-07-14 20:33 ` Tom Tromey
@ 2008-07-17 23:41 ` Tom Tromey
2008-07-21 16:54 ` GDB/MI PING (was: "Re: RFA: Remove gdb-events") Joel Brobecker
2008-07-22 0:56 ` RFA: Remove gdb-events Tom Tromey
1 sibling, 2 replies; 29+ messages in thread
From: Tom Tromey @ 2008-07-17 23:41 UTC (permalink / raw)
To: Joel Brobecker; +Cc: vladimir, gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> Eli: if you could take a look at the documentation of the new
Joel> observers, that would be great! I'm going to approve the
Joel> technical part, and we'll follow any suggestion you might have
Joel> either before or after commit.
Joel> Vladimir: This patch touches MI. Could you take a look at this part
Joel> of the patch? The changes seem fine to me, but see below my suggestion.
I'm waiting for these two, so I haven't sent an updated patch.
But...
Joel> First nit: gdbarch.c is a generated file. You'll need to modify
Joel> gdbarch.sh instead, and regenerate gdbarch.c. You'll see that
Joel> the changes should be identical to the ones you made, but in a
Joel> different file.
Thanks, I fixed this.
>> +++ Makefile.in 13 Jul 2008 00:04:57 -0000
Joel> For this part, could you re-do a pass to check that the dependencies
Joel> have all been correctly updated. For instance, I noticed that for
Joel> tracepoint.c, you correctly removed the dependency on gdb-events.h,
Joel> but forgot to add the one on observer.h. As far as I can tell, this
Joel> is the only case were something was missed.
I checked and all the dependencies are there, afaict. I think you
just misread the tracepoint.o hunk. See the second insertion:
@@ -2933,9 +2930,9 @@
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \
$(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \
$(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \
- $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) \
+ $(linespec_h) $(regcache_h) $(completer_h) \
$(block_h) $(dictionary_h) $(ax_h) $(ax_gdb_h) $(readline_h) \
- $(readline_history_h)
+ $(readline_history_h) $(observer_h)
trad-frame.o: trad-frame.c $(defs_h) $(frame_h) $(trad_frame_h) \
$(regcache_h) $(frame_unwind_h) $(value_h)
tramp-frame.o: tramp-frame.c $(defs_h) $(tramp_frame_h) $(frame_unwind_h) \
thanks,
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-13 0:16 RFA: Remove gdb-events Tom Tromey
2008-07-13 3:26 ` Stan Shebs
2008-07-14 17:10 ` Joel Brobecker
@ 2008-07-20 11:46 ` Eli Zaretskii
2008-07-21 17:13 ` Vladimir Prus
3 siblings, 0 replies; 29+ messages in thread
From: Eli Zaretskii @ 2008-07-20 11:46 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> From: Tom Tromey <tromey@redhat.com>
> Reply-To: Tom Tromey <tromey@redhat.com>
> Date: Sat, 12 Jul 2008 18:15:38 -0600
>
> +@deftypefun void architecture_changed (struct gdbarch *@var{newarch})
> +The current architecture has changed. The argument @var{newarch} is
> +the new architecture.
The last sentence should say
The argument @var{newarch} is a pointer to the new architecture.
Otherwise, the patch for observers.texi is OK. Thanks.
And sorry for a late response (due to traveling).
^ permalink raw reply [flat|nested] 29+ messages in thread
* GDB/MI PING (was: "Re: RFA: Remove gdb-events")
2008-07-17 23:41 ` Tom Tromey
@ 2008-07-21 16:54 ` Joel Brobecker
2008-07-22 0:56 ` RFA: Remove gdb-events Tom Tromey
1 sibling, 0 replies; 29+ messages in thread
From: Joel Brobecker @ 2008-07-21 16:54 UTC (permalink / raw)
To: Tom Tromey; +Cc: vladimir, gdb-patches
Hi Vladimir,
Tom made some changes in MI source files. They should not affect MI
behavior at all, and they look fine to me, but I thought you might
want to have a look.
http://www.sourceware.org/ml/gdb-patches/2008-07/msg00244.html
Hey Tom,
> Joel> Eli: if you could take a look at the documentation of the new
> Joel> observers, that would be great! I'm going to approve the
> Joel> technical part, and we'll follow any suggestion you might have
> Joel> either before or after commit.
>
> Joel> Vladimir: This patch touches MI. Could you take a look at this part
> Joel> of the patch? The changes seem fine to me, but see below my suggestion.
>
> I'm waiting for these two, so I haven't sent an updated patch.
> But...
I see Eli answered, so let's now wait for Vladimir - I think he just
missed this email (so I changed the subject to contain "MI" to catch
his attention).
> I checked and all the dependencies are there, afaict. I think you
> just misread the tracepoint.o hunk. See the second insertion:
Argh, you are right. Sorry about that.
You should commit your change as soon as Vladimir OKs the MI part.
I'm almost tempted to say that you should commit them now, and fix
any comment that Vladimir might have as a followup patch, but Vladimir
is usually extremely responsive.
--
Joel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-13 0:16 RFA: Remove gdb-events Tom Tromey
` (2 preceding siblings ...)
2008-07-20 11:46 ` Eli Zaretskii
@ 2008-07-21 17:13 ` Vladimir Prus
2008-07-22 0:32 ` Tom Tromey
3 siblings, 1 reply; 29+ messages in thread
From: Vladimir Prus @ 2008-07-21 17:13 UTC (permalink / raw)
To: gdb-patches
Tom Tromey wrote:
> My understanding is that the gdb "events" mechanism is deprecated in
> favor of using observers.
>
> This patch removes events and adds observers where needed.
>
> Most of this patch is straightforward. There are a few odd pieces:
>
> * Removing the call to clear_gdb_event_hooks. In theory I think this
> could confuse some caller. However, in practice I think it is
> probably nothing to worry about.
>
> * The architecture_changed observer is needed for gdbtk, but the only
> place where this is notified is deprecated. Since my goal here is
> to remove events, I think this is probably fine. It certainly
> doesn't seem any worse.
>
> * MI installs a new set of event handlers, does some work, then
> uninstalls them. Instead of trying to replicate this behavior --
> say by deinstalling other observers -- I just made the MI observer
> conditional on a global flag, which is set and reset at the
> appropriate points.
I think it would have been nicer to install observers in mi_interpreter_init,
but it's not critical matter. The mi_can_breakpoint_notify will probably
remain forever, so that we report breakpoints differently when they are created
during -break-insert and when they are created by other commands -- the
former needs to report new breakpoint as part of ^done reply, and the latter
has to use notification.
I don't have any objections to the MI part of this change -- thanks for asking
for an opinion!
- Volodya
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-21 17:13 ` Vladimir Prus
@ 2008-07-22 0:32 ` Tom Tromey
0 siblings, 0 replies; 29+ messages in thread
From: Tom Tromey @ 2008-07-22 0:32 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
>>>>> "Vladimir" == Vladimir Prus <vladimir@codesourcery.com> writes:
Vladimir> I think it would have been nicer to install observers in
Vladimir> mi_interpreter_init, but it's not critical matter.
Ok, I will leave it as-is. If you like, I can submit a follow-up
patch addressing this.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-17 23:41 ` Tom Tromey
2008-07-21 16:54 ` GDB/MI PING (was: "Re: RFA: Remove gdb-events") Joel Brobecker
@ 2008-07-22 0:56 ` Tom Tromey
2008-07-25 16:11 ` Tom Tromey
1 sibling, 1 reply; 29+ messages in thread
From: Tom Tromey @ 2008-07-22 0:56 UTC (permalink / raw)
To: Joel Brobecker; +Cc: vladimir, gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Joel> First nit: gdbarch.c is a generated file. You'll need to modify
Joel> gdbarch.sh instead, and regenerate gdbarch.c. You'll see that
Joel> the changes should be identical to the ones you made, but in a
Joel> different file.
Tom> Thanks, I fixed this.
Here is the follow-up patch. I assume I need a final "OK" for this.
I fixed Eli's comment about the text in observer.texi, and I made the
change to gdbarch.sh.
Built and tested on x86 F8.
Ok?
Tom
ChangeLog:
2008-07-21 Tom Tromey <tromey@redhat.com>
* tui/tui-hooks.c: Include observer.h.
(tui_event_default, tui_old_event_hooks, tui_event_hooks):
Remove.
(tui_bp_created_observer, tui_bp_deleted_observer,
tui_bp_modified_observer): New globals.
(tui_install_hooks): Use observers, not events.
(tui_remove_hooks): Likewise.
* mi/mi-cmd-break.c: Include observer.h, not gdb-events.h.
(mi_breakpoint_observers_installed, mi_can_breakpoint_notify): New
globals.
(breakpoint_notify): Check mi_can_breakpoint_notify.
(breakpoint_hooks): Remove.
(mi_cmd_break_insert): Attach observers. Don't use events.
* tracepoint.c: Include observer.h, not gdb-events.h.
(tracepoint_operation, trace_pass_command): Notify observer.
* interps.c: Don't include gdb-events.h.
(clear_interpreter_hooks): Don't call clear_gdb_event_hooks.
* gdbarch.c: Rebuild.
* gdbarch.sh: Emit include for observer.h, not gdb-events.h.
(deprecated_current_gdbarch_select_hack): Notify observer.
* breakpoint.h: Don't include gdb-events.h.
* breakpoint.c: Don't include gdb-events.h.
(condition_command): Notify observer.
(commands_command): Likewise.
(commands_from_control_command): Likewise.
(mention, delete_breakpoint, set_ignore_count): Likewise.
(disable_breakpoint, do_enable_breakpoint): Likewise.
* Makefile.in (gdb_events_h): Remove.
(breakpoint_h): Update.
(COMMON_OBS): Remove gdb-events.o.
(gdb-events.o): Remove.
(breakpoint.o, gdbarch.o, interps.o, tracepoint.o, gdbtk-bp.o,
gdbtk-hooks.o, mi-cmd-break.o, tui-hooks.o): Update.
* gdb-events.c: Remove.
* gdb-events.h: Remove.
* gdb-events.sh: Remove.
doc/ChangeLog:
2008-07-21 Tom Tromey <tromey@redhat.com>
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdbtk/ChangeLog:
2008-07-21 Tom Tromey <tromey@redhat.com>
* generic/gdbtk-hooks.c: Include observer.h, not gdb-events.h.
(gdbtk_add_hooks): Use observers, not events.
(gdbtk_architecture_changed): Add argument, for observer.
* generic/gdbtk-bp.c: Include observer.h.
(gdb_set_bp): Notify observer.
(gdb_set_bp_addr): Likewise.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.1039
diff -u -r1.1039 Makefile.in
--- Makefile.in 18 Jul 2008 20:55:32 -0000 1.1039
+++ Makefile.in 22 Jul 2008 00:34:54 -0000
@@ -742,7 +742,7 @@
bcache_h = bcache.h
bfd_target_h = bfd-target.h
block_h = block.h
-breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h) $(vec_h)
+breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(vec_h)
bsd_kvm_h = bsd-kvm.h
bsd_uthread_h = bsd-uthread.h
buildsym_h = buildsym.h
@@ -787,7 +787,6 @@
gdbcore_h = gdbcore.h $(bfd_h)
gdb_curses_h = gdb_curses.h
gdb_dirent_h = gdb_dirent.h
-gdb_events_h = gdb-events.h
gdb_h = gdb.h
gdb_expat_h = gdb_expat.h
gdb_locale_h = gdb_locale.h
@@ -1062,7 +1061,6 @@
findcmd.o \
std-regs.o \
signals.o \
- gdb-events.o \
exec.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o coff-pe-read.o \
dwarf2read.o mipsread.o stabsread.o corefile.o \
@@ -1972,7 +1970,7 @@
$(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \
$(objfiles_h) $(source_h) $(linespec_h) $(completer_h) $(gdb_h) \
$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(solib_h) \
- $(solist_h) $(observer_h) $(exceptions_h) $(gdb_events_h) \
+ $(solist_h) $(observer_h) $(exceptions_h) \
$(mi_common_h) $(memattr_h) $(ada_lang_h) $(top_h) $(hashtab_h)
bsd-kvm.o: bsd-kvm.c $(defs_h) $(cli_cmds_h) $(command_h) $(frame_h) \
$(regcache_h) $(target_h) $(value_h) $(gdbcore_h) $(gdb_assert_h) \
@@ -2167,9 +2165,8 @@
$(gdb_assert_h)
gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
$(symcat_h) $(floatformat_h) $(gdb_assert_h) $(gdb_string_h) \
- $(gdb_events_h) $(reggroups_h) $(osabi_h) $(gdb_obstack_h)
+ $(reggroups_h) $(osabi_h) $(gdb_obstack_h) $(observer_h)
gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) $(interps_h)
-gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h)
gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
$(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \
$(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \
@@ -2341,7 +2338,7 @@
$(gdb_assert_h) $(gdb_string_h) $(inf_child_h) $(inf_ttrace_h)
interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
$(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \
- $(gdb_events_h) $(gdb_assert_h) $(top_h) $(exceptions_h)
+ $(gdb_assert_h) $(top_h) $(exceptions_h)
iq2000-tdep.o: iq2000-tdep.c $(defs_h) $(frame_h) $(frame_base_h) \
$(frame_unwind_h) $(dwarf2_frame_h) $(gdbtypes_h) $(value_h) \
$(dis_asm_h) $(gdb_string_h) $(arch_utils_h) $(regcache_h) \
@@ -2933,9 +2930,9 @@
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \
$(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \
$(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \
- $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) \
+ $(linespec_h) $(regcache_h) $(completer_h) \
$(block_h) $(dictionary_h) $(ax_h) $(ax_gdb_h) $(readline_h) \
- $(readline_history_h)
+ $(readline_history_h) $(observer_h)
trad-frame.o: trad-frame.c $(defs_h) $(frame_h) $(trad_frame_h) \
$(regcache_h) $(frame_unwind_h) $(value_h)
tramp-frame.o: tramp-frame.c $(defs_h) $(tramp_frame_h) $(frame_unwind_h) \
@@ -3151,7 +3148,7 @@
$(srcdir)/gdbtk/generic/gdbtk.h \
$(srcdir)/gdbtk/generic/gdbtk-cmds.h \
$(defs_h) $(breakpoint_h) $(tracepoint_h) \
- $(symfile_h) $(symtab_h) $(gdb_string_h)
+ $(symfile_h) $(symtab_h) $(gdb_string_h) $(observer_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \
@@ -3172,7 +3169,7 @@
$(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
$(symtab_h) $(inferior_h) $(command_h) \
$(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \
- $(tracepoint_h)
+ $(tracepoint_h) $(observer_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
$(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
@@ -3232,7 +3229,7 @@
mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
$(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \
- $(mi_getopt_h) $(gdb_events_h) $(gdb_h)
+ $(mi_getopt_h) $(gdb_h) $(observer_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \
$(mi_cmds_h) $(mi_getopt_h) $(gdb_string_h) $(ui_out_h) $(disasm_h)
@@ -3326,7 +3323,7 @@
tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(defs_h) $(symtab_h) $(inferior_h) \
$(command_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) \
$(gdbcore_h) $(event_loop_h) $(event_top_h) $(frame_h) \
- $(breakpoint_h) $(gdb_events_h) $(ui_out_h) $(top_h) $(observer_h) \
+ $(breakpoint_h) $(ui_out_h) $(top_h) $(observer_h) \
$(tui_h) $(tui_hooks_h) $(tui_data_h) $(tui_layout_h) $(tui_io_h) \
$(tui_regs_h) $(tui_win_h) $(tui_stack_h) $(tui_windata_h) \
$(tui_winsource_h) $(gdb_curses_h) $(readline_h)
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.336
diff -u -r1.336 breakpoint.c
--- breakpoint.c 15 Jul 2008 19:11:34 -0000 1.336
+++ breakpoint.c 22 Jul 2008 00:34:55 -0000
@@ -57,7 +57,6 @@
#include "top.h"
#include "wrapper.h"
-#include "gdb-events.h"
#include "mi/mi-common.h"
/* Prototypes for local functions. */
@@ -619,7 +618,7 @@
}
}
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return;
}
@@ -658,7 +657,7 @@
free_command_lines (&b->commands);
b->commands = l;
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return;
}
error (_("No breakpoint number %d."), bnum);
@@ -704,7 +703,7 @@
list after it finishes execution. */
b->commands = copy_command_lines (cmd->body_list[0]);
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return simple_control;
}
error (_("No breakpoint number %d."), bnum);
@@ -4895,7 +4894,7 @@
been done for deprecated_delete_breakpoint_hook and so on. */
if (deprecated_create_breakpoint_hook)
deprecated_create_breakpoint_hook (b);
- breakpoint_create_event (b->number);
+ observer_notify_breakpoint_created (b->number);
if (b->ops != NULL && b->ops->print_mention != NULL)
b->ops->print_mention (b);
@@ -7216,7 +7215,7 @@
if (deprecated_delete_breakpoint_hook)
deprecated_delete_breakpoint_hook (bpt);
- breakpoint_delete_event (bpt->number);
+ observer_notify_breakpoint_deleted (bpt->number);
if (breakpoint_chain == bpt)
breakpoint_chain = bpt->next;
@@ -7721,7 +7720,7 @@
count, bptnum);
}
breakpoints_changed ();
- breakpoint_modify_event (b->number);
+ observer_notify_breakpoint_modified (b->number);
return;
}
@@ -7871,7 +7870,7 @@
if (deprecated_modify_breakpoint_hook)
deprecated_modify_breakpoint_hook (bpt);
- breakpoint_modify_event (bpt->number);
+ observer_notify_breakpoint_modified (bpt->number);
}
static void
@@ -7996,7 +7995,7 @@
if (deprecated_modify_breakpoint_hook)
deprecated_modify_breakpoint_hook (bpt);
- breakpoint_modify_event (bpt->number);
+ observer_notify_breakpoint_modified (bpt->number);
}
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.75
diff -u -r1.75 breakpoint.h
--- breakpoint.h 9 Jul 2008 22:23:05 -0000 1.75
+++ breakpoint.h 22 Jul 2008 00:34:55 -0000
@@ -24,8 +24,6 @@
#include "value.h"
#include "vec.h"
-#include "gdb-events.h"
-
struct value;
struct block;
Index: gdb-events.c
===================================================================
RCS file: gdb-events.c
diff -N gdb-events.c
--- gdb-events.c 1 Jan 2008 22:53:09 -0000 1.25
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,349 +0,0 @@
-/* User Interface Events.
-
- Copyright (C) 1999, 2001, 2002, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
-
- Contributed by Cygnus Solutions.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Work in progress */
-
-/* This file was created with the aid of ``gdb-events.sh''.
-
- The bourn shell script ``gdb-events.sh'' creates the files
- ``new-gdb-events.c'' and ``new-gdb-events.h and then compares
- them against the existing ``gdb-events.[hc]''. Any differences
- found being reported.
-
- If editing this file, please also run gdb-events.sh and merge any
- changes into that script. Conversely, when making sweeping changes
- to this file, modifying gdb-events.sh and using its output may
- prove easier. */
-
-
-#include "defs.h"
-#include "gdb-events.h"
-#include "gdbcmd.h"
-
-static struct gdb_events null_event_hooks;
-static struct gdb_events queue_event_hooks;
-static struct gdb_events *current_event_hooks = &null_event_hooks;
-
-int gdb_events_debug;
-static void
-show_gdb_events_debug (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- fprintf_filtered (file, _("Event debugging is %s.\n"), value);
-}
-
-
-void
-breakpoint_create_event (int b)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "breakpoint_create_event\n");
- if (!current_event_hooks->breakpoint_create)
- return;
- current_event_hooks->breakpoint_create (b);
-}
-
-void
-breakpoint_delete_event (int b)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "breakpoint_delete_event\n");
- if (!current_event_hooks->breakpoint_delete)
- return;
- current_event_hooks->breakpoint_delete (b);
-}
-
-void
-breakpoint_modify_event (int b)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "breakpoint_modify_event\n");
- if (!current_event_hooks->breakpoint_modify)
- return;
- current_event_hooks->breakpoint_modify (b);
-}
-
-void
-tracepoint_create_event (int number)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "tracepoint_create_event\n");
- if (!current_event_hooks->tracepoint_create)
- return;
- current_event_hooks->tracepoint_create (number);
-}
-
-void
-tracepoint_delete_event (int number)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "tracepoint_delete_event\n");
- if (!current_event_hooks->tracepoint_delete)
- return;
- current_event_hooks->tracepoint_delete (number);
-}
-
-void
-tracepoint_modify_event (int number)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "tracepoint_modify_event\n");
- if (!current_event_hooks->tracepoint_modify)
- return;
- current_event_hooks->tracepoint_modify (number);
-}
-
-void
-architecture_changed_event (void)
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "architecture_changed_event\n");
- if (!current_event_hooks->architecture_changed)
- return;
- current_event_hooks->architecture_changed ();
-}
-
-struct gdb_events *
-deprecated_set_gdb_event_hooks (struct gdb_events *vector)
-{
- struct gdb_events *old_events = current_event_hooks;
- if (vector == NULL)
- current_event_hooks = &queue_event_hooks;
- else
- current_event_hooks = vector;
- return old_events;
-}
-
-void
-clear_gdb_event_hooks (void)
-{
- deprecated_set_gdb_event_hooks (&null_event_hooks);
-}
-
-enum gdb_event
-{
- breakpoint_create,
- breakpoint_delete,
- breakpoint_modify,
- tracepoint_create,
- tracepoint_delete,
- tracepoint_modify,
- architecture_changed,
- nr_gdb_events
-};
-
-struct breakpoint_create
- {
- int b;
- };
-
-struct breakpoint_delete
- {
- int b;
- };
-
-struct breakpoint_modify
- {
- int b;
- };
-
-struct tracepoint_create
- {
- int number;
- };
-
-struct tracepoint_delete
- {
- int number;
- };
-
-struct tracepoint_modify
- {
- int number;
- };
-
-struct event
- {
- enum gdb_event type;
- struct event *next;
- union
- {
- struct breakpoint_create breakpoint_create;
- struct breakpoint_delete breakpoint_delete;
- struct breakpoint_modify breakpoint_modify;
- struct tracepoint_create tracepoint_create;
- struct tracepoint_delete tracepoint_delete;
- struct tracepoint_modify tracepoint_modify;
- }
- data;
- };
-struct event *pending_events;
-struct event *delivering_events;
-
-static void
-append (struct event *new_event)
-{
- struct event **event = &pending_events;
- while ((*event) != NULL)
- event = &((*event)->next);
- (*event) = new_event;
- (*event)->next = NULL;
-}
-
-static void
-queue_breakpoint_create (int b)
-{
- struct event *event = XMALLOC (struct event);
- event->type = breakpoint_create;
- event->data.breakpoint_create.b = b;
- append (event);
-}
-
-static void
-queue_breakpoint_delete (int b)
-{
- struct event *event = XMALLOC (struct event);
- event->type = breakpoint_delete;
- event->data.breakpoint_delete.b = b;
- append (event);
-}
-
-static void
-queue_breakpoint_modify (int b)
-{
- struct event *event = XMALLOC (struct event);
- event->type = breakpoint_modify;
- event->data.breakpoint_modify.b = b;
- append (event);
-}
-
-static void
-queue_tracepoint_create (int number)
-{
- struct event *event = XMALLOC (struct event);
- event->type = tracepoint_create;
- event->data.tracepoint_create.number = number;
- append (event);
-}
-
-static void
-queue_tracepoint_delete (int number)
-{
- struct event *event = XMALLOC (struct event);
- event->type = tracepoint_delete;
- event->data.tracepoint_delete.number = number;
- append (event);
-}
-
-static void
-queue_tracepoint_modify (int number)
-{
- struct event *event = XMALLOC (struct event);
- event->type = tracepoint_modify;
- event->data.tracepoint_modify.number = number;
- append (event);
-}
-
-static void
-queue_architecture_changed (void)
-{
- struct event *event = XMALLOC (struct event);
- event->type = architecture_changed;
- append (event);
-}
-
-void
-gdb_events_deliver (struct gdb_events *vector)
-{
- /* Just zap any events left around from last time. */
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- delivering_events = event->next;
- xfree (event);
- }
- /* Process any pending events. Because one of the deliveries could
- bail out we move everything off of the pending queue onto an
- in-progress queue where it can, later, be cleaned up if
- necessary. */
- delivering_events = pending_events;
- pending_events = NULL;
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- switch (event->type)
- {
- case breakpoint_create:
- vector->breakpoint_create
- (event->data.breakpoint_create.b);
- break;
- case breakpoint_delete:
- vector->breakpoint_delete
- (event->data.breakpoint_delete.b);
- break;
- case breakpoint_modify:
- vector->breakpoint_modify
- (event->data.breakpoint_modify.b);
- break;
- case tracepoint_create:
- vector->tracepoint_create
- (event->data.tracepoint_create.number);
- break;
- case tracepoint_delete:
- vector->tracepoint_delete
- (event->data.tracepoint_delete.number);
- break;
- case tracepoint_modify:
- vector->tracepoint_modify
- (event->data.tracepoint_modify.number);
- break;
- case architecture_changed:
- vector->architecture_changed ();
- break;
- }
- delivering_events = event->next;
- xfree (event);
- }
-}
-
-void _initialize_gdb_events (void);
-void
-_initialize_gdb_events (void)
-{
- struct cmd_list_element *c;
- queue_event_hooks.breakpoint_create = queue_breakpoint_create;
- queue_event_hooks.breakpoint_delete = queue_breakpoint_delete;
- queue_event_hooks.breakpoint_modify = queue_breakpoint_modify;
- queue_event_hooks.tracepoint_create = queue_tracepoint_create;
- queue_event_hooks.tracepoint_delete = queue_tracepoint_delete;
- queue_event_hooks.tracepoint_modify = queue_tracepoint_modify;
- queue_event_hooks.architecture_changed = queue_architecture_changed;
-
- add_setshow_zinteger_cmd ("event", class_maintenance,
- &gdb_events_debug, _("\
-Set event debugging."), _("\
-Show event debugging."), _("\
-When non-zero, event/notify debugging is enabled."),
- NULL,
- show_gdb_events_debug,
- &setdebuglist, &showdebuglist);
-}
Index: gdb-events.h
===================================================================
RCS file: gdb-events.h
diff -N gdb-events.h
--- gdb-events.h 1 Jan 2008 22:53:09 -0000 1.20
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,94 +0,0 @@
-/* User Interface Events.
-
- Copyright (C) 1999, 2001, 2002, 2004, 2007, 2008
- Free Software Foundation, Inc.
-
- Contributed by Cygnus Solutions.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Work in progress */
-
-/* This file was created with the aid of ``gdb-events.sh''.
-
- The bourn shell script ``gdb-events.sh'' creates the files
- ``new-gdb-events.c'' and ``new-gdb-events.h and then compares
- them against the existing ``gdb-events.[hc]''. Any differences
- found being reported.
-
- If editing this file, please also run gdb-events.sh and merge any
- changes into that script. Conversely, when making sweeping changes
- to this file, modifying gdb-events.sh and using its output may
- prove easier. */
-
-
-#ifndef GDB_EVENTS_H
-#define GDB_EVENTS_H
-
-
-/* COMPAT: pointer variables for old, unconverted events.
- A call to set_gdb_events() will automatically update these. */
-
-
-
-/* Type definition of all hook functions. Recommended pratice is to
- first declare each hook function using the below ftype and then
- define it. */
-
-typedef void (gdb_events_breakpoint_create_ftype) (int b);
-typedef void (gdb_events_breakpoint_delete_ftype) (int b);
-typedef void (gdb_events_breakpoint_modify_ftype) (int b);
-typedef void (gdb_events_tracepoint_create_ftype) (int number);
-typedef void (gdb_events_tracepoint_delete_ftype) (int number);
-typedef void (gdb_events_tracepoint_modify_ftype) (int number);
-typedef void (gdb_events_architecture_changed_ftype) (void);
-
-
-/* gdb-events: object. */
-
-struct gdb_events
- {
- gdb_events_breakpoint_create_ftype *breakpoint_create;
- gdb_events_breakpoint_delete_ftype *breakpoint_delete;
- gdb_events_breakpoint_modify_ftype *breakpoint_modify;
- gdb_events_tracepoint_create_ftype *tracepoint_create;
- gdb_events_tracepoint_delete_ftype *tracepoint_delete;
- gdb_events_tracepoint_modify_ftype *tracepoint_modify;
- gdb_events_architecture_changed_ftype *architecture_changed;
- };
-
-
-/* Interface into events functions.
- Where a *_p() predicate is present, it must be called before
- calling the hook proper. */
-extern void breakpoint_create_event (int b);
-extern void breakpoint_delete_event (int b);
-extern void breakpoint_modify_event (int b);
-extern void tracepoint_create_event (int number);
-extern void tracepoint_delete_event (int number);
-extern void tracepoint_modify_event (int number);
-extern void architecture_changed_event (void);
-
-/* Install custom gdb-events hooks. */
-extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gdb_events *vector);
-
-/* Deliver any pending events. */
-extern void gdb_events_deliver (struct gdb_events *vector);
-
-/* Clear event handlers. */
-extern void clear_gdb_event_hooks (void);
-
-#endif
Index: gdb-events.sh
===================================================================
RCS file: gdb-events.sh
diff -N gdb-events.sh
--- gdb-events.sh 1 Jan 2008 22:53:09 -0000 1.29
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,509 +0,0 @@
-#!/bin/sh
-
-# User Interface Events.
-#
-# Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# Contributed by Cygnus Solutions.
-#
-# This file is part of GDB.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-IFS=:
-
-read="class returntype function formal actual attrib"
-
-function_list ()
-{
- # category:
- # # -> disable
- # * -> compatibility - pointer variable that is initialized
- # by set_gdb_events().
- # ? -> Predicate and function proper.
- # f -> always call (must have a void returntype)
- # return-type
- # name
- # formal argument list
- # actual argument list
- # attributes
- # description
- cat <<EOF |
-f:void:breakpoint_create:int b:b
-f:void:breakpoint_delete:int b:b
-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:architecture_changed:void
-EOF
- grep -v '^#'
-}
-
-copyright ()
-{
- cat <<EOF
-/* User Interface Events.
-
- Copyright (C) 1999, 2001, 2002, 2004, 2005, 2007
- Free Software Foundation, Inc.
-
- Contributed by Cygnus Solutions.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Work in progress */
-
-/* This file was created with the aid of \`\`gdb-events.sh''.
-
- The bourn shell script \`\`gdb-events.sh'' creates the files
- \`\`new-gdb-events.c'' and \`\`new-gdb-events.h and then compares
- them against the existing \`\`gdb-events.[hc]''. Any differences
- found being reported.
-
- If editing this file, please also run gdb-events.sh and merge any
- changes into that script. Conversely, when making sweeping changes
- to this file, modifying gdb-events.sh and using its output may
- prove easier. */
-
-EOF
-}
-
-#
-# The .h file
-#
-
-exec > new-gdb-events.h
-copyright
-cat <<EOF
-
-#ifndef GDB_EVENTS_H
-#define GDB_EVENTS_H
-EOF
-
-# pointer declarations
-echo ""
-echo ""
-cat <<EOF
-/* COMPAT: pointer variables for old, unconverted events.
- A call to set_gdb_events() will automatically update these. */
-EOF
-echo ""
-function_list | while eval read $read
-do
- case "${class}" in
- "*" )
- echo "extern ${returntype} (*${function}_event) (${formal})${attrib};"
- ;;
- esac
-done
-
-# function typedef's
-echo ""
-echo ""
-cat <<EOF
-/* Type definition of all hook functions. Recommended pratice is to
- first declare each hook function using the below ftype and then
- define it. */
-EOF
-echo ""
-function_list | while eval read $read
-do
- echo "typedef ${returntype} (gdb_events_${function}_ftype) (${formal});"
-done
-
-# gdb_events object
-echo ""
-echo ""
-cat <<EOF
-/* gdb-events: object. */
-EOF
-echo ""
-echo "struct gdb_events"
-echo " {"
-function_list | while eval read $read
-do
- echo " gdb_events_${function}_ftype *${function}${attrib};"
-done
-echo " };"
-
-# function declarations
-echo ""
-echo ""
-cat <<EOF
-/* Interface into events functions.
- Where a *_p() predicate is present, it must be called before
- calling the hook proper. */
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "*" ) continue ;;
- "?" )
- echo "extern int ${function}_p (void);"
- echo "extern ${returntype} ${function}_event (${formal})${attrib};"
- ;;
- "f" )
- echo "extern ${returntype} ${function}_event (${formal})${attrib};"
- ;;
- esac
-done
-
-# our set function
-cat <<EOF
-
-/* Install custom gdb-events hooks. */
-extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gdb_events *vector);
-
-/* Deliver any pending events. */
-extern void gdb_events_deliver (struct gdb_events *vector);
-
-/* Clear event handlers. */
-extern void clear_gdb_event_hooks (void);
-EOF
-
-# close it off
-echo ""
-echo "#endif"
-exec 1>&2
-#../move-if-change new-gdb-events.h gdb-events.h
-if test -r gdb-events.h
-then
- diff -c gdb-events.h new-gdb-events.h
- if [ $? = 1 ]
- then
- echo "gdb-events.h changed? cp new-gdb-events.h gdb-events.h" 1>&2
- fi
-else
- echo "File missing? mv new-gdb-events.h gdb-events.h" 1>&2
-fi
-
-
-
-#
-# C file
-#
-
-exec > new-gdb-events.c
-copyright
-cat <<EOF
-
-#include "defs.h"
-#include "gdb-events.h"
-#include "gdbcmd.h"
-
-static struct gdb_events null_event_hooks;
-static struct gdb_events queue_event_hooks;
-static struct gdb_events *current_event_hooks = &null_event_hooks;
-
-int gdb_events_debug;
-static void
-show_gdb_events_debug (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- fprintf_filtered (file, _("Event debugging is %s.\\n"), value);
-}
-
-EOF
-
-# function bodies
-function_list | while eval read $read
-do
- case "${class}" in
- "*" ) continue ;;
- "?" )
-cat <<EOF
-
-int
-${function}_event_p (${formal})
-{
- return current_event_hooks->${function};
-}
-
-${returntype}
-${function}_event (${formal})
-{
- return current_events->${function} (${actual});
-}
-EOF
- ;;
- "f" )
-cat <<EOF
-
-void
-${function}_event (${formal})
-{
- if (gdb_events_debug)
- fprintf_unfiltered (gdb_stdlog, "${function}_event\n");
- if (!current_event_hooks->${function})
- return;
- current_event_hooks->${function} (${actual});
-}
-EOF
- ;;
- esac
-done
-
-# Set hooks function
-echo ""
-cat <<EOF
-struct gdb_events *
-deprecated_set_gdb_event_hooks (struct gdb_events *vector)
-{
- struct gdb_events *old_events = current_event_hooks;
- if (vector == NULL)
- current_event_hooks = &queue_event_hooks;
- else
- current_event_hooks = vector;
- return old_events;
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "*" )
- echo " ${function}_event = hooks->${function};"
- ;;
- esac
-done
-cat <<EOF
-}
-EOF
-
-# Clear hooks function
-echo ""
-cat <<EOF
-void
-clear_gdb_event_hooks (void)
-{
- deprecated_set_gdb_event_hooks (&null_event_hooks);
-}
-EOF
-
-# event type
-echo ""
-cat <<EOF
-enum gdb_event
-{
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo " ${function},"
- ;;
- esac
-done
-cat <<EOF
- nr_gdb_events
-};
-EOF
-
-# event data
-echo ""
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- if test ${actual}
- then
- echo "struct ${function}"
- echo " {"
- echo " `echo ${formal} | tr '[,]' '[;]'`;"
- echo " };"
- echo ""
- fi
- ;;
- esac
-done
-
-# event queue
-cat <<EOF
-struct event
- {
- enum gdb_event type;
- struct event *next;
- union
- {
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- if test ${actual}
- then
- echo " struct ${function} ${function};"
- fi
- ;;
- esac
-done
-cat <<EOF
- }
- data;
- };
-struct event *pending_events;
-struct event *delivering_events;
-EOF
-
-# append
-echo ""
-cat <<EOF
-static void
-append (struct event *new_event)
-{
- struct event **event = &pending_events;
- while ((*event) != NULL)
- event = &((*event)->next);
- (*event) = new_event;
- (*event)->next = NULL;
-}
-EOF
-
-# schedule a given event
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo ""
- echo "static void"
- echo "queue_${function} (${formal})"
- echo "{"
- echo " struct event *event = XMALLOC (struct event);"
- echo " event->type = ${function};"
- for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do
- echo " event->data.${function}.${arg} = ${arg};"
- done
- echo " append (event);"
- echo "}"
- ;;
- esac
-done
-
-# deliver
-echo ""
-cat <<EOF
-void
-gdb_events_deliver (struct gdb_events *vector)
-{
- /* Just zap any events left around from last time. */
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- delivering_events = event->next;
- xfree (event);
- }
- /* Process any pending events. Because one of the deliveries could
- bail out we move everything off of the pending queue onto an
- in-progress queue where it can, later, be cleaned up if
- necessary. */
- delivering_events = pending_events;
- pending_events = NULL;
- while (delivering_events != NULL)
- {
- struct event *event = delivering_events;
- switch (event->type)
- {
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo " case ${function}:"
- 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
-done
-cat <<EOF
- }
- delivering_events = event->next;
- xfree (event);
- }
-}
-EOF
-
-# Finally the initialization
-echo ""
-cat <<EOF
-void _initialize_gdb_events (void);
-void
-_initialize_gdb_events (void)
-{
- struct cmd_list_element *c;
-EOF
-function_list | while eval read $read
-do
- case "${class}" in
- "f" )
- echo " queue_event_hooks.${function} = queue_${function};"
- ;;
- esac
-done
-cat <<EOF
-
- add_setshow_zinteger_cmd ("event", class_maintenance,
- &gdb_events_debug, _("\\
-Set event debugging."), _("\\
-Show event debugging."), _("\\
-When non-zero, event/notify debugging is enabled."),
- NULL,
- show_gdb_events_debug,
- &setdebuglist, &showdebuglist);
-}
-EOF
-
-# close things off
-exec 1>&2
-#../move-if-change new-gdb-events.c gdb-events.c
-# Replace any leading spaces with tabs
-sed < new-gdb-events.c > tmp-gdb-events.c \
- -e 's/\( \)* /\1 /g'
-mv tmp-gdb-events.c new-gdb-events.c
-# Move if changed?
-if test -r gdb-events.c
-then
- diff -c gdb-events.c new-gdb-events.c
- if [ $? = 1 ]
- then
- echo "gdb-events.c changed? cp new-gdb-events.c gdb-events.c" 1>&2
- fi
-else
- echo "File missing? mv new-gdb-events.c gdb-events.c" 1>&2
-fi
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.470
diff -u -r1.470 gdbarch.sh
--- gdbarch.sh 11 Jun 2008 22:03:49 -0000 1.470
+++ gdbarch.sh 22 Jul 2008 00:34:55 -0000
@@ -1130,10 +1130,10 @@
#include "gdb_assert.h"
#include "gdb_string.h"
-#include "gdb-events.h"
#include "reggroups.h"
#include "osabi.h"
#include "gdb_obstack.h"
+#include "observer.h"
/* Static function declarations */
@@ -2018,7 +2018,7 @@
gdb_assert (current_gdbarch != NULL);
gdb_assert (new_gdbarch->initialized_p);
current_gdbarch = new_gdbarch;
- architecture_changed_event ();
+ observer_notify_architecture_changed (new_gdbarch);
reinit_frame_cache ();
}
Index: interps.c
===================================================================
RCS file: /cvs/src/src/gdb/interps.c,v
retrieving revision 1.26
diff -u -r1.26 interps.c
--- interps.c 12 Jul 2008 19:25:42 -0000 1.26
+++ interps.c 22 Jul 2008 00:34:55 -0000
@@ -37,7 +37,6 @@
#include "interps.h"
#include "completer.h"
#include "gdb_string.h"
-#include "gdb-events.h"
#include "gdb_assert.h"
#include "top.h" /* For command_loop. */
#include "exceptions.h"
@@ -352,7 +351,6 @@
deprecated_error_hook = 0;
deprecated_error_begin_hook = 0;
deprecated_command_loop_hook = 0;
- clear_gdb_event_hooks ();
}
/* This is a lazy init routine, called the first time the interpreter
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.106
diff -u -r1.106 tracepoint.c
--- tracepoint.c 27 May 2008 19:29:51 -0000 1.106
+++ tracepoint.c 22 Jul 2008 00:34:56 -0000
@@ -34,9 +34,9 @@
#include "linespec.h"
#include "regcache.h"
#include "completer.h"
-#include "gdb-events.h"
#include "block.h"
#include "dictionary.h"
+#include "observer.h"
#include "ax.h"
#include "ax-gdb.h"
@@ -570,11 +570,11 @@
{
case enable_op:
t->enabled_p = 1;
- tracepoint_modify_event (t->number);
+ observer_notify_tracepoint_modified (t->number);
break;
case disable_op:
t->enabled_p = 0;
- tracepoint_modify_event (t->number);
+ observer_notify_tracepoint_modified (t->number);
break;
case delete_op:
if (tracepoint_chain == t)
@@ -587,7 +587,7 @@
break;
}
- tracepoint_delete_event (t->number);
+ observer_notify_tracepoint_deleted (t->number);
if (t->addr_string)
xfree (t->addr_string);
@@ -739,7 +739,7 @@
if (t1 == (struct tracepoint *) -1 || t1 == t2)
{
t2->pass_count = count;
- tracepoint_modify_event (t2->number);
+ observer_notify_tracepoint_modified (t2->number);
if (from_tty)
printf_filtered ("Setting tracepoint %d's passcount to %d\n",
t2->number, count);
Index: doc/observer.texi
===================================================================
RCS file: /cvs/src/src/gdb/doc/observer.texi,v
retrieving revision 1.17
diff -u -r1.17 observer.texi
--- doc/observer.texi 21 Jul 2008 16:47:11 -0000 1.17
+++ doc/observer.texi 22 Jul 2008 00:34:56 -0000
@@ -2,7 +2,7 @@
@c This file is part of the GDB manual.
@c
-@c Copyright (C) 2003, 2004, 2005, 2006
+@c Copyright (C) 2003, 2004, 2005, 2006, 2008
@c Free Software Foundation, Inc.
@c
@c See the file gdbint.texinfo for copying conditions.
@@ -139,3 +139,39 @@
The target was resumed. The @var{ptid} parameter specifies which
thread was resume, and may be RESUME_ALL if all threads are resumed.
@end deftypefun
+
+@deftypefun void breakpoint_created (int @var{bpnum})
+A new breakpoint has been created. The argument @var{bpnum} is the
+number of the newly-created breakpoint.
+@end deftypefun
+
+@deftypefun void breakpoint_deleted (int @var{bpnum})
+A breakpoint has been destroyed. The argument @var{bpnum} is the
+number of the newly-destroyed breakpoint.
+@end deftypefun
+
+@deftypefun void breakpoint_modified (int @var{bpnum})
+A breakpoint has been modified in some way. The argument @var{bpnum}
+is the number of the modified breakpoint.
+@end deftypefun
+
+@deftypefun void tracepoint_created (int @var{tpnum})
+A new tracepoint has been created. The argument @var{tpnum} is the
+number of the newly-created tracepoint.
+@end deftypefun
+
+@deftypefun void tracepoint_deleted (int @var{tpnum})
+A tracepoint has been destroyed. The argument @var{tpnum} is the
+number of the newly-destroyed tracepoint.
+@end deftypefun
+
+@deftypefun void tracepoint_modified (int @var{tpnum})
+A tracepoint has been modified in some way. The argument @var{tpnum}
+is the number of the modified tracepoint.
+@end deftypefun
+
+@deftypefun void architecture_changed (struct gdbarch *@var{newarch})
+The current architecture has changed. The argument @var{newarch} is
+a pointer to the new architecture.
+@end deftypefun
+
Index: gdbtk/generic/gdbtk-bp.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v
retrieving revision 1.26
diff -u -r1.26 gdbtk-bp.c
--- gdbtk/generic/gdbtk-bp.c 23 Dec 2005 18:23:15 -0000 1.26
+++ gdbtk/generic/gdbtk-bp.c 22 Jul 2008 00:34:56 -0000
@@ -1,5 +1,5 @@
/* Tcl/Tk command definitions for Insight - Breakpoints.
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2008 Free Software Foundation, Inc.
This file is part of GDB.
@@ -29,6 +29,7 @@
#include <tcl.h>
#include "gdbtk.h"
#include "gdbtk-cmds.h"
+#include "observer.h"
/* From breakpoint.c */
extern struct breakpoint *breakpoint_chain;
@@ -541,7 +542,7 @@
free(buf);
/* now send notification command back to GUI */
- breakpoint_create_event (b->number);
+ observer_notify_breakpoint_created (b->number);
return TCL_OK;
}
@@ -609,7 +610,7 @@
b->addr_string = xstrdup (saddr);
/* now send notification command back to GUI */
- breakpoint_create_event (b->number);
+ observer_notify_breakpoint_created (b->number);
return TCL_OK;
}
\f
Index: gdbtk/generic/gdbtk-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
retrieving revision 1.43
diff -u -r1.43 gdbtk-hooks.c
--- gdbtk/generic/gdbtk-hooks.c 14 Jul 2008 23:43:36 -0000 1.43
+++ gdbtk/generic/gdbtk-hooks.c 22 Jul 2008 00:34:56 -0000
@@ -29,10 +29,10 @@
#include "gdbcore.h"
#include "tracepoint.h"
#include "demangle.h"
-#include "gdb-events.h"
#include "top.h"
#include "annotate.h"
#include "cli/cli-decode.h"
+#include "observer.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
@@ -75,7 +75,7 @@
extern void gdbtk_delete_tracepoint (int);
extern void gdbtk_modify_tracepoint (int);
-static void gdbtk_architecture_changed (void);
+static void gdbtk_architecture_changed (struct gdbarch *);
static void gdbtk_trace_find (char *arg, int from_tty);
static void gdbtk_trace_start_stop (int, int);
static void gdbtk_attach (void);
@@ -121,17 +121,14 @@
void
gdbtk_add_hooks (void)
{
- static struct gdb_events handlers;
-
- /* Gdb event handlers */
- handlers.breakpoint_create = gdbtk_create_breakpoint;
- handlers.breakpoint_modify = gdbtk_modify_breakpoint;
- handlers.breakpoint_delete = gdbtk_delete_breakpoint;
- handlers.tracepoint_create = gdbtk_create_tracepoint;
- handlers.tracepoint_modify = gdbtk_modify_tracepoint;
- handlers.tracepoint_delete = gdbtk_delete_tracepoint;
- handlers.architecture_changed = gdbtk_architecture_changed;
- deprecated_set_gdb_event_hooks (&handlers);
+ /* Gdb observers */
+ observer_attach_breakpoint_created (gdbtk_create_breakpoint);
+ observer_attach_breakpoint_modified (gdbtk_modify_breakpoint);
+ observer_attach_breakpoint_deleted (gdbtk_delete_breakpoint);
+ observer_attach_tracepoint_created (gdbtk_create_tracepoint);
+ observer_attach_tracepoint_modified (gdbtk_modify_tracepoint);
+ observer_attach_tracepoint_deleted (gdbtk_delete_tracepoint);
+ observer_attach_architecture_changed (gdbtk_architecture_changed);
/* Hooks */
deprecated_call_command_hook = gdbtk_call_command;
@@ -835,7 +832,7 @@
/* Called from gdbarch_update_p whenever the architecture changes. */
static void
-gdbtk_architecture_changed (void)
+gdbtk_architecture_changed (struct gdbarch *ignore)
{
Tcl_Eval (gdbtk_interp, "gdbtk_tcl_architecture_changed");
}
Index: mi/mi-cmd-break.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-break.c,v
retrieving revision 1.20
diff -u -r1.20 mi-cmd-break.c
--- mi/mi-cmd-break.c 25 Jun 2008 15:15:41 -0000 1.20
+++ mi/mi-cmd-break.c 22 Jul 2008 00:34:56 -0000
@@ -24,32 +24,32 @@
#include "breakpoint.h"
#include "gdb_string.h"
#include "mi-getopt.h"
-#include "gdb-events.h"
#include "gdb.h"
#include "exceptions.h"
+#include "observer.h"
enum
{
FROM_TTY = 0
};
-/* Output a single breakpoint. */
+/* True if MI breakpoint observers have been registered. */
+
+static int mi_breakpoint_observers_installed;
+
+/* Control whether breakpoint_notify may act. */
+
+static int mi_can_breakpoint_notify;
+
+/* Output a single breakpoint, when allowed. */
static void
breakpoint_notify (int b)
{
- gdb_breakpoint_query (uiout, b, NULL);
+ if (mi_can_breakpoint_notify)
+ gdb_breakpoint_query (uiout, b, NULL);
}
-
-struct gdb_events breakpoint_hooks =
-{
- breakpoint_notify,
- breakpoint_notify,
- breakpoint_notify,
-};
-
-
enum bp_type
{
REG_BP,
@@ -132,7 +132,15 @@
address = argv[optind];
/* Now we have what we need, let's insert the breakpoint! */
- old_hooks = deprecated_set_gdb_event_hooks (&breakpoint_hooks);
+ if (! mi_breakpoint_observers_installed)
+ {
+ observer_attach_breakpoint_created (breakpoint_notify);
+ observer_attach_breakpoint_modified (breakpoint_notify);
+ observer_attach_breakpoint_deleted (breakpoint_notify);
+ mi_breakpoint_observers_installed = 1;
+ }
+
+ mi_can_breakpoint_notify = 1;
/* Make sure we restore hooks even if exception is thrown. */
TRY_CATCH (e, RETURN_MASK_ALL)
{
@@ -163,7 +171,7 @@
_("mi_cmd_break_insert: Bad switch."));
}
}
- deprecated_set_gdb_event_hooks (old_hooks);
+ mi_can_breakpoint_notify = 0;
if (e.reason < 0)
throw_exception (e);
}
Index: tui/tui-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v
retrieving revision 1.37
diff -u -r1.37 tui-hooks.c
--- tui/tui-hooks.c 1 Jan 2008 22:53:22 -0000 1.37
+++ tui/tui-hooks.c 22 Jul 2008 00:34:56 -0000
@@ -31,7 +31,6 @@
#include "event-top.h"
#include "frame.h"
#include "breakpoint.h"
-#include "gdb-events.h"
#include "ui-out.h"
#include "top.h"
#include "observer.h"
@@ -157,23 +156,6 @@
tui_update_all_breakpoint_info ();
}
-static void
-tui_event_default (int number)
-{
- ;
-}
-
-static struct gdb_events *tui_old_event_hooks;
-
-static struct gdb_events tui_event_hooks = {
- tui_event_create_breakpoint,
- tui_event_delete_breakpoint,
- tui_event_modify_breakpoint,
- tui_event_default,
- tui_event_default,
- tui_event_default
-};
-
/* Called when going to wait for the target.
Leave curses mode and setup program mode. */
static ptid_t
@@ -262,6 +244,11 @@
tui_display_main ();
}
+/* Observers created when installing TUI hooks. */
+static struct observer *tui_bp_created_observer;
+static struct observer *tui_bp_deleted_observer;
+static struct observer *tui_bp_modified_observer;
+
/* Install the TUI specific hooks. */
void
tui_install_hooks (void)
@@ -273,7 +260,12 @@
deprecated_query_hook = tui_query_hook;
/* Install the event hooks. */
- tui_old_event_hooks = deprecated_set_gdb_event_hooks (&tui_event_hooks);
+ tui_bp_created_observer
+ = observer_attach_breakpoint_created (tui_event_create_breakpoint);
+ tui_bp_deleted_observer
+ = observer_attach_breakpoint_deleted (tui_event_delete_breakpoint);
+ tui_bp_modified_observer
+ = observer_attach_breakpoint_modified (tui_event_modify_breakpoint);
deprecated_register_changed_hook = tui_register_changed_hook;
deprecated_detach_hook = tui_detach_hook;
@@ -290,8 +282,13 @@
deprecated_register_changed_hook = 0;
deprecated_detach_hook = 0;
- /* Restore the previous event hooks. */
- deprecated_set_gdb_event_hooks (tui_old_event_hooks);
+ /* Remove our observers. */
+ observer_detach_breakpoint_created (tui_bp_created_observer);
+ tui_bp_created_observer = NULL;
+ observer_detach_breakpoint_deleted (tui_bp_deleted_observer);
+ tui_bp_deleted_observer = NULL;
+ observer_detach_breakpoint_modified (tui_bp_modified_observer);
+ tui_bp_modified_observer = NULL;
}
void _initialize_tui_hooks (void);
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-22 0:56 ` RFA: Remove gdb-events Tom Tromey
@ 2008-07-25 16:11 ` Tom Tromey
0 siblings, 0 replies; 29+ messages in thread
From: Tom Tromey @ 2008-07-25 16:11 UTC (permalink / raw)
To: Joel Brobecker; +Cc: vladimir, gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> Here is the follow-up patch. I assume I need a final "OK" for this.
Joel approved this off-list, so I am checking it in.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-07-13 21:56 ` Tom Tromey
@ 2008-08-01 16:20 ` Tom Tromey
2008-08-01 16:33 ` Subdir ChangeLogs (was Re: RFA: Remove gdb-events) Stan Shebs
2008-08-01 17:40 ` RFA: Remove gdb-events Mark Kettenis
0 siblings, 2 replies; 29+ messages in thread
From: Tom Tromey @ 2008-08-01 16:20 UTC (permalink / raw)
To: Stan Shebs; +Cc: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> I'd like to propose changing this for gdb. I don't think merging is
Tom> even needed. Folks can always look in subdir ChangeLog.old...
Any comment on this?
The concrete proposal is:
* Rename gdb/doc/ChangeLog -> gdb/doc/ChangeLog.old
* Rename gdb/testsuite/ChangeLog -> gdb/testsuite/ChangeLog.old
... and all future patches in these areas will just use gdb/ChangeLog.
The rationale is that many patches span these directories, so keeping
their ChangeLog entries together makes sense. On the flip side,
keeping them separate does not seem to add much value -- it is just
more work when preparing a patch.
Insight-related ChangeLogs would remain untouched.
I don't have an opinion about gdbserver/ChangeLog.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Subdir ChangeLogs (was Re: RFA: Remove gdb-events)
2008-08-01 16:20 ` Tom Tromey
@ 2008-08-01 16:33 ` Stan Shebs
2008-08-01 17:10 ` Subdir ChangeLogs Tom Tromey
2008-08-01 17:40 ` RFA: Remove gdb-events Mark Kettenis
1 sibling, 1 reply; 29+ messages in thread
From: Stan Shebs @ 2008-08-01 16:33 UTC (permalink / raw)
To: Tom Tromey; +Cc: Stan Shebs, gdb-patches
Tom Tromey wrote:
>>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
>>>>>>
>
> Tom> I'd like to propose changing this for gdb. I don't think merging is
> Tom> even needed. Folks can always look in subdir ChangeLog.old...
>
> Any comment on this?
>
I thought I did...
> The concrete proposal is:
>
> * Rename gdb/doc/ChangeLog -> gdb/doc/ChangeLog.old
>
Yes.
> * Rename gdb/testsuite/ChangeLog -> gdb/testsuite/ChangeLog.old
>
I don't like this idea so much. Partly because testsuite is a whole
complex of subdirs, partly because I still think of testsuite as a
separate "product" even though it hasn't been packaged separately in
years, but basically a non-rational reaction. But if everybody else
wants this, that's fine.
> ... and all future patches in these areas will just use gdb/ChangeLog.
>
Stan
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 16:33 ` Subdir ChangeLogs (was Re: RFA: Remove gdb-events) Stan Shebs
@ 2008-08-01 17:10 ` Tom Tromey
2008-08-01 17:27 ` Stan Shebs
2008-08-03 0:02 ` Michael Snyder
0 siblings, 2 replies; 29+ messages in thread
From: Tom Tromey @ 2008-08-01 17:10 UTC (permalink / raw)
To: Stan Shebs; +Cc: gdb-patches
>>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:
Tom> Any comment on this?
Stan> I thought I did...
Oops, sorry Stan.
Tom> The concrete proposal is:
Tom> * Rename gdb/doc/ChangeLog -> gdb/doc/ChangeLog.old
Stan> Yes.
Is that an official ok? Or just agreement?
Tom> * Rename gdb/testsuite/ChangeLog -> gdb/testsuite/ChangeLog.old
Stan> I don't like this idea so much. Partly because testsuite is a whole
Stan> complex of subdirs, partly because I still think of testsuite as a
Stan> separate "product" even though it hasn't been packaged separately in
Stan> years, but basically a non-rational reaction. But if everybody else
Stan> wants this, that's fine.
If it helps any, Classpath has many more directories than
gdb/testsuite, and a single ChangeLog works just fine there. It is
actually clearer this way, IMO, since related changes are grouped
together.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 17:10 ` Subdir ChangeLogs Tom Tromey
@ 2008-08-01 17:27 ` Stan Shebs
2008-08-01 17:54 ` Tom Tromey
2008-08-01 18:44 ` Eli Zaretskii
2008-08-03 0:02 ` Michael Snyder
1 sibling, 2 replies; 29+ messages in thread
From: Stan Shebs @ 2008-08-01 17:27 UTC (permalink / raw)
To: Tom Tromey; +Cc: Stan Shebs, gdb-patches
Tom Tromey wrote:
>>>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:
>>>>>>
>
> Tom> Any comment on this?
>
> Stan> I thought I did...
>
> Oops, sorry Stan.
>
> Tom> The concrete proposal is:
> Tom> * Rename gdb/doc/ChangeLog -> gdb/doc/ChangeLog.old
>
> Stan> Yes.
>
> Is that an official ok? Or just agreement?
>
Since it affects everybody's workflow, I'd like to see at least one more
opinion. Let's give it until the end of Monday, if nobody else responds,
then let's just go ahead and do it.
> Tom> * Rename gdb/testsuite/ChangeLog -> gdb/testsuite/ChangeLog.old
>
> Stan> I don't like this idea so much. Partly because testsuite is a whole
> Stan> complex of subdirs, partly because I still think of testsuite as a
> Stan> separate "product" even though it hasn't been packaged separately in
> Stan> years, but basically a non-rational reaction. But if everybody else
> Stan> wants this, that's fine.
>
> If it helps any, Classpath has many more directories than
> gdb/testsuite, and a single ChangeLog works just fine there. It is
> actually clearer this way, IMO, since related changes are grouped
> together.
>
I know I know, that's the rational viewpoint. :-) It does seem that most
of src/ and gcc/ continues to have separate testsuite ChangeLogs, is
that due to resistance or simply inertia?
Stan
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: RFA: Remove gdb-events
2008-08-01 16:20 ` Tom Tromey
2008-08-01 16:33 ` Subdir ChangeLogs (was Re: RFA: Remove gdb-events) Stan Shebs
@ 2008-08-01 17:40 ` Mark Kettenis
1 sibling, 0 replies; 29+ messages in thread
From: Mark Kettenis @ 2008-08-01 17:40 UTC (permalink / raw)
To: tromey; +Cc: stan, gdb-patches
> X-Spam-Check-By: sourceware.org
> Cc: gdb-patches@sources.redhat.com
> From: Tom Tromey <tromey@redhat.com>
> Reply-To: Tom Tromey <tromey@redhat.com>
> Date: Fri, 01 Aug 2008 10:20:18 -0600
> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm
> Sender: gdb-patches-owner@sourceware.org
> X-XS4ALL-DNSBL-Checked: mxdrop110.xs4all.nl checked 209.132.176.174 against DNS blacklists
> X-CNFS-Analysis: v=1.0 c=1 a=881O8E-6XdsA:10 a=2XsNsC2eOfWF1qdpl05llQ==:17
> a=qo2X1CjQWrMaJWK6xZoA:9 a=9A5clqTUE07V6g9w-5tw_btH0rQA:4
> a=jEp0ucaQiEUA:10 a=WcGY3-TIXCwA:10
> X-Virus-Scanned: by XS4ALL Virus Scanner
> X-XS4ALL-Spam-Score: 0.0 () none
> X-XS4ALL-Spam: NO
> Envelope-To: m.m.kettenis@xs4all.nl
> X-UIDL: 1217607658._smtp.mxdrop110.31168,S=3733
>
> >>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
>
> Tom> I'd like to propose changing this for gdb. I don't think merging is
> Tom> even needed. Folks can always look in subdir ChangeLog.old...
>
> Any comment on this?
>
> The concrete proposal is:
>
> * Rename gdb/doc/ChangeLog -> gdb/doc/ChangeLog.old
> * Rename gdb/testsuite/ChangeLog -> gdb/testsuite/ChangeLog.old
>
> ... and all future patches in these areas will just use gdb/ChangeLog.
>
> The rationale is that many patches span these directories, so keeping
> their ChangeLog entries together makes sense. On the flip side,
> keeping them separate does not seem to add much value -- it is just
> more work when preparing a patch.
While committing a testcase for bugs you fix is great, there is no
need to commit the testcase simultaniously with the fix. It is better
to actually commit the testcase as soon as the problem is known and
not wait until you have a fix.
Personally I like the fact that the testsuite Changelog is seperate.
It means I don't get distracted by testsuite changes when I'm looking
for code changes. And testsuite changes, which occur relatively
infrequent, don't get burried between lots of code changes.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 17:27 ` Stan Shebs
@ 2008-08-01 17:54 ` Tom Tromey
2008-08-01 18:44 ` Eli Zaretskii
1 sibling, 0 replies; 29+ messages in thread
From: Tom Tromey @ 2008-08-01 17:54 UTC (permalink / raw)
To: Stan Shebs; +Cc: Stan Shebs, gdb-patches
>>>>> "Stan" == Stan Shebs <stanshebs@earthlink.net> writes:
Stan> I know I know, that's the rational viewpoint. :-) It does seem that
Stan> most of src/ and gcc/ continues to have separate testsuite ChangeLogs,
Stan> is that due to resistance or simply inertia?
I assume inertia, but I don't really know.
Anyway, it is moot since Mark wants testsuite/ChangeLog.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 17:27 ` Stan Shebs
2008-08-01 17:54 ` Tom Tromey
@ 2008-08-01 18:44 ` Eli Zaretskii
2008-08-01 18:55 ` Tom Tromey
1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2008-08-01 18:44 UTC (permalink / raw)
To: Stan Shebs; +Cc: tromey, stan, gdb-patches
> Date: Fri, 01 Aug 2008 10:26:36 -0700
> From: Stan Shebs <stanshebs@earthlink.net>
> CC: Stan Shebs <stan@codesourcery.com>, gdb-patches@sources.redhat.com
>
> Tom Tromey wrote:
> >>>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:
> >>>>>>
> >
> > Tom> Any comment on this?
> >
> > Stan> I thought I did...
> >
> > Oops, sorry Stan.
> >
> > Tom> The concrete proposal is:
> > Tom> * Rename gdb/doc/ChangeLog -> gdb/doc/ChangeLog.old
> >
> > Stan> Yes.
> >
> > Is that an official ok? Or just agreement?
> >
> Since it affects everybody's workflow, I'd like to see at least one more
> opinion.
You asked for opinions, so here's mine: I don't really understand why
we'd want to do this. The only reason I heard so far was that it will
help when source and doc files are committed together. But people do
this all the time, and the CVS logs clearly show the entire changeset,
so I don't see the advantage.
Many other GNU projects have separate ChangeLog files for the
documentation. I have never heard any other project that I was
involved with merging them back into the source logs.
That said, I'm not going to fight against this if it is what everyone
else wants.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 18:44 ` Eli Zaretskii
@ 2008-08-01 18:55 ` Tom Tromey
2008-08-01 19:25 ` Eli Zaretskii
0 siblings, 1 reply; 29+ messages in thread
From: Tom Tromey @ 2008-08-01 18:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Stan Shebs, stan, gdb-patches
Eli> You asked for opinions, so here's mine: I don't really understand why
Eli> we'd want to do this. The only reason I heard so far was that it will
Eli> help when source and doc files are committed together.
It means less busy-work. Right now when I prepare a patch I usually
edit at least two ChangeLogs, sometimes three or four. Then I have to
redo that when re-applying the patch for checkin. And, then there is
more editing preparing the commit message.
Eli> But people do this all the time, and the CVS logs clearly show
Eli> the entire changeset, so I don't see the advantage.
Less manual editing.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 18:55 ` Tom Tromey
@ 2008-08-01 19:25 ` Eli Zaretskii
2008-08-01 19:33 ` Tom Tromey
0 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2008-08-01 19:25 UTC (permalink / raw)
To: Tom Tromey; +Cc: stanshebs, stan, gdb-patches
> Cc: Stan Shebs <stanshebs@earthlink.net>, stan@codesourcery.com, gdb-patches@sources.redhat.com
> From: Tom Tromey <tromey@redhat.com>
> Date: Fri, 01 Aug 2008 12:54:42 -0600
>
> Eli> You asked for opinions, so here's mine: I don't really understand why
> Eli> we'd want to do this. The only reason I heard so far was that it will
> Eli> help when source and doc files are committed together.
>
> It means less busy-work. Right now when I prepare a patch I usually
> edit at least two ChangeLogs, sometimes three or four.
Well, I use Emacs, which brings me to the right ChangeLog
automagically. Once I'm in the right file, the rest doesn't matter,
since I need to write the text for each entry anyway.
> Then I have to redo that when re-applying the patch for checkin.
> And, then there is more editing preparing the commit message.
Looks like your tools are not set up in an optimal way. For example,
the commit messages are usually just copies of the log entries, so
it's just copy-paste. How hard can that be?
But as I said: I'm not going to fight against this.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 19:25 ` Eli Zaretskii
@ 2008-08-01 19:33 ` Tom Tromey
2008-08-01 20:11 ` Thiago Jung Bauermann
2008-08-02 7:13 ` Eli Zaretskii
0 siblings, 2 replies; 29+ messages in thread
From: Tom Tromey @ 2008-08-01 19:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: stanshebs, stan, gdb-patches
Eli> Well, I use Emacs, which brings me to the right ChangeLog
Eli> automagically. Once I'm in the right file, the rest doesn't matter,
Eli> since I need to write the text for each entry anyway.
Right. I use Emacs too.
But I am talking about pulling patches out of the tree and putting
them back in after updating. How are you doing this?
>> Then I have to redo that when re-applying the patch for checkin.
>> And, then there is more editing preparing the commit message.
Eli> Looks like your tools are not set up in an optimal way. For example,
Eli> the commit messages are usually just copies of the log entries, so
Eli> it's just copy-paste. How hard can that be?
Sigh. It is not much work, you know that. IMO, though, it is merely
busy-work without purpose.
But, message received -- I'm the only one who wants this.
Consider it dropped. I will work it out my own.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 19:33 ` Tom Tromey
@ 2008-08-01 20:11 ` Thiago Jung Bauermann
2008-08-02 7:13 ` Eli Zaretskii
1 sibling, 0 replies; 29+ messages in thread
From: Thiago Jung Bauermann @ 2008-08-01 20:11 UTC (permalink / raw)
To: Tom Tromey; +Cc: Eli Zaretskii, stanshebs, stan, gdb-patches
On Fri, 2008-08-01 at 13:33 -0600, Tom Tromey wrote:
> Sigh. It is not much work, you know that. IMO, though, it is merely
> busy-work without purpose.
>
> But, message received -- I'm the only one who wants this.
> Consider it dropped. I will work it out my own.
Sorry, I should have chimed in earlier. I also think this is a good
idea.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 19:33 ` Tom Tromey
2008-08-01 20:11 ` Thiago Jung Bauermann
@ 2008-08-02 7:13 ` Eli Zaretskii
2008-08-02 16:52 ` Tom Tromey
1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2008-08-02 7:13 UTC (permalink / raw)
To: Tom Tromey; +Cc: stanshebs, stan, gdb-patches
> Cc: stanshebs@earthlink.net, stan@codesourcery.com, gdb-patches@sources.redhat.com
> From: Tom Tromey <tromey@redhat.com>
> Date: Fri, 01 Aug 2008 13:33:37 -0600
>
> But I am talking about pulling patches out of the tree and putting
> them back in after updating. How are you doing this?
I make a diffs file and apply it after updating. The additions to
ChangeLog files need not be changed, except for the date.
> But, message received -- I'm the only one who wants this.
No, that wasn't my message. My message was that I won't object if the
decision was to join these ChangeLog files, although I myself don't
see the need.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-02 7:13 ` Eli Zaretskii
@ 2008-08-02 16:52 ` Tom Tromey
2008-08-02 17:28 ` Eli Zaretskii
2008-08-02 20:24 ` Thiago Jung Bauermann
0 siblings, 2 replies; 29+ messages in thread
From: Tom Tromey @ 2008-08-02 16:52 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: stanshebs, stan, gdb-patches
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
Tom> But I am talking about pulling patches out of the tree and putting
Tom> them back in after updating. How are you doing this?
Eli> I make a diffs file and apply it after updating. The additions to
Eli> ChangeLog files need not be changed, except for the date.
This is great for one patch.
But how do you do it when you have nine patches? I think that is my
current backlog.
Making a new tree for each patch seems like a pain to manage. So,
I've been swapping them in and out. But that is also a pain, for the
reasons I mentioned.
Keeping multiple patches in one working tree is also not an option.
Most of my patches seem to overlap; many of them touch Makefile.in at
least.
Tom
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-02 16:52 ` Tom Tromey
@ 2008-08-02 17:28 ` Eli Zaretskii
2008-08-02 20:24 ` Thiago Jung Bauermann
1 sibling, 0 replies; 29+ messages in thread
From: Eli Zaretskii @ 2008-08-02 17:28 UTC (permalink / raw)
To: Tom Tromey; +Cc: stanshebs, stan, gdb-patches
> Cc: stanshebs@earthlink.net, stan@codesourcery.com, gdb-patches@sources.redhat.com
> From: Tom Tromey <tromey@redhat.com>
> Date: Sat, 02 Aug 2008 10:51:57 -0600
>
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
>
> Tom> But I am talking about pulling patches out of the tree and putting
> Tom> them back in after updating. How are you doing this?
>
> Eli> I make a diffs file and apply it after updating. The additions to
> Eli> ChangeLog files need not be changed, except for the date.
>
> This is great for one patch.
> But how do you do it when you have nine patches?
I generate a separate diffs file for each one of them. Their dates
give me a hint in which order to apply them, when the time comes.
> Keeping multiple patches in one working tree is also not an option.
> Most of my patches seem to overlap; many of them touch Makefile.in at
> least.
If all the patches are accepted, I see no problem. If only some are
accepted, and the changes are in overlapping regions, you are out of
luck. But I don't see how merging doc/ChangeLog will help here.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-02 16:52 ` Tom Tromey
2008-08-02 17:28 ` Eli Zaretskii
@ 2008-08-02 20:24 ` Thiago Jung Bauermann
1 sibling, 0 replies; 29+ messages in thread
From: Thiago Jung Bauermann @ 2008-08-02 20:24 UTC (permalink / raw)
To: Tom Tromey; +Cc: Eli Zaretskii, stanshebs, stan, gdb-patches
On Sat, 2008-08-02 at 10:51 -0600, Tom Tromey wrote:
> Most of my patches seem to overlap; many of them touch Makefile.in at
> least.
Because each patch has to update dependencies in Makefile.in, I figure.
This is one more reason to seriously consider your patch which
eliminates the need for manual dependency tracking.
This is also a problem with my maintaining of 12 patches for Python
scripting support...
I guess I need to reply a '+1' to that thread.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Subdir ChangeLogs
2008-08-01 17:10 ` Subdir ChangeLogs Tom Tromey
2008-08-01 17:27 ` Stan Shebs
@ 2008-08-03 0:02 ` Michael Snyder
1 sibling, 0 replies; 29+ messages in thread
From: Michael Snyder @ 2008-08-03 0:02 UTC (permalink / raw)
To: Tom Tromey; +Cc: Stan Shebs, gdb-patches
On Fri, 2008-08-01 at 11:10 -0600, Tom Tromey wrote:
> >>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:
>
> Tom> Any comment on this?
>
> Stan> I thought I did...
>
> Oops, sorry Stan.
>
> Tom> The concrete proposal is:
> Tom> * Rename gdb/doc/ChangeLog -> gdb/doc/ChangeLog.old
>
> Stan> Yes.
>
> Is that an official ok? Or just agreement?
Call it agreement, because I don't think we have consensus.
I rather liked Mark's arguments (testsuite changes would
both clutter and get lost in the main changelog).
Just look at the fact that we have "forked" the changelog
every year for the last N years, while the testsuite changelog
has never needed to be forked.
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2008-08-03 0:02 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-13 0:16 RFA: Remove gdb-events Tom Tromey
2008-07-13 3:26 ` Stan Shebs
2008-07-13 21:56 ` Tom Tromey
2008-08-01 16:20 ` Tom Tromey
2008-08-01 16:33 ` Subdir ChangeLogs (was Re: RFA: Remove gdb-events) Stan Shebs
2008-08-01 17:10 ` Subdir ChangeLogs Tom Tromey
2008-08-01 17:27 ` Stan Shebs
2008-08-01 17:54 ` Tom Tromey
2008-08-01 18:44 ` Eli Zaretskii
2008-08-01 18:55 ` Tom Tromey
2008-08-01 19:25 ` Eli Zaretskii
2008-08-01 19:33 ` Tom Tromey
2008-08-01 20:11 ` Thiago Jung Bauermann
2008-08-02 7:13 ` Eli Zaretskii
2008-08-02 16:52 ` Tom Tromey
2008-08-02 17:28 ` Eli Zaretskii
2008-08-02 20:24 ` Thiago Jung Bauermann
2008-08-03 0:02 ` Michael Snyder
2008-08-01 17:40 ` RFA: Remove gdb-events Mark Kettenis
2008-07-14 17:10 ` Joel Brobecker
2008-07-14 20:33 ` Tom Tromey
2008-07-15 6:54 ` Joel Brobecker
2008-07-17 23:41 ` Tom Tromey
2008-07-21 16:54 ` GDB/MI PING (was: "Re: RFA: Remove gdb-events") Joel Brobecker
2008-07-22 0:56 ` RFA: Remove gdb-events Tom Tromey
2008-07-25 16:11 ` Tom Tromey
2008-07-20 11:46 ` Eli Zaretskii
2008-07-21 17:13 ` Vladimir Prus
2008-07-22 0:32 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox