2003-03-18 18:44:23 +01:00
|
|
|
@c -*-texinfo-*-
|
2006-05-10 20:49:08 +02:00
|
|
|
|
|
|
|
@c This file is part of the GDB manual.
|
|
|
|
@c
|
2012-01-04 09:17:56 +01:00
|
|
|
@c Copyright (C) 2003-2006, 2008-2012 Free Software Foundation, Inc.
|
2006-05-10 20:49:08 +02:00
|
|
|
@c
|
|
|
|
@c See the file gdbint.texinfo for copying conditions.
|
|
|
|
@c
|
|
|
|
@c Also, the @deftypefun lines from this file are processed into a
|
|
|
|
@c header file during the GDB build process. Permission is granted
|
|
|
|
@c to redistribute and/or modify those lines under the terms of the
|
|
|
|
@c GNU General Public License as published by the Free Software
|
2009-12-20 12:53:08 +01:00
|
|
|
@c Foundation; either version 3 of the License, or (at your option)
|
2006-05-10 20:49:08 +02:00
|
|
|
@c any later version.
|
|
|
|
|
2003-03-18 18:44:23 +01:00
|
|
|
@node GDB Observers
|
|
|
|
@appendix @value{GDBN} Currently available observers
|
|
|
|
|
|
|
|
@section Implementation rationale
|
|
|
|
@cindex observers implementation rationale
|
|
|
|
|
|
|
|
An @dfn{observer} is an entity which is interested in being notified
|
|
|
|
when GDB reaches certain states, or certain events occur in GDB.
|
|
|
|
The entity being observed is called the @dfn{subject}. To receive
|
|
|
|
notifications, the observer attaches a callback to the subject.
|
|
|
|
One subject can have several observers.
|
|
|
|
|
|
|
|
@file{observer.c} implements an internal generic low-level event
|
2003-04-03 17:14:48 +02:00
|
|
|
notification mechanism. This generic event notification mechanism is
|
2003-03-18 18:44:23 +01:00
|
|
|
then re-used to implement the exported high-level notification
|
|
|
|
management routines for all possible notifications.
|
|
|
|
|
|
|
|
The current implementation of the generic observer provides support
|
|
|
|
for contextual data. This contextual data is given to the subject
|
|
|
|
when attaching the callback. In return, the subject will provide
|
|
|
|
this contextual data back to the observer as a parameter of the
|
|
|
|
callback.
|
|
|
|
|
|
|
|
Note that the current support for the contextual data is only partial,
|
|
|
|
as it lacks a mechanism that would deallocate this data when the
|
|
|
|
callback is detached. This is not a problem so far, as this contextual
|
|
|
|
data is only used internally to hold a function pointer. Later on, if
|
|
|
|
a certain observer needs to provide support for user-level contextual
|
2003-04-03 17:14:48 +02:00
|
|
|
data, then the generic notification mechanism will need to be
|
2003-03-18 18:44:23 +01:00
|
|
|
enhanced to allow the observer to provide a routine to deallocate the
|
|
|
|
data when attaching the callback.
|
|
|
|
|
|
|
|
The observer implementation is also currently not reentrant.
|
|
|
|
In particular, it is therefore not possible to call the attach
|
|
|
|
or detach routines during a notification.
|
|
|
|
|
2004-05-08 00:51:55 +02:00
|
|
|
@section Debugging
|
|
|
|
Observer notifications can be traced using the command @samp{set debug
|
|
|
|
observer 1} (@pxref{Debugging Output, , Optional messages about
|
|
|
|
internal happenings, gdb, Debugging with @var{GDBN}}).
|
|
|
|
|
2003-03-18 18:44:23 +01:00
|
|
|
@section @code{normal_stop} Notifications
|
|
|
|
@cindex @code{normal_stop} observer
|
|
|
|
@cindex notification about inferior execution stop
|
|
|
|
|
2003-04-03 17:14:48 +02:00
|
|
|
@value{GDBN} notifies all @code{normal_stop} observers when the
|
|
|
|
inferior execution has just stopped, the associated messages and
|
|
|
|
annotations have been printed, and the control is about to be returned
|
2006-05-10 20:49:08 +02:00
|
|
|
to the user.
|
2003-04-03 17:14:48 +02:00
|
|
|
|
|
|
|
Note that the @code{normal_stop} notification is not emitted when
|
|
|
|
the execution stops due to a breakpoint, and this breakpoint has
|
|
|
|
a condition that is not met. If the breakpoint has any associated
|
|
|
|
commands list, the commands are executed after the notification
|
|
|
|
is emitted.
|
2003-03-18 18:44:23 +01:00
|
|
|
|
2004-04-15 16:29:21 +02:00
|
|
|
The following interfaces are available to manage observers:
|
2003-03-18 18:44:23 +01:00
|
|
|
|
2004-04-15 16:29:21 +02:00
|
|
|
@deftypefun extern struct observer *observer_attach_@var{event} (observer_@var{event}_ftype *@var{f})
|
|
|
|
Using the function @var{f}, create an observer that is notified when
|
2007-01-20 17:51:56 +01:00
|
|
|
ever @var{event} occurs, return the observer.
|
2003-03-18 18:44:23 +01:00
|
|
|
@end deftypefun
|
|
|
|
|
2004-04-15 16:29:21 +02:00
|
|
|
@deftypefun extern void observer_detach_@var{event} (struct observer *@var{observer});
|
2003-03-18 18:44:23 +01:00
|
|
|
Remove @var{observer} from the list of observers to be notified when
|
2004-04-15 16:29:21 +02:00
|
|
|
@var{event} occurs.
|
2003-03-18 18:44:23 +01:00
|
|
|
@end deftypefun
|
|
|
|
|
2004-04-15 16:29:21 +02:00
|
|
|
@deftypefun extern void observer_notify_@var{event} (void);
|
|
|
|
Send a notification to all @var{event} observers.
|
2003-03-18 18:44:23 +01:00
|
|
|
@end deftypefun
|
|
|
|
|
2004-04-15 16:29:21 +02:00
|
|
|
The following observable events are defined:
|
2003-03-18 18:44:23 +01:00
|
|
|
|
2009-02-14 16:24:44 +01:00
|
|
|
@deftypefun void normal_stop (struct bpstats *@var{bs}, int @var{print_frame})
|
|
|
|
The inferior has stopped for real. The @var{bs} argument describes
|
|
|
|
the breakpoints were are stopped at, if any. Second argument
|
|
|
|
@var{print_frame} non-zero means display the location where the
|
|
|
|
inferior has stopped.
|
2004-04-15 16:29:21 +02:00
|
|
|
@end deftypefun
|
2004-04-26 11:36:56 +02:00
|
|
|
|
|
|
|
@deftypefun void target_changed (struct target_ops *@var{target})
|
2004-04-30 09:38:50 +02:00
|
|
|
The target's register contents have changed.
|
2004-04-26 11:36:56 +02:00
|
|
|
@end deftypefun
|
2004-05-21 18:04:03 +02:00
|
|
|
|
2008-07-21 18:47:11 +02:00
|
|
|
@deftypefun void executable_changed (void)
|
2005-03-08 05:34:45 +01:00
|
|
|
The executable being debugged by GDB has changed: The user decided
|
|
|
|
to debug a different program, or the program he was debugging has
|
|
|
|
been modified since being loaded by the debugger (by being recompiled,
|
|
|
|
for instance).
|
|
|
|
@end deftypefun
|
|
|
|
|
2004-05-21 18:04:03 +02:00
|
|
|
@deftypefun void inferior_created (struct target_ops *@var{objfile}, int @var{from_tty})
|
|
|
|
@value{GDBN} has just connected to an inferior. For @samp{run},
|
|
|
|
@value{GDBN} calls this observer while the inferior is still stopped
|
|
|
|
at the entry-point instruction. For @samp{attach} and @samp{core},
|
|
|
|
@value{GDBN} calls this observer immediately after connecting to the
|
|
|
|
inferior, and before any information on the inferior has been printed.
|
|
|
|
@end deftypefun
|
2004-09-01 19:59:37 +02:00
|
|
|
|
2005-01-12 21:48:08 +01:00
|
|
|
@deftypefun void solib_loaded (struct so_list *@var{solib})
|
|
|
|
The shared library specified by @var{solib} has been loaded. Note that
|
|
|
|
when @value{GDBN} calls this observer, the library's symbols probably
|
|
|
|
haven't been loaded yet.
|
2004-09-01 19:59:37 +02:00
|
|
|
@end deftypefun
|
|
|
|
|
2005-01-12 21:48:08 +01:00
|
|
|
@deftypefun void solib_unloaded (struct so_list *@var{solib})
|
|
|
|
The shared library specified by @var{solib} has been unloaded.
|
2009-09-24 19:49:56 +02:00
|
|
|
Note that when @value{GDBN} calls this observer, the library's
|
|
|
|
symbols have not been unloaded yet, and thus are still available.
|
2005-01-12 21:48:08 +01:00
|
|
|
@end deftypefun
|
2007-05-11 21:55:20 +02:00
|
|
|
|
|
|
|
@deftypefun void new_objfile (struct objfile *@var{objfile})
|
|
|
|
The symbol file specified by @var{objfile} has been loaded.
|
|
|
|
Called with @var{objfile} equal to @code{NULL} to indicate
|
|
|
|
previously loaded symbol table data has now been invalidated.
|
|
|
|
@end deftypefun
|
|
|
|
|
2008-03-14 18:21:08 +01:00
|
|
|
@deftypefun void new_thread (struct thread_info *@var{t})
|
|
|
|
The thread specified by @var{t} has been created.
|
|
|
|
@end deftypefun
|
|
|
|
|
2009-03-25 22:53:11 +01:00
|
|
|
@deftypefun void thread_exit (struct thread_info *@var{t}, int @var{silent})
|
|
|
|
The thread specified by @var{t} has exited. The @var{silent} argument
|
|
|
|
indicates that @value{GDBN} is removing the thread from its tables
|
|
|
|
without wanting to notify the user about it.
|
2008-05-03 17:10:42 +02:00
|
|
|
@end deftypefun
|
|
|
|
|
2008-10-24 01:11:21 +02:00
|
|
|
@deftypefun void thread_stop_requested (ptid_t @var{ptid})
|
|
|
|
An explicit stop request was issued to @var{ptid}. If @var{ptid}
|
|
|
|
equals @var{minus_one_ptid}, the request applied to all threads. If
|
|
|
|
@code{ptid_is_pid(ptid)} returns true, the request applied to all
|
|
|
|
threads of the process pointed at by @var{ptid}. Otherwise, the
|
|
|
|
request applied to the single thread pointed at by @var{ptid}.
|
|
|
|
@end deftypefun
|
|
|
|
|
2008-06-10 12:23:54 +02:00
|
|
|
@deftypefun void target_resumed (ptid_t @var{ptid})
|
|
|
|
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
|
gdb:
* 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.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* 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.
2008-07-25 18:12:03 +02:00
|
|
|
|
2009-03-22 19:06:07 +01:00
|
|
|
@deftypefun void about_to_proceed (void)
|
|
|
|
The target is about to be proceeded.
|
|
|
|
@end deftypefun
|
|
|
|
|
MI breakpoint notifications.
* annotate.c (breakpoint_changed): Adjust parameter type.
* breakpoint.c (set_breakpoint_condition): Adjust to change
in breakpoint_modified type.
(breakpoint_set_commands): Likewise.
(do_map_commands_command): Likewise.
(bpstat_check_breakpoint_conditions): Notify that breakpoint has
changed after bumping hit count.
(bpstat_stop_status): Likewise.
(print_one_breakpoint_location): Don't wrap in tuple here.
(print_one_breakpoint): Always print individual locations.
For locations, use unnamed tuple.
(disable_breakpoints_in_unloaded_shlib): Notify that breakpoint
has changed.
(create_catchpoint, create_syscall_event_catchpoint): Call
breakpoint_created obsever.
(mention): Don't call breakpoint_created observer.
(create_breakpoint_sal): Call breakpoint_created observer.
(create_breakpoint, watch_command_1): Likewise.
(create_ada_exception_breakpoint): Likewise.
(delete_breakpoint): Call breakpoint_deleted breakpoint.
(locations_are_equal): New.
(update_breakpoint_locations): If locations were changed, notify.
(set_ignore_count, disable_breakpoint, do_enable_breakpoint):
Call breakpoint_modified observer.
* mi/mi-cmd-break.c (breakpoint_notify): Adjust.
(mi_cmd_break_insert): Don't set observers for modify and delete.
* mi/mi-interp.c (mi_suppress_breakpoint_notifications): New.
(mi_breakpoint_created, mi_breakpoint_deleted)
(mi_breakpoint_modified): New.
(mi_interpreter_init): Hook the above.
* mi/mi-main.c (mi_cmd_execute): Disable breakpoint notifications
while -break-* commands are executing.
* mi/mi-main.h (mi_suppress_breakpoint_notifications): New.
* mi/mi-out.c (struct ui_out_data): New field original_buffer.
(mi_redirect): New.
(mi_ui_out_impl): Hook in mi_redirect.
(mi_field_skip): True to the name, skip the field, don't output
a field with an empty value.
* python/py-breakpoint.c (gdbpy_breakpoint_created)
(gdbpy_breakpoint_deleted): Adjust.
* tui/tui-hooks.c (tui_event_create_breakpoint)
(tui_event_delete_breakpoint, tui_event_modify_breakpoint): Adjust.
2011-04-27 12:17:39 +02:00
|
|
|
@deftypefun void breakpoint_created (struct breakpoint *@var{b})
|
|
|
|
A new breakpoint @var{b} has been created.
|
gdb:
* 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.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* 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.
2008-07-25 18:12:03 +02:00
|
|
|
@end deftypefun
|
|
|
|
|
MI breakpoint notifications.
* annotate.c (breakpoint_changed): Adjust parameter type.
* breakpoint.c (set_breakpoint_condition): Adjust to change
in breakpoint_modified type.
(breakpoint_set_commands): Likewise.
(do_map_commands_command): Likewise.
(bpstat_check_breakpoint_conditions): Notify that breakpoint has
changed after bumping hit count.
(bpstat_stop_status): Likewise.
(print_one_breakpoint_location): Don't wrap in tuple here.
(print_one_breakpoint): Always print individual locations.
For locations, use unnamed tuple.
(disable_breakpoints_in_unloaded_shlib): Notify that breakpoint
has changed.
(create_catchpoint, create_syscall_event_catchpoint): Call
breakpoint_created obsever.
(mention): Don't call breakpoint_created observer.
(create_breakpoint_sal): Call breakpoint_created observer.
(create_breakpoint, watch_command_1): Likewise.
(create_ada_exception_breakpoint): Likewise.
(delete_breakpoint): Call breakpoint_deleted breakpoint.
(locations_are_equal): New.
(update_breakpoint_locations): If locations were changed, notify.
(set_ignore_count, disable_breakpoint, do_enable_breakpoint):
Call breakpoint_modified observer.
* mi/mi-cmd-break.c (breakpoint_notify): Adjust.
(mi_cmd_break_insert): Don't set observers for modify and delete.
* mi/mi-interp.c (mi_suppress_breakpoint_notifications): New.
(mi_breakpoint_created, mi_breakpoint_deleted)
(mi_breakpoint_modified): New.
(mi_interpreter_init): Hook the above.
* mi/mi-main.c (mi_cmd_execute): Disable breakpoint notifications
while -break-* commands are executing.
* mi/mi-main.h (mi_suppress_breakpoint_notifications): New.
* mi/mi-out.c (struct ui_out_data): New field original_buffer.
(mi_redirect): New.
(mi_ui_out_impl): Hook in mi_redirect.
(mi_field_skip): True to the name, skip the field, don't output
a field with an empty value.
* python/py-breakpoint.c (gdbpy_breakpoint_created)
(gdbpy_breakpoint_deleted): Adjust.
* tui/tui-hooks.c (tui_event_create_breakpoint)
(tui_event_delete_breakpoint, tui_event_modify_breakpoint): Adjust.
2011-04-27 12:17:39 +02:00
|
|
|
@deftypefun void breakpoint_deleted (struct breakpoint *@var{b})
|
|
|
|
A breakpoint has been destroyed. The argument @var{b} is the
|
|
|
|
pointer to the destroyed breakpoint.
|
gdb:
* 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.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* 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.
2008-07-25 18:12:03 +02:00
|
|
|
@end deftypefun
|
|
|
|
|
MI breakpoint notifications.
* annotate.c (breakpoint_changed): Adjust parameter type.
* breakpoint.c (set_breakpoint_condition): Adjust to change
in breakpoint_modified type.
(breakpoint_set_commands): Likewise.
(do_map_commands_command): Likewise.
(bpstat_check_breakpoint_conditions): Notify that breakpoint has
changed after bumping hit count.
(bpstat_stop_status): Likewise.
(print_one_breakpoint_location): Don't wrap in tuple here.
(print_one_breakpoint): Always print individual locations.
For locations, use unnamed tuple.
(disable_breakpoints_in_unloaded_shlib): Notify that breakpoint
has changed.
(create_catchpoint, create_syscall_event_catchpoint): Call
breakpoint_created obsever.
(mention): Don't call breakpoint_created observer.
(create_breakpoint_sal): Call breakpoint_created observer.
(create_breakpoint, watch_command_1): Likewise.
(create_ada_exception_breakpoint): Likewise.
(delete_breakpoint): Call breakpoint_deleted breakpoint.
(locations_are_equal): New.
(update_breakpoint_locations): If locations were changed, notify.
(set_ignore_count, disable_breakpoint, do_enable_breakpoint):
Call breakpoint_modified observer.
* mi/mi-cmd-break.c (breakpoint_notify): Adjust.
(mi_cmd_break_insert): Don't set observers for modify and delete.
* mi/mi-interp.c (mi_suppress_breakpoint_notifications): New.
(mi_breakpoint_created, mi_breakpoint_deleted)
(mi_breakpoint_modified): New.
(mi_interpreter_init): Hook the above.
* mi/mi-main.c (mi_cmd_execute): Disable breakpoint notifications
while -break-* commands are executing.
* mi/mi-main.h (mi_suppress_breakpoint_notifications): New.
* mi/mi-out.c (struct ui_out_data): New field original_buffer.
(mi_redirect): New.
(mi_ui_out_impl): Hook in mi_redirect.
(mi_field_skip): True to the name, skip the field, don't output
a field with an empty value.
* python/py-breakpoint.c (gdbpy_breakpoint_created)
(gdbpy_breakpoint_deleted): Adjust.
* tui/tui-hooks.c (tui_event_create_breakpoint)
(tui_event_delete_breakpoint, tui_event_modify_breakpoint): Adjust.
2011-04-27 12:17:39 +02:00
|
|
|
@deftypefun void breakpoint_modified (struct breakpoint *@var{b})
|
|
|
|
A breakpoint has been modified in some way. The argument @var{b}
|
|
|
|
is the modified breakpoint.
|
gdb:
* 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.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* 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.
2008-07-25 18:12:03 +02:00
|
|
|
@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
|
|
|
|
|
2012-09-18 13:33:43 +02:00
|
|
|
@deftypefun void traceframe_changed (int @var{tfnum}, int @var{tpnum})
|
|
|
|
The trace frame is changed to @var{tfnum} (e.g., by using the
|
|
|
|
@code{tfind} command). If @var{tfnum} is negative, it means
|
|
|
|
@value{GDBN} resumes live debugging. The number of the tracepoint
|
|
|
|
associated with this traceframe is @var{tpnum}.
|
|
|
|
@end deftypefun
|
|
|
|
|
gdb:
* 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.
gdb/doc:
* observer.texi (GDB Observers): Document new observers:
breakpoint_created, breakpoint_deleted, breakpoint_modified,
tracepoint_created, tracepoint_deleted, tracepoint_modified,
architecture_changed.
gdb/gdbtk:
* 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.
2008-07-25 18:12:03 +02:00
|
|
|
@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
|
|
|
|
|
2008-08-19 00:35:17 +02:00
|
|
|
@deftypefun void thread_ptid_changed (ptid_t @var{old_ptid}, ptid_t @var{new_ptid})
|
|
|
|
The thread's ptid has changed. The @var{old_ptid} parameter specifies
|
|
|
|
the old value, and @var{new_ptid} specifies the new value.
|
|
|
|
@end deftypefun
|
2008-11-17 13:28:05 +01:00
|
|
|
|
Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
* inferior.c (add_inferior_silent): Notify inferior_added
observer.
(delete_inferior_1): Notify inferior_removed observer.
(exit_inferior_1): Pass inferior, not pid, to observer.
(inferior_appeared): Likewise.
(add_inferior_with_spaces): New.
(add_inferior_command): Use the above.
* inferior.h (delete_inferior_1, add_inferior_with_spaces):
Declare.
* inflow.c (inflow_inferior_exit): Likewise.
* jit.c (jit_inferior_exit_hook): Likewise.
* mi/mi-cmds.c (mi_cmds): Register add-inferior and
remove-inferior.
* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
(report_initial_inferior): New.
(mi_inferior_removed): Register the above. Make sure
inferior_added observer is called on the first inferior.
(mi_new_thread, mi_thread_exit): Thread group is now identified by
inferior number, not pid.
(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
affected.
* mi/mi-main.c (current_context): New.
(proceed_thread_callback): Use typed closure.
Proceed everything if pid is 0. Most implementation split into
(proceed_thread): ... this.
(run_one_inferior): New.
(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
Adjust for multiexec behaviour.
(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
(mi_cmd_execute): Handle the 'thread-group' option here.
Do some extra checks.
* mi-parse.c (mi_parse): Handle the --all and --thread-group
options.
* mi-parse.h (struct mi_parse): New fields all and thread_group.
2010-02-24 08:51:46 +01:00
|
|
|
@deftypefun void inferior_added (struct inferior *@var{inf})
|
|
|
|
The inferior @var{inf} has been added to the list of inferiors. At
|
|
|
|
this point, it might not be associated with any process.
|
2008-11-17 13:28:05 +01:00
|
|
|
@end deftypefun
|
|
|
|
|
Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
* inferior.c (add_inferior_silent): Notify inferior_added
observer.
(delete_inferior_1): Notify inferior_removed observer.
(exit_inferior_1): Pass inferior, not pid, to observer.
(inferior_appeared): Likewise.
(add_inferior_with_spaces): New.
(add_inferior_command): Use the above.
* inferior.h (delete_inferior_1, add_inferior_with_spaces):
Declare.
* inflow.c (inflow_inferior_exit): Likewise.
* jit.c (jit_inferior_exit_hook): Likewise.
* mi/mi-cmds.c (mi_cmds): Register add-inferior and
remove-inferior.
* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
(report_initial_inferior): New.
(mi_inferior_removed): Register the above. Make sure
inferior_added observer is called on the first inferior.
(mi_new_thread, mi_thread_exit): Thread group is now identified by
inferior number, not pid.
(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
affected.
* mi/mi-main.c (current_context): New.
(proceed_thread_callback): Use typed closure.
Proceed everything if pid is 0. Most implementation split into
(proceed_thread): ... this.
(run_one_inferior): New.
(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
Adjust for multiexec behaviour.
(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
(mi_cmd_execute): Handle the 'thread-group' option here.
Do some extra checks.
* mi-parse.c (mi_parse): Handle the --all and --thread-group
options.
* mi-parse.h (struct mi_parse): New fields all and thread_group.
2010-02-24 08:51:46 +01:00
|
|
|
@deftypefun void inferior_appeared (struct inferior *@var{inf})
|
|
|
|
The inferior identified by @var{inf} has been attached to a process.
|
|
|
|
@end deftypefun
|
|
|
|
|
|
|
|
@deftypefun void inferior_exit (struct inferior *@var{inf})
|
|
|
|
Either the inferior associated with @var{inf} has been detached from the
|
|
|
|
process, or the process has exited.
|
|
|
|
@end deftypefun
|
|
|
|
|
|
|
|
@deftypefun void inferior_removed (struct inferior *@var{inf})
|
|
|
|
The inferior @var{inf} has been removed from the list of inferiors.
|
|
|
|
This method is called immediately before freeing @var{inf}.
|
2009-12-02 20:29:42 +01:00
|
|
|
@end deftypefun
|
|
|
|
|
|
|
|
@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data})
|
|
|
|
Bytes from @var{data} to @var{data} + @var{len} have been written
|
|
|
|
to the current inferior at @var{addr}.
|
2008-11-17 13:28:05 +01:00
|
|
|
@end deftypefun
|
|
|
|
|
2011-07-21 13:03:48 +02:00
|
|
|
@deftypefun void before_prompt (const char *@var{current_prompt})
|
|
|
|
Called before a top-level prompt is displayed. @var{current_prompt} is
|
|
|
|
the current top-level prompt.
|
|
|
|
@end deftypefun
|
|
|
|
|
2012-05-11 20:13:26 +02:00
|
|
|
@deftypefun void gdb_datadir_changed (void)
|
|
|
|
Variable gdb_datadir has been set. The value may not necessarily change.
|
|
|
|
@end deftypefun
|
|
|
|
|
2012-08-09 14:53:46 +02:00
|
|
|
@deftypefun void command_param_changed (const char *@var{param}, const char *@var{value})
|
|
|
|
The parameter of some @code{set} commands in console are changed. This
|
|
|
|
method is called after a command @code{set @var{param} @var{value}}.
|
|
|
|
@var{param} is the parameter of @code{set} command, and @var{value}
|
|
|
|
is the value of changed parameter.
|
2012-09-18 14:09:28 +02:00
|
|
|
@end deftypefun
|
|
|
|
|
|
|
|
@deftypefun void tsv_created (const char *@var{name}, LONGEST @var{value})
|
|
|
|
The new trace state variable @var{name} is created with value
|
|
|
|
@var{value}.
|
|
|
|
@end deftypefun
|
2012-08-09 14:53:46 +02:00
|
|
|
|
2012-09-18 14:09:28 +02:00
|
|
|
@deftypefun void tsv_deleted (const char *@var{name})
|
|
|
|
The trace state variable @var{name} is deleted. If @var{name} is
|
|
|
|
@code{NULL}, all trace state variables are deleted.
|
2012-08-09 14:53:46 +02:00
|
|
|
@end deftypefun
|
|
|
|
|
Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
* inferior.c (add_inferior_silent): Notify inferior_added
observer.
(delete_inferior_1): Notify inferior_removed observer.
(exit_inferior_1): Pass inferior, not pid, to observer.
(inferior_appeared): Likewise.
(add_inferior_with_spaces): New.
(add_inferior_command): Use the above.
* inferior.h (delete_inferior_1, add_inferior_with_spaces):
Declare.
* inflow.c (inflow_inferior_exit): Likewise.
* jit.c (jit_inferior_exit_hook): Likewise.
* mi/mi-cmds.c (mi_cmds): Register add-inferior and
remove-inferior.
* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
(report_initial_inferior): New.
(mi_inferior_removed): Register the above. Make sure
inferior_added observer is called on the first inferior.
(mi_new_thread, mi_thread_exit): Thread group is now identified by
inferior number, not pid.
(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
affected.
* mi/mi-main.c (current_context): New.
(proceed_thread_callback): Use typed closure.
Proceed everything if pid is 0. Most implementation split into
(proceed_thread): ... this.
(run_one_inferior): New.
(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
Adjust for multiexec behaviour.
(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
(mi_cmd_execute): Handle the 'thread-group' option here.
Do some extra checks.
* mi-parse.c (mi_parse): Handle the --all and --thread-group
options.
* mi-parse.h (struct mi_parse): New fields all and thread_group.
2010-02-24 08:51:46 +01:00
|
|
|
@deftypefun void test_notification (int @var{somearg})
|
2009-02-17 20:52:27 +01:00
|
|
|
This observer is used for internal testing. Do not use.
|
|
|
|
See testsuite/gdb.gdb/observer.exp.
|
Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
* inferior.c (add_inferior_silent): Notify inferior_added
observer.
(delete_inferior_1): Notify inferior_removed observer.
(exit_inferior_1): Pass inferior, not pid, to observer.
(inferior_appeared): Likewise.
(add_inferior_with_spaces): New.
(add_inferior_command): Use the above.
* inferior.h (delete_inferior_1, add_inferior_with_spaces):
Declare.
* inflow.c (inflow_inferior_exit): Likewise.
* jit.c (jit_inferior_exit_hook): Likewise.
* mi/mi-cmds.c (mi_cmds): Register add-inferior and
remove-inferior.
* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
(report_initial_inferior): New.
(mi_inferior_removed): Register the above. Make sure
inferior_added observer is called on the first inferior.
(mi_new_thread, mi_thread_exit): Thread group is now identified by
inferior number, not pid.
(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
affected.
* mi/mi-main.c (current_context): New.
(proceed_thread_callback): Use typed closure.
Proceed everything if pid is 0. Most implementation split into
(proceed_thread): ... this.
(run_one_inferior): New.
(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
Adjust for multiexec behaviour.
(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
(mi_cmd_execute): Handle the 'thread-group' option here.
Do some extra checks.
* mi-parse.c (mi_parse): Handle the --all and --thread-group
options.
* mi-parse.h (struct mi_parse): New fields all and thread_group.
2010-02-24 08:51:46 +01:00
|
|
|
@end deftypefun
|
2009-02-17 20:52:27 +01:00
|
|
|
|