This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/rfc] Deprecate *_hooks
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 13 Apr 2004 12:29:11 -0400
- Subject: [patch/rfc] Deprecate *_hooks
Hello,
With the observer code being made mainstream, it's time to push these
old hooks to one side. This does a first cut, others will follow but
this at least pushes hooks to one side.
I'll look to commit this in a week.
Andrew
2004-04-12 Andrew Cagney <cagney@redhat.com>
* annotate.h (deprecated_annotate_starting_hook)
(deprecated_annotate_stopped_hook)
(deprecated_annotate_exited_hook)
(deprecated_annotate_signal_hook)
(deprecated_annotate_signalled_hook): Deprecate.
* tracepoint.h (deprecated_create_tracepoint_hook)
(deprecated_delete_tracepoint_hook)
(deprecated_modify_tracepoint_hook)
(deprecated_trace_find_hook)
(deprecated_trace_start_stop_hook): Deprecate.
* target.h (deprecated_target_new_objfile_hook): Deprecate.
* remote.h (deprecated_target_resume_hook)
(deprecated_target_wait_loop_hook): Deprecate.
* gdbcore.h (deprecated_exec_file_display_hook)
(deprecated_file_changed_hook): Deprecate.
* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
* defs.h (deprecated_modify_breakpoint_hook)
(deprecated_command_loop_hook, deprecated_show_load_progress)
(deprecated_print_frame_info_listing_hook)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_flush_hook, deprecated_create_breakpoint_hook)
(deprecated_delete_breakpoint_hook)
(deprecated_interactive_hook, deprecated_registers_changed_hook)
(deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook, deprecated_register_changed_hook)
(deprecated_memory_changed_hook, deprecated_init_ui_hook)
(deprecated_context_hook, deprecated_target_wait_hook)
(deprecated_attach_hook, deprecated_detach_hook)
(deprecated_call_command_hook, deprecated_set_hook)
(deprecated_error_hook, deprecated_error_begin_hook)
(deprecated_ui_load_progress_hook): Deprecate.
* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
* annotate.c, aix-thread.c: Update.
Index: aix-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/aix-thread.c,v
retrieving revision 1.15
diff -u -r1.15 aix-thread.c
--- aix-thread.c 2 Oct 2003 20:28:28 -0000 1.15
+++ aix-thread.c 13 Apr 2004 16:25:09 -0000
@@ -129,7 +129,8 @@
static int arch64;
-/* Saved pointer to previous owner of target_new_objfile_hook. */
+/* Saved pointer to previous owner of
+ deprecated_target_new_objfile_hook. */
static void (*target_new_objfile_chain)(struct objfile *);
@@ -893,7 +894,7 @@
unpush_target (&aix_thread_ops);
}
-/* target_new_objfile_hook callback.
+/* deprecated_target_new_objfile_hook callback.
If OBJFILE is non-null, check whether a threaded application is
being debugged, and if so, prepare for thread debugging.
@@ -1695,8 +1696,8 @@
add_target (&aix_thread_ops);
/* Notice when object files get loaded and unloaded. */
- target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = new_objfile;
+ target_new_objfile_chain = deprecated_target_new_objfile_hook;
+ deprecated_target_new_objfile_hook = new_objfile;
add_show_from_set (add_set_cmd ("aix-thread", no_class, var_zinteger,
(char *) &debug_aix_thread,
Index: annotate.c
===================================================================
RCS file: /cvs/src/src/gdb/annotate.c,v
retrieving revision 1.6
diff -u -r1.6 annotate.c
--- annotate.c 29 Jul 2003 03:17:08 -0000 1.6
+++ annotate.c 13 Apr 2004 16:25:09 -0000
@@ -35,11 +35,11 @@
static void breakpoint_changed (struct breakpoint *);
-void (*annotate_starting_hook) (void);
-void (*annotate_stopped_hook) (void);
-void (*annotate_signalled_hook) (void);
-void (*annotate_signal_hook) (void);
-void (*annotate_exited_hook) (void);
+void (*deprecated_annotate_starting_hook) (void);
+void (*deprecated_annotate_stopped_hook) (void);
+void (*deprecated_annotate_signalled_hook) (void);
+void (*deprecated_annotate_signal_hook) (void);
+void (*deprecated_annotate_exited_hook) (void);
static int ignore_count_changed = 0;
@@ -102,8 +102,8 @@
annotate_starting (void)
{
- if (annotate_starting_hook)
- annotate_starting_hook ();
+ if (deprecated_annotate_starting_hook)
+ deprecated_annotate_starting_hook ();
else
{
if (annotation_level > 1)
@@ -116,8 +116,8 @@
void
annotate_stopped (void)
{
- if (annotate_stopped_hook)
- annotate_stopped_hook ();
+ if (deprecated_annotate_stopped_hook)
+ deprecated_annotate_stopped_hook ();
else
{
if (annotation_level > 1)
@@ -133,8 +133,8 @@
void
annotate_exited (int exitstatus)
{
- if (annotate_exited_hook)
- annotate_exited_hook ();
+ if (deprecated_annotate_exited_hook)
+ deprecated_annotate_exited_hook ();
else
{
if (annotation_level > 1)
@@ -145,8 +145,8 @@
void
annotate_signalled (void)
{
- if (annotate_signalled_hook)
- annotate_signalled_hook ();
+ if (deprecated_annotate_signalled_hook)
+ deprecated_annotate_signalled_hook ();
if (annotation_level > 1)
printf_filtered ("\n\032\032signalled\n");
@@ -183,8 +183,8 @@
void
annotate_signal (void)
{
- if (annotate_signal_hook)
- annotate_signal_hook ();
+ if (deprecated_annotate_signal_hook)
+ deprecated_annotate_signal_hook ();
if (annotation_level > 1)
printf_filtered ("\n\032\032signal\n");
@@ -579,7 +579,7 @@
{
if (annotation_level > 1)
{
- delete_breakpoint_hook = breakpoint_changed;
- modify_breakpoint_hook = breakpoint_changed;
+ deprecated_delete_breakpoint_hook = breakpoint_changed;
+ deprecated_modify_breakpoint_hook = breakpoint_changed;
}
}
Index: annotate.h
===================================================================
RCS file: /cvs/src/src/gdb/annotate.h,v
retrieving revision 1.4
diff -u -r1.4 annotate.h
--- annotate.h 6 Mar 2001 08:21:05 -0000 1.4
+++ annotate.h 13 Apr 2004 16:25:09 -0000
@@ -99,8 +99,8 @@
extern void annotate_elt (void);
extern void annotate_array_section_end (void);
-extern void (*annotate_starting_hook) (void);
-extern void (*annotate_stopped_hook) (void);
-extern void (*annotate_signalled_hook) (void);
-extern void (*annotate_signal_hook) (void);
-extern void (*annotate_exited_hook) (void);
+extern void (*deprecated_annotate_starting_hook) (void);
+extern void (*deprecated_annotate_stopped_hook) (void);
+extern void (*deprecated_annotate_signalled_hook) (void);
+extern void (*deprecated_annotate_signal_hook) (void);
+extern void (*deprecated_annotate_exited_hook) (void);
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.166
diff -u -r1.166 breakpoint.c
--- breakpoint.c 8 Apr 2004 21:18:12 -0000 1.166
+++ breakpoint.c 13 Apr 2004 16:25:09 -0000
@@ -4723,13 +4723,13 @@
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
- /* FIXME: This is misplaced; mention() is called by things (like hitting a
- watchpoint) other than breakpoint creation. It should be possible to
- clean this up and at the same time replace the random calls to
- breakpoint_changed with this hook, as has already been done for
- delete_breakpoint_hook and so on. */
- if (create_breakpoint_hook)
- create_breakpoint_hook (b);
+ /* FIXME: This is misplaced; mention() is called by things (like
+ hitting a watchpoint) other than breakpoint creation. It should
+ be possible to clean this up and at the same time replace the
+ random calls to breakpoint_changed with this hook, as has already
+ 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);
if (b->ops != NULL && b->ops->print_mention != NULL)
@@ -6874,8 +6874,8 @@
if (bpt->type == bp_none)
return;
- if (delete_breakpoint_hook)
- delete_breakpoint_hook (bpt);
+ if (deprecated_delete_breakpoint_hook)
+ deprecated_delete_breakpoint_hook (bpt);
breakpoint_delete_event (bpt->number);
if (bpt->loc->inserted)
@@ -7507,8 +7507,8 @@
check_duplicates (bpt);
- if (modify_breakpoint_hook)
- modify_breakpoint_hook (bpt);
+ if (deprecated_modify_breakpoint_hook)
+ deprecated_modify_breakpoint_hook (bpt);
breakpoint_modify_event (bpt->number);
}
@@ -7651,8 +7651,8 @@
}
}
- if (modify_breakpoint_hook)
- modify_breakpoint_hook (bpt);
+ if (deprecated_modify_breakpoint_hook)
+ deprecated_modify_breakpoint_hook (bpt);
breakpoint_modify_event (bpt->number);
}
Index: complaints.c
===================================================================
RCS file: /cvs/src/src/gdb/complaints.c,v
retrieving revision 1.12
diff -u -r1.12 complaints.c
--- complaints.c 24 Oct 2003 17:37:03 -0000 1.12
+++ complaints.c 13 Apr 2004 16:25:09 -0000
@@ -186,8 +186,8 @@
if (complaint->file != NULL)
internal_vwarning (complaint->file, complaint->line, complaint->fmt, args);
- else if (warning_hook)
- (*warning_hook) (complaint->fmt, args);
+ else if (deprecated_warning_hook)
+ (*deprecated_warning_hook) (complaint->fmt, args);
else
{
if (complaints->explanation == NULL)
Index: corefile.c
===================================================================
RCS file: /cvs/src/src/gdb/corefile.c,v
retrieving revision 1.24
diff -u -r1.24 corefile.c
--- corefile.c 14 Sep 2003 16:32:12 -0000 1.24
+++ corefile.c 13 Apr 2004 16:25:09 -0000
@@ -41,17 +41,18 @@
extern void _initialize_core (void);
static void call_extra_exec_file_hooks (char *filename);
-/* You can have any number of hooks for `exec_file_command' command to call.
- If there's only one hook, it is set in exec_file_display hook.
- If there are two or more hooks, they are set in exec_file_extra_hooks[],
- and exec_file_display_hook is set to a function that calls all of them.
- This extra complexity is needed to preserve compatibility with
- old code that assumed that only one hook could be set, and which called
- exec_file_display_hook directly. */
+/* You can have any number of hooks for `exec_file_command' command to
+ call. If there's only one hook, it is set in exec_file_display
+ hook. If there are two or more hooks, they are set in
+ exec_file_extra_hooks[], and deprecated_exec_file_display_hook is
+ set to a function that calls all of them. This extra complexity is
+ needed to preserve compatibility with old code that assumed that
+ only one hook could be set, and which called
+ deprecated_exec_file_display_hook directly. */
typedef void (*hook_type) (char *);
-hook_type exec_file_display_hook; /* the original hook */
+hook_type deprecated_exec_file_display_hook; /* the original hook */
static hook_type *exec_file_extra_hooks; /* array of additional hooks */
static int exec_file_hook_count = 0; /* size of array */
@@ -100,7 +101,7 @@
{
hook_type *new_array;
- if (exec_file_display_hook != NULL)
+ if (deprecated_exec_file_display_hook != NULL)
{
/* There's already a hook installed. Arrange to have both it
* and the subsequent hooks called. */
@@ -108,8 +109,8 @@
{
/* If this is the first extra hook, initialize the hook array. */
exec_file_extra_hooks = (hook_type *) xmalloc (sizeof (hook_type));
- exec_file_extra_hooks[0] = exec_file_display_hook;
- exec_file_display_hook = call_extra_exec_file_hooks;
+ exec_file_extra_hooks[0] = deprecated_exec_file_display_hook;
+ deprecated_exec_file_display_hook = call_extra_exec_file_hooks;
exec_file_hook_count = 1;
}
@@ -124,7 +125,7 @@
exec_file_extra_hooks[exec_file_hook_count - 1] = hook;
}
else
- exec_file_display_hook = hook;
+ deprecated_exec_file_display_hook = hook;
}
/* The exec file must be closed before running an inferior.
Index: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.142
diff -u -r1.142 d10v-tdep.c
--- d10v-tdep.c 16 Feb 2004 21:49:21 -0000 1.142
+++ d10v-tdep.c 13 Apr 2004 16:25:10 -0000
@@ -1542,8 +1542,8 @@
{
register_gdbarch_init (bfd_arch_d10v, d10v_gdbarch_init);
- target_resume_hook = d10v_eva_prepare_to_trace;
- target_wait_loop_hook = d10v_eva_get_trace_data;
+ deprecated_target_resume_hook = d10v_eva_prepare_to_trace;
+ deprecated_target_wait_loop_hook = d10v_eva_get_trace_data;
deprecate_cmd (add_com ("regs", class_vars, show_regs,
"Print all registers"),
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.143
diff -u -r1.143 defs.h
--- defs.h 23 Feb 2004 19:26:14 -0000 1.143
+++ defs.h 13 Apr 2004 16:25:10 -0000
@@ -198,7 +198,7 @@
#else
#define QUIT { \
if (quit_flag) quit (); \
- if (interactive_hook) interactive_hook (); \
+ if (deprecated_interactive_hook) deprecated_interactive_hook (); \
}
#endif
@@ -1197,9 +1197,10 @@
extern char *interpreter_p;
/* If a given interpreter matches INTERPRETER_P then it should update
- command_loop_hook and init_ui_hook with the per-interpreter
- implementation. */
-/* FIXME: command_loop_hook and init_ui_hook should be moved here. */
+ deprecated_command_loop_hook and deprecated_init_ui_hook with the
+ per-interpreter implementation. */
+/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook
+ should be moved here. */
struct target_waitstatus;
struct cmd_list_element;
@@ -1208,46 +1209,47 @@
event-loop) be enabled? */
extern int event_loop_p;
-extern void (*init_ui_hook) (char *argv0);
-extern void (*command_loop_hook) (void);
-extern void (*show_load_progress) (const char *section,
- unsigned long section_sent,
- unsigned long section_size,
- unsigned long total_sent,
- unsigned long total_size);
-extern void (*print_frame_info_listing_hook) (struct symtab * s,
- int line, int stopline,
- int noerror);
+extern void (*deprecated_init_ui_hook) (char *argv0);
+extern void (*deprecated_command_loop_hook) (void);
+extern void (*deprecated_show_load_progress) (const char *section,
+ unsigned long section_sent,
+ unsigned long section_size,
+ unsigned long total_sent,
+ unsigned long total_size);
+extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
+ int line, int stopline,
+ int noerror);
extern struct frame_info *parse_frame_specification (char *frame_exp);
-extern int (*query_hook) (const char *, va_list);
-extern void (*warning_hook) (const char *, va_list);
-extern void (*flush_hook) (struct ui_file * stream);
-extern void (*create_breakpoint_hook) (struct breakpoint * b);
-extern void (*delete_breakpoint_hook) (struct breakpoint * bpt);
-extern void (*modify_breakpoint_hook) (struct breakpoint * bpt);
-extern void (*interactive_hook) (void);
-extern void (*registers_changed_hook) (void);
-extern void (*readline_begin_hook) (char *,...);
-extern char *(*readline_hook) (char *);
-extern void (*readline_end_hook) (void);
-extern void (*register_changed_hook) (int regno);
-extern void (*memory_changed_hook) (CORE_ADDR addr, int len);
-extern void (*context_hook) (int);
-extern ptid_t (*target_wait_hook) (ptid_t ptid,
+extern int (*deprecated_query_hook) (const char *, va_list);
+extern void (*deprecated_warning_hook) (const char *, va_list);
+extern void (*deprecated_flush_hook) (struct ui_file * stream);
+extern void (*deprecated_create_breakpoint_hook) (struct breakpoint * b);
+extern void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
+extern void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
+extern void (*deprecated_interactive_hook) (void);
+extern void (*deprecated_registers_changed_hook) (void);
+extern void (*deprecated_readline_begin_hook) (char *,...);
+extern char *(*deprecated_readline_hook) (char *);
+extern void (*deprecated_readline_end_hook) (void);
+extern void (*deprecated_register_changed_hook) (int regno);
+extern void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
+extern void (*deprecated_context_hook) (int);
+extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
struct target_waitstatus * status);
-extern void (*attach_hook) (void);
-extern void (*detach_hook) (void);
-extern void (*call_command_hook) (struct cmd_list_element * c,
- char *cmd, int from_tty);
+extern void (*deprecated_attach_hook) (void);
+extern void (*deprecated_detach_hook) (void);
+extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
+ char *cmd, int from_tty);
-extern void (*set_hook) (struct cmd_list_element * c);
+extern void (*deprecated_set_hook) (struct cmd_list_element * c);
-extern NORETURN void (*error_hook) (void) ATTR_NORETURN;
+extern NORETURN void (*deprecated_error_hook) (void) ATTR_NORETURN;
-extern void (*error_begin_hook) (void);
+extern void (*deprecated_error_begin_hook) (void);
-extern int (*ui_load_progress_hook) (const char *section, unsigned long num);
+extern int (*deprecated_ui_load_progress_hook) (const char *section,
+ unsigned long num);
/* Inhibit window interface if non-zero. */
Index: dsrec.c
===================================================================
RCS file: /cvs/src/src/gdb/dsrec.c,v
retrieving revision 1.13
diff -u -r1.13 dsrec.c
--- dsrec.c 28 Aug 2003 00:49:31 -0000 1.13
+++ dsrec.c 13 Apr 2004 16:25:10 -0000
@@ -124,8 +124,9 @@
do
{
serial_write (desc, srec, reclen);
- if (ui_load_progress_hook)
- if (ui_load_progress_hook (section_name, (unsigned long) i))
+ if (deprecated_ui_load_progress_hook)
+ if (deprecated_ui_load_progress_hook (section_name,
+ (unsigned long) i))
error ("Canceled the download");
}
while (waitack != NULL && !waitack ());
@@ -137,8 +138,9 @@
}
} /* Per-packet (or S-record) loop */
- if (ui_load_progress_hook)
- if (ui_load_progress_hook (section_name, (unsigned long) i))
+ if (deprecated_ui_load_progress_hook)
+ if (deprecated_ui_load_progress_hook (section_name,
+ (unsigned long) i))
error ("Canceled the download");
putchar_unfiltered ('\n');
}
Index: exec.c
===================================================================
RCS file: /cvs/src/src/gdb/exec.c,v
retrieving revision 1.36
diff -u -r1.36 exec.c
--- exec.c 28 Feb 2004 18:04:37 -0000 1.36
+++ exec.c 13 Apr 2004 16:25:10 -0000
@@ -53,7 +53,7 @@
struct vmap *map_vmap (bfd *, bfd *);
-void (*file_changed_hook) (char *);
+void (*deprecated_file_changed_hook) (char *);
/* Prototypes for local functions */
@@ -267,8 +267,8 @@
push_target (&exec_ops);
/* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- (*exec_file_display_hook) (filename);
+ if (deprecated_exec_file_display_hook)
+ (*deprecated_exec_file_display_hook) (filename);
}
}
@@ -324,8 +324,8 @@
the exec file, but that's rough. */
exec_file_command (arg, from_tty);
symbol_file_command (arg, from_tty);
- if (file_changed_hook)
- file_changed_hook (arg);
+ if (deprecated_file_changed_hook)
+ deprecated_file_changed_hook (arg);
}
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.170
diff -u -r1.170 frame.c
--- frame.c 2 Apr 2004 22:58:56 -0000 1.170
+++ frame.c 13 Apr 2004 16:25:10 -0000
@@ -914,8 +914,8 @@
deprecated_selected_frame = fi;
/* NOTE: cagney/2002-05-04: FI can be NULL. This occures when the
frame is being invalidated. */
- if (selected_frame_level_changed_hook)
- selected_frame_level_changed_hook (frame_relative_level (fi));
+ if (deprecated_selected_frame_level_changed_hook)
+ deprecated_selected_frame_level_changed_hook (frame_relative_level (fi));
/* FIXME: kseitz/2002-08-28: It would be nice to call
selected_frame_level_changed_event right here, but due to limitations
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.125
diff -u -r1.125 frame.h
--- frame.h 7 Apr 2004 20:38:26 -0000 1.125
+++ frame.h 13 Apr 2004 16:25:10 -0000
@@ -611,7 +611,7 @@
extern void locals_info (char *, int);
-extern void (*selected_frame_level_changed_hook) (int);
+extern void (*deprecated_selected_frame_level_changed_hook) (int);
extern void return_command (char *, int);
Index: gdbcore.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbcore.h,v
retrieving revision 1.12
diff -u -r1.12 gdbcore.h
--- gdbcore.h 12 Apr 2003 17:41:25 -0000 1.12
+++ gdbcore.h 13 Apr 2004 16:25:10 -0000
@@ -96,12 +96,12 @@
/* Hook for `exec_file_command' command to call. */
-extern void (*exec_file_display_hook) (char *filename);
+extern void (*deprecated_exec_file_display_hook) (char *filename);
/* Hook for "file_command", which is more useful than above
(because it is invoked AFTER symbols are read, not before) */
-extern void (*file_changed_hook) (char *filename);
+extern void (*deprecated_file_changed_hook) (char *filename);
extern void specify_exec_file_hook (void (*hook) (char *filename));
Index: hpux-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpux-thread.c,v
retrieving revision 1.21
diff -u -r1.21 hpux-thread.c
--- hpux-thread.c 2 Oct 2003 20:28:29 -0000 1.21
+++ hpux-thread.c 13 Apr 2004 16:25:10 -0000
@@ -581,6 +581,6 @@
child_suppress_run = 1;
/* Hook into new_objfile notification. */
- target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = hpux_thread_new_objfile;
+ target_new_objfile_chain = deprecated_target_new_objfile_hook;
+ deprecated_target_new_objfile_hook = hpux_thread_new_objfile;
}
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.106
diff -u -r1.106 infcmd.c
--- infcmd.c 23 Mar 2004 16:45:01 -0000 1.106
+++ infcmd.c 13 Apr 2004 16:25:10 -0000
@@ -1861,8 +1861,8 @@
normal_stop ();
- if (attach_hook)
- attach_hook ();
+ if (deprecated_attach_hook)
+ deprecated_attach_hook ();
}
/*
@@ -1884,8 +1884,8 @@
#if defined(SOLIB_RESTART)
SOLIB_RESTART ();
#endif
- if (detach_hook)
- detach_hook ();
+ if (deprecated_detach_hook)
+ deprecated_detach_hook ();
}
/* Disconnect from the current target without resuming it (leaving it
@@ -1904,8 +1904,8 @@
#if defined(SOLIB_RESTART)
SOLIB_RESTART ();
#endif
- if (detach_hook)
- detach_hook ();
+ if (deprecated_detach_hook)
+ deprecated_detach_hook ();
}
/* Stop the execution of the target while running in async mode, in
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.145
diff -u -r1.145 infrun.c
--- infrun.c 2 Apr 2004 22:38:43 -0000 1.145
+++ infrun.c 13 Apr 2004 16:25:10 -0000
@@ -316,8 +316,8 @@
static int number_of_threads_in_syscalls;
/* This is a cached copy of the pid/waitstatus of the last event
- returned by target_wait()/target_wait_hook(). This information is
- returned by get_last_target_status(). */
+ returned by target_wait()/deprecated_target_wait_hook(). This
+ information is returned by get_last_target_status(). */
static ptid_t target_last_wait_ptid;
static struct target_waitstatus target_last_waitstatus;
@@ -1038,8 +1038,8 @@
while (1)
{
- if (target_wait_hook)
- ecs->ptid = target_wait_hook (ecs->waiton_ptid, ecs->wp);
+ if (deprecated_target_wait_hook)
+ ecs->ptid = deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp);
else
ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp);
@@ -1095,9 +1095,9 @@
registers_changed ();
}
- if (target_wait_hook)
+ if (deprecated_target_wait_hook)
async_ecs->ptid =
- target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
+ deprecated_target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
else
async_ecs->ptid = target_wait (async_ecs->waiton_ptid, async_ecs->wp);
@@ -1154,9 +1154,9 @@
}
/* Return the cached copy of the last pid/waitstatus returned by
- target_wait()/target_wait_hook(). The data is actually cached by
- handle_inferior_event(), which gets called immediately after
- target_wait()/target_wait_hook(). */
+ target_wait()/deprecated_target_wait_hook(). The data is actually
+ cached by handle_inferior_event(), which gets called immediately
+ after target_wait()/deprecated_target_wait_hook(). */
void
get_last_target_status (ptid_t *ptidp, struct target_waitstatus *status)
@@ -1726,8 +1726,8 @@
ecs->ptid = saved_singlestep_ptid;
context_switch (ecs);
- if (context_hook)
- context_hook (pid_to_thread_id (ecs->ptid));
+ if (deprecated_context_hook)
+ deprecated_context_hook (pid_to_thread_id (ecs->ptid));
resume (1, TARGET_SIGNAL_0);
prepare_to_wait (ecs);
@@ -1841,8 +1841,8 @@
{
context_switch (ecs);
- if (context_hook)
- context_hook (pid_to_thread_id (ecs->ptid));
+ if (deprecated_context_hook)
+ deprecated_context_hook (pid_to_thread_id (ecs->ptid));
flush_cached_frames ();
}
Index: interps.c
===================================================================
RCS file: /cvs/src/src/gdb/interps.c,v
retrieving revision 1.6
diff -u -r1.6 interps.c
--- interps.c 8 Aug 2003 19:00:07 -0000 1.6
+++ interps.c 13 Apr 2004 16:25:10 -0000
@@ -268,10 +268,10 @@
current_interp_command_loop (void)
{
/* Somewhat messy. For the moment prop up all the old ways of
- selecting the command loop. `command_loop_hook' should be
- deprecated. */
- if (command_loop_hook != NULL)
- command_loop_hook ();
+ selecting the command loop. `deprecated_command_loop_hook'
+ should be deprecated. */
+ if (deprecated_command_loop_hook != NULL)
+ deprecated_command_loop_hook ();
else if (current_interpreter != NULL
&& current_interpreter->procs->command_loop_proc != NULL)
current_interpreter->procs->command_loop_proc (current_interpreter->data);
@@ -322,27 +322,27 @@
void
clear_interpreter_hooks (void)
{
- init_ui_hook = 0;
- print_frame_info_listing_hook = 0;
+ deprecated_init_ui_hook = 0;
+ deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
- query_hook = 0;
- warning_hook = 0;
- create_breakpoint_hook = 0;
- delete_breakpoint_hook = 0;
- modify_breakpoint_hook = 0;
- interactive_hook = 0;
- registers_changed_hook = 0;
- readline_begin_hook = 0;
- readline_hook = 0;
- readline_end_hook = 0;
- register_changed_hook = 0;
- memory_changed_hook = 0;
- context_hook = 0;
- target_wait_hook = 0;
- call_command_hook = 0;
- error_hook = 0;
- error_begin_hook = 0;
- command_loop_hook = 0;
+ deprecated_query_hook = 0;
+ deprecated_warning_hook = 0;
+ deprecated_create_breakpoint_hook = 0;
+ deprecated_delete_breakpoint_hook = 0;
+ deprecated_modify_breakpoint_hook = 0;
+ deprecated_interactive_hook = 0;
+ deprecated_registers_changed_hook = 0;
+ deprecated_readline_begin_hook = 0;
+ deprecated_readline_hook = 0;
+ deprecated_readline_end_hook = 0;
+ deprecated_register_changed_hook = 0;
+ deprecated_memory_changed_hook = 0;
+ deprecated_context_hook = 0;
+ deprecated_target_wait_hook = 0;
+ deprecated_call_command_hook = 0;
+ deprecated_error_hook = 0;
+ deprecated_error_begin_hook = 0;
+ deprecated_command_loop_hook = 0;
clear_gdb_event_hooks ();
}
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.40
diff -u -r1.40 main.c
--- main.c 18 Feb 2004 00:21:00 -0000 1.40
+++ main.c 13 Apr 2004 16:25:10 -0000
@@ -527,7 +527,7 @@
}
/* Initialize all files. Give the interpreter a chance to take
- control of the console via the init_ui_hook()) */
+ control of the console via the deprecated_init_ui_hook(). */
gdb_init (argv[0]);
/* Do these (and anything which might call wrap_here or *_filtered)
@@ -779,10 +779,10 @@
/* GUIs generally have their own command loop, mainloop, or whatever.
This is a good place to gain control because many error
conditions will end up here via longjmp(). */
- if (command_loop_hook)
- command_loop_hook ();
+ if (deprecated_command_loop_hook)
+ deprecated_command_loop_hook ();
else
- command_loop ();
+ deprecated_command_loop ();
quit_command ((char *) 0, instream == stdin);
}
}
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.110
diff -u -r1.110 regcache.c
--- regcache.c 15 Mar 2004 20:38:08 -0000 1.110
+++ regcache.c 13 Apr 2004 16:25:10 -0000
@@ -594,8 +594,8 @@
for (i = 0; i < current_regcache->descr->nr_raw_registers; i++)
set_register_cached (i, 0);
- if (registers_changed_hook)
- registers_changed_hook ();
+ if (deprecated_registers_changed_hook)
+ deprecated_registers_changed_hook ();
}
/* DEPRECATED_REGISTERS_FETCHED ()
Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.44
diff -u -r1.44 remote-mips.c
--- remote-mips.c 21 Jan 2004 15:37:11 -0000 1.44
+++ remote-mips.c 13 Apr 2004 16:25:11 -0000
@@ -2662,8 +2662,8 @@
reclen = mips_make_srec (srec, '3', s->vma + i, buffer, numbytes);
send_srec (srec, reclen, s->vma + i);
- if (ui_load_progress_hook)
- ui_load_progress_hook (s->name, i);
+ if (deprecated_ui_load_progress_hook)
+ deprecated_ui_load_progress_hook (s->name, i);
if (hashmark)
{
@@ -3186,8 +3186,8 @@
break;
}
- if (ui_load_progress_hook)
- ui_load_progress_hook (s->name, i);
+ if (deprecated_ui_load_progress_hook)
+ deprecated_ui_load_progress_hook (s->name, i);
if (hashmark)
{
Index: remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.35
diff -u -r1.35 remote-sim.c
--- remote-sim.c 2 Feb 2004 16:14:36 -0000 1.35
+++ remote-sim.c 13 Apr 2004 16:25:11 -0000
@@ -268,8 +268,8 @@
static void
gdb_os_error (host_callback * p, const char *format,...)
{
- if (error_hook)
- (*error_hook) ();
+ if (deprecated_error_hook)
+ (*deprecated_error_hook) ();
else
{
va_list args;
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.132
diff -u -r1.132 remote.c
--- remote.c 23 Mar 2004 15:14:02 -0000 1.132
+++ remote.c 13 Apr 2004 16:25:11 -0000
@@ -1006,8 +1006,8 @@
/* These are pointers to hook functions that may be set in order to
modify resume/wait behavior for a particular architecture. */
-void (*target_resume_hook) (void);
-void (*target_wait_loop_hook) (void);
+void (*deprecated_target_resume_hook) (void);
+void (*deprecated_target_wait_loop_hook) (void);
@@ -2552,8 +2552,8 @@
/* A hook for when we need to do something at the last moment before
resumption. */
- if (target_resume_hook)
- (*target_resume_hook) ();
+ if (deprecated_target_resume_hook)
+ (*deprecated_target_resume_hook) ();
/* The vCont packet doesn't need to specify threads via Hc. */
if (remote_vcont_resume (ptid, step, siggnal))
@@ -2883,8 +2883,8 @@
/* This is a hook for when we need to do something (perhaps the
collection of trace data) every time the target stops. */
- if (target_wait_loop_hook)
- (*target_wait_loop_hook) ();
+ if (deprecated_target_wait_loop_hook)
+ (*deprecated_target_wait_loop_hook) ();
remote_stopped_by_watchpoint_p = 0;
@@ -3074,8 +3074,8 @@
/* This is a hook for when we need to do something (perhaps the
collection of trace data) every time the target stops. */
- if (target_wait_loop_hook)
- (*target_wait_loop_hook) ();
+ if (deprecated_target_wait_loop_hook)
+ (*deprecated_target_wait_loop_hook) ();
switch (buf[0])
{
@@ -5479,8 +5479,8 @@
add_target (&extended_async_remote_ops);
/* Hook into new objfile notification. */
- remote_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = remote_new_objfile;
+ remote_new_objfile_chain = deprecated_target_new_objfile_hook;
+ deprecated_target_new_objfile_hook = remote_new_objfile;
#if 0
init_remote_threadtests ();
Index: remote.h
===================================================================
RCS file: /cvs/src/src/gdb/remote.h,v
retrieving revision 1.4
diff -u -r1.4 remote.h
--- remote.h 10 Jun 2003 14:37:04 -0000 1.4
+++ remote.h 13 Apr 2004 16:25:11 -0000
@@ -58,7 +58,7 @@
extern int remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len);
-extern void (*target_resume_hook) (void);
-extern void (*target_wait_loop_hook) (void);
+extern void (*deprecated_target_resume_hook) (void);
+extern void (*deprecated_target_wait_loop_hook) (void);
#endif
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.38
diff -u -r1.38 rs6000-nat.c
--- rs6000-nat.c 17 Jan 2004 00:00:48 -0000 1.38
+++ rs6000-nat.c 13 Apr 2004 16:25:11 -0000
@@ -880,8 +880,8 @@
/* Announce new object files. Doing this after symbol relocation
makes aix-thread.c's job easier. */
- if (target_new_objfile_hook && vp->objfile)
- target_new_objfile_hook (vp->objfile);
+ if (deprecated_target_new_objfile_hook && vp->objfile)
+ deprecated_target_new_objfile_hook (vp->objfile);
/* There may be more, so we don't break out of the loop. */
}
@@ -1162,8 +1162,8 @@
vmap_symtab (vp);
- if (target_new_objfile_hook && vp != vmap && vp->objfile)
- target_new_objfile_hook (vp->objfile);
+ if (deprecated_target_new_objfile_hook && vp != vmap && vp->objfile)
+ deprecated_target_new_objfile_hook (vp->objfile);
}
while (LDI_NEXT (ldi, arch64) != 0);
vmap_exec ();
Index: sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.39
diff -u -r1.39 sol-thread.c
--- sol-thread.c 1 Feb 2004 22:35:28 -0000 1.39
+++ sol-thread.c 13 Apr 2004 16:25:11 -0000
@@ -1702,8 +1702,8 @@
add_target (&core_ops);
/* Hook into new_objfile notification. */
- target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = sol_thread_new_objfile;
+ target_new_objfile_chain = deprecated_target_new_objfile_hook;
+ deprecated_target_new_objfile_hook = sol_thread_new_objfile;
return;
die:
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.102
diff -u -r1.102 stack.c
--- stack.c 18 Mar 2004 23:04:45 -0000 1.102
+++ stack.c 13 Apr 2004 16:25:12 -0000
@@ -52,7 +52,7 @@
void locals_info (char *, int);
-void (*selected_frame_level_changed_hook) (int);
+void (*deprecated_selected_frame_level_changed_hook) (int);
void _initialize_stack (void);
@@ -494,8 +494,8 @@
get_frame_pc (fi));
if (!done)
{
- if (print_frame_info_listing_hook)
- print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
+ if (deprecated_print_frame_info_listing_hook)
+ deprecated_print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
else
{
/* We used to do this earlier, but that is clearly
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.125
diff -u -r1.125 symfile.c
--- symfile.c 8 Apr 2004 21:18:13 -0000 1.125
+++ symfile.c 13 Apr 2004 16:25:12 -0000
@@ -72,15 +72,15 @@
} while (0)
#endif
-int (*ui_load_progress_hook) (const char *section, unsigned long num);
-void (*show_load_progress) (const char *section,
- unsigned long section_sent,
- unsigned long section_size,
- unsigned long total_sent,
- unsigned long total_size);
+int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
+void (*deprecated_show_load_progress) (const char *section,
+ unsigned long section_sent,
+ unsigned long section_size,
+ unsigned long total_sent,
+ unsigned long total_size);
void (*pre_add_symbol_hook) (char *);
void (*post_add_symbol_hook) (void);
-void (*target_new_objfile_hook) (struct objfile *);
+void (*deprecated_target_new_objfile_hook) (struct objfile *);
static void clear_symtab_users_cleanup (void *ignore);
@@ -902,8 +902,8 @@
new_symfile_objfile (objfile, mainline, from_tty);
- if (target_new_objfile_hook)
- target_new_objfile_hook (objfile);
+ if (deprecated_target_new_objfile_hook)
+ deprecated_target_new_objfile_hook (objfile);
return (objfile);
}
@@ -1438,13 +1438,14 @@
args->write_count += 1;
sent += len;
if (quit_flag
- || (ui_load_progress_hook != NULL
- && ui_load_progress_hook (sect_name, sent)))
+ || (deprecated_ui_load_progress_hook != NULL
+ && deprecated_ui_load_progress_hook (sect_name, sent)))
error ("Canceled the download");
- if (show_load_progress != NULL)
- show_load_progress (sect_name, sent, size,
- args->data_count, args->total_size);
+ if (deprecated_show_load_progress != NULL)
+ deprecated_show_load_progress (sect_name, sent, size,
+ args->data_count,
+ args->total_size);
}
while (sent < size);
@@ -2309,8 +2310,8 @@
set_default_breakpoint (0, 0, 0, 0);
clear_current_source_symtab_and_line ();
clear_pc_function_cache ();
- if (target_new_objfile_hook)
- target_new_objfile_hook (NULL);
+ if (deprecated_target_new_objfile_hook)
+ deprecated_target_new_objfile_hook (NULL);
}
static void
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.71
diff -u -r1.71 target.c
--- target.c 9 Mar 2004 16:16:52 -0000 1.71
+++ target.c 13 Apr 2004 16:25:12 -0000
@@ -1551,8 +1551,8 @@
if (!show_breakpoint_hit_counts)
breakpoint_clear_ignore_counts ();
- if (detach_hook)
- detach_hook ();
+ if (deprecated_detach_hook)
+ deprecated_detach_hook ();
}
/* Helper function for child_wait and the Lynx derivatives of child_wait.
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.57
diff -u -r1.57 target.h
--- target.h 4 Feb 2004 21:49:55 -0000 1.57
+++ target.h 13 Apr 2004 16:25:12 -0000
@@ -949,19 +949,19 @@
* The old way of doing this is to define a macro 'target_new_objfile'
* that points to the function that you want to be called on every
* objfile/shlib load.
- *
- * The new way is to grab the function pointer, 'target_new_objfile_hook',
- * and point it to the function that you want to be called on every
- * objfile/shlib load.
- *
- * If multiple clients are willing to be cooperative, they can each
- * save a pointer to the previous value of target_new_objfile_hook
- * before modifying it, and arrange for their function to call the
- * previous function in the chain. In that way, multiple clients
- * can receive this notification (something like with signal handlers).
- */
-extern void (*target_new_objfile_hook) (struct objfile *);
+ The new way is to grab the function pointer,
+ 'deprecated_target_new_objfile_hook', and point it to the function
+ that you want to be called on every objfile/shlib load.
+
+ If multiple clients are willing to be cooperative, they can each
+ save a pointer to the previous value of
+ deprecated_target_new_objfile_hook before modifying it, and arrange
+ for their function to call the previous function in the chain. In
+ that way, multiple clients can receive this notification (something
+ like with signal handlers). */
+
+extern void (*deprecated_target_new_objfile_hook) (struct objfile *);
#ifndef target_pid_or_tid_to_str
#define target_pid_or_tid_to_str(ID) \
Index: thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/thread-db.c,v
retrieving revision 1.38
diff -u -r1.38 thread-db.c
--- thread-db.c 29 Mar 2004 18:07:14 -0000 1.38
+++ thread-db.c 13 Apr 2004 16:25:12 -0000
@@ -1359,7 +1359,7 @@
add_target (&thread_db_ops);
/* Add ourselves to objfile event chain. */
- target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = thread_db_new_objfile;
+ target_new_objfile_chain = deprecated_target_new_objfile_hook;
+ deprecated_target_new_objfile_hook = thread_db_new_objfile;
}
}
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.88
diff -u -r1.88 top.c
--- top.c 28 Feb 2004 18:04:37 -0000 1.88
+++ top.c 13 Apr 2004 16:25:12 -0000
@@ -193,7 +193,7 @@
If the UI fails to initialize and it wants GDB to continue
using the default UI, then it should clear this hook before returning. */
-void (*init_ui_hook) (char *argv0);
+void (*deprecated_init_ui_hook) (char *argv0);
/* This hook is called from within gdb's many mini-event loops which could
steal control from a real user interface's event loop. It returns
@@ -204,92 +204,93 @@
/* Called instead of command_loop at top level. Can be invoked via
throw_exception(). */
-void (*command_loop_hook) (void);
+void (*deprecated_command_loop_hook) (void);
/* Called from print_frame_info to list the line we stopped in. */
-void (*print_frame_info_listing_hook) (struct symtab * s, int line,
- int stopline, int noerror);
+void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, int line,
+ int stopline, int noerror);
/* Replaces most of query. */
-int (*query_hook) (const char *, va_list);
+int (*deprecated_query_hook) (const char *, va_list);
/* Replaces most of warning. */
-void (*warning_hook) (const char *, va_list);
+void (*deprecated_warning_hook) (const char *, va_list);
-/* These three functions support getting lines of text from the user. They
- are used in sequence. First readline_begin_hook is called with a text
- string that might be (for example) a message for the user to type in a
- sequence of commands to be executed at a breakpoint. If this function
- calls back to a GUI, it might take this opportunity to pop up a text
- interaction window with this message. Next, readline_hook is called
- with a prompt that is emitted prior to collecting the user input.
- It can be called multiple times. Finally, readline_end_hook is called
- to notify the GUI that we are done with the interaction window and it
- can close it. */
-
-void (*readline_begin_hook) (char *, ...);
-char *(*readline_hook) (char *);
-void (*readline_end_hook) (void);
+/* These three functions support getting lines of text from the user.
+ They are used in sequence. First deprecated_readline_begin_hook is
+ called with a text string that might be (for example) a message for
+ the user to type in a sequence of commands to be executed at a
+ breakpoint. If this function calls back to a GUI, it might take
+ this opportunity to pop up a text interaction window with this
+ message. Next, deprecated_readline_hook is called with a prompt
+ that is emitted prior to collecting the user input. It can be
+ called multiple times. Finally, deprecated_readline_end_hook is
+ called to notify the GUI that we are done with the interaction
+ window and it can close it. */
+
+void (*deprecated_readline_begin_hook) (char *, ...);
+char *(*deprecated_readline_hook) (char *);
+void (*deprecated_readline_end_hook) (void);
/* Called as appropriate to notify the interface of the specified breakpoint
conditions. */
-void (*create_breakpoint_hook) (struct breakpoint * bpt);
-void (*delete_breakpoint_hook) (struct breakpoint * bpt);
-void (*modify_breakpoint_hook) (struct breakpoint * bpt);
+void (*deprecated_create_breakpoint_hook) (struct breakpoint * bpt);
+void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
+void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
/* Called as appropriate to notify the interface that we have attached
to or detached from an already running process. */
-void (*attach_hook) (void);
-void (*detach_hook) (void);
+void (*deprecated_attach_hook) (void);
+void (*deprecated_detach_hook) (void);
/* Called during long calculations to allow GUI to repair window damage, and to
check for stop buttons, etc... */
-void (*interactive_hook) (void);
+void (*deprecated_interactive_hook) (void);
/* Called when the registers have changed, as a hint to a GUI
to minimize window update. */
-void (*registers_changed_hook) (void);
+void (*deprecated_registers_changed_hook) (void);
/* Tell the GUI someone changed the register REGNO. -1 means
that the caller does not know which register changed or
that several registers have changed (see value_assign). */
-void (*register_changed_hook) (int regno);
+void (*deprecated_register_changed_hook) (int regno);
/* Tell the GUI someone changed LEN bytes of memory at ADDR */
-void (*memory_changed_hook) (CORE_ADDR addr, int len);
+void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
/* Called when going to wait for the target. Usually allows the GUI to run
while waiting for target events. */
-ptid_t (*target_wait_hook) (ptid_t ptid,
- struct target_waitstatus * status);
+ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
+ struct target_waitstatus * status);
/* Used by UI as a wrapper around command execution. May do various things
like enabling/disabling buttons, etc... */
-void (*call_command_hook) (struct cmd_list_element * c, char *cmd,
- int from_tty);
+void (*deprecated_call_command_hook) (struct cmd_list_element * c, char *cmd,
+ int from_tty);
/* Called after a `set' command has finished. Is only run if the
`set' command succeeded. */
-void (*set_hook) (struct cmd_list_element * c);
+void (*deprecated_set_hook) (struct cmd_list_element * c);
/* Called when the current thread changes. Argument is thread id. */
-void (*context_hook) (int id);
+void (*deprecated_context_hook) (int id);
/* Takes control from error (). Typically used to prevent longjmps out of the
middle of the GUI. Usually used in conjunction with a catch routine. */
-NORETURN void (*error_hook) (void) ATTR_NORETURN;
+NORETURN void (*deprecated_error_hook) (void) ATTR_NORETURN;
/* One should use catch_errors rather than manipulating these
@@ -737,8 +738,8 @@
do_setshow_command (arg, from_tty & caution, c);
else if (!cmd_func_p (c))
error ("That is not a command, just a help topic.");
- else if (call_command_hook)
- call_command_hook (c, arg, from_tty & caution);
+ else if (deprecated_call_command_hook)
+ deprecated_call_command_hook (c, arg, from_tty & caution);
else
cmd_func (c, arg, from_tty & caution);
@@ -1234,9 +1235,9 @@
}
/* Don't use fancy stuff if not talking to stdin. */
- if (readline_hook && instream == NULL)
+ if (deprecated_readline_hook && instream == NULL)
{
- rl = (*readline_hook) (local_prompt);
+ rl = (*deprecated_readline_hook) (local_prompt);
}
else if (command_editing_p && instream == stdin && ISATTY (instream))
{
@@ -1452,7 +1453,7 @@
/* This is something of a hack. But there's no reliable way to
see if a GUI is running. The `use_windows' variable doesn't
cut it. */
- if (init_ui_hook)
+ if (deprecated_init_ui_hook)
s = "A debugging session is active.\nDo you still want to close the debugger?";
else if (attach_flag)
s = "The program is running. Quit anyway (and detach it)? ";
@@ -1905,8 +1906,9 @@
set_language (language_c);
expected_language = current_language; /* don't warn about the change. */
- /* Allow another UI to initialize. If the UI fails to initialize, and
- it wants GDB to revert to the CLI, it should clear init_ui_hook. */
- if (init_ui_hook)
- init_ui_hook (argv0);
+ /* Allow another UI to initialize. If the UI fails to initialize,
+ and it wants GDB to revert to the CLI, it should clear
+ deprecated_init_ui_hook. */
+ if (deprecated_init_ui_hook)
+ deprecated_init_ui_hook (argv0);
}
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.57
diff -u -r1.57 tracepoint.c
--- tracepoint.c 28 Feb 2004 18:04:37 -0000 1.57
+++ tracepoint.c 13 Apr 2004 16:25:13 -0000
@@ -65,9 +65,9 @@
#define MAX_AGENT_EXPR_LEN 184
-extern void (*readline_begin_hook) (char *, ...);
-extern char *(*readline_hook) (char *);
-extern void (*readline_end_hook) (void);
+extern void (*deprecated_readline_begin_hook) (char *, ...);
+extern char *(*deprecated_readline_hook) (char *);
+extern void (*deprecated_readline_end_hook) (void);
extern void x_command (char *, int);
extern int addressprint; /* Print machine addresses? */
@@ -787,8 +787,8 @@
if (from_tty)
{
- if (readline_begin_hook)
- (*readline_begin_hook) ("%s %s\n", tmpbuf, end_msg);
+ if (deprecated_readline_begin_hook)
+ (*deprecated_readline_begin_hook) ("%s %s\n", tmpbuf, end_msg);
else if (input_from_terminal_p ())
printf_filtered ("%s\n%s\n", tmpbuf, end_msg);
}
@@ -797,8 +797,8 @@
t->step_count = 0; /* read_actions may set this */
read_actions (t);
- if (readline_end_hook)
- (*readline_end_hook) ();
+ if (deprecated_readline_end_hook)
+ (*deprecated_readline_end_hook) ();
/* tracepoints_changed () */
}
/* else just return */
@@ -842,8 +842,8 @@
gdb_flush (gdb_stdout);
gdb_flush (gdb_stderr);
- if (readline_hook && instream == NULL)
- line = (*readline_hook) (prompt);
+ if (deprecated_readline_hook && instream == NULL)
+ line = (*deprecated_readline_hook) (prompt);
else if (instream == stdin && ISATTY (instream))
{
line = gdb_readline_wrapper (prompt);
@@ -1804,8 +1804,8 @@
set_tracepoint_num (-1);
set_traceframe_context (-1);
trace_running_p = 1;
- if (trace_start_stop_hook)
- trace_start_stop_hook (1, from_tty);
+ if (deprecated_trace_start_stop_hook)
+ deprecated_trace_start_stop_hook (1, from_tty);
}
else
@@ -1823,8 +1823,8 @@
if (strcmp (target_buf, "OK"))
error ("Bogus reply from target: %s", target_buf);
trace_running_p = 0;
- if (trace_start_stop_hook)
- trace_start_stop_hook (0, from_tty);
+ if (deprecated_trace_start_stop_hook)
+ deprecated_trace_start_stop_hook (0, from_tty);
}
else
error ("Trace can only be run on remote targets.");
@@ -1985,8 +1985,8 @@
if (target_is_remote ())
{
- if (trace_find_hook)
- trace_find_hook (args, from_tty);
+ if (deprecated_trace_find_hook)
+ deprecated_trace_find_hook (args, from_tty);
if (args == 0 || *args == 0)
{ /* TFIND with no args means find NEXT trace frame. */
Index: tracepoint.h
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.h,v
retrieving revision 1.6
diff -u -r1.6 tracepoint.h
--- tracepoint.h 2 Aug 2001 11:58:29 -0000 1.6
+++ tracepoint.h 13 Apr 2004 16:25:13 -0000
@@ -109,11 +109,11 @@
/* A hook used to notify the UI of tracepoint operations */
-void (*create_tracepoint_hook) (struct tracepoint *);
-void (*delete_tracepoint_hook) (struct tracepoint *);
-void (*modify_tracepoint_hook) (struct tracepoint *);
-void (*trace_find_hook) (char *arg, int from_tty);
-void (*trace_start_stop_hook) (int start, int from_tty);
+void (*deprecated_create_tracepoint_hook) (struct tracepoint *);
+void (*deprecated_delete_tracepoint_hook) (struct tracepoint *);
+void (*deprecated_modify_tracepoint_hook) (struct tracepoint *);
+void (*deprecated_trace_find_hook) (char *arg, int from_tty);
+void (*deprecated_trace_start_stop_hook) (int start, int from_tty);
struct tracepoint *get_tracepoint_by_number (char **, int, int);
int get_traceframe_number (void);
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.119
diff -u -r1.119 utils.c
--- utils.c 30 Mar 2004 15:44:16 -0000 1.119
+++ utils.c 13 Apr 2004 16:25:13 -0000
@@ -83,7 +83,7 @@
/* readline defines this. */
#undef savestring
-void (*error_begin_hook) (void);
+void (*deprecated_error_begin_hook) (void);
/* Holds the last error message issued by gdb */
@@ -566,8 +566,8 @@
void
vwarning (const char *string, va_list args)
{
- if (warning_hook)
- (*warning_hook) (string, args);
+ if (deprecated_warning_hook)
+ (*deprecated_warning_hook) (string, args);
else
{
target_terminal_ours ();
@@ -659,8 +659,8 @@
NORETURN void
error_stream (struct ui_file *stream)
{
- if (error_begin_hook)
- error_begin_hook ();
+ if (deprecated_error_begin_hook)
+ deprecated_error_begin_hook ();
/* Copy the stream into the GDB_LASTERR buffer. */
ui_file_rewind (gdb_lasterr);
@@ -1270,10 +1270,10 @@
int ans2;
int retval;
- if (query_hook)
+ if (deprecated_query_hook)
{
va_start (args, ctlstr);
- return query_hook (ctlstr, args);
+ return deprecated_query_hook (ctlstr, args);
}
/* Automatically answer "yes" if input is not from a terminal. */
@@ -1373,9 +1373,9 @@
n_string = "[n]";
}
- if (query_hook)
+ if (deprecated_query_hook)
{
- return query_hook (ctlstr, args);
+ return deprecated_query_hook (ctlstr, args);
}
/* Automatically answer default value if input is not from a terminal. */
Index: uw-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/uw-thread.c,v
retrieving revision 1.8
diff -u -r1.8 uw-thread.c
--- uw-thread.c 15 Aug 2002 19:00:46 -0000 1.8
+++ uw-thread.c 13 Apr 2004 16:25:13 -0000
@@ -206,7 +206,8 @@
they lack current_target's default callbacks. */
static struct target_ops base_ops;
-/* Saved pointer to previous owner of target_new_objfile_hook. */
+/* Saved pointer to previous owner of
+ deprecated_target_new_objfile_hook. */
static void (*target_new_objfile_chain)(struct objfile *);
/* Whether we are debugging a user-space thread program. This isn't
@@ -1000,7 +1001,7 @@
deactivate_uw_thread ();
}
-/* target_new_objfile_hook callback.
+/* deprecated_target_new_objfile_hook callback.
If OBJFILE is non-null, check whether libthread.so was just loaded,
and if so, prepare for user-mode thread debugging.
@@ -1062,6 +1063,6 @@
procfs_suppress_run = 1;
/* Notice when libthread.so gets loaded. */
- target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = uw_thread_new_objfile;
+ target_new_objfile_chain = deprecated_target_new_objfile_hook;
+ deprecated_target_new_objfile_hook = uw_thread_new_objfile;
}
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.122
diff -u -r1.122 valops.c
--- valops.c 8 Apr 2004 21:18:13 -0000 1.122
+++ valops.c 13 Apr 2004 16:25:13 -0000
@@ -606,8 +606,8 @@
}
write_memory (changed_addr, dest_buffer, changed_len);
- if (memory_changed_hook)
- memory_changed_hook (changed_addr, changed_len);
+ if (deprecated_memory_changed_hook)
+ deprecated_memory_changed_hook (changed_addr, changed_len);
target_changed_event ();
}
break;
@@ -698,8 +698,8 @@
put_frame_register (frame, regno, buffer + amount_copied);
}
- if (register_changed_hook)
- register_changed_hook (-1);
+ if (deprecated_register_changed_hook)
+ deprecated_register_changed_hook (-1);
target_changed_event ();
break;
}
Index: cli/cli-script.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-script.c,v
retrieving revision 1.22
diff -u -r1.22 cli-script.c
--- cli/cli-script.c 25 Feb 2004 15:57:42 -0000 1.22
+++ cli/cli-script.c 13 Apr 2004 16:25:15 -0000
@@ -685,7 +685,7 @@
error ("Control nesting too deep!\n");
/* Set a prompt based on the nesting of the control commands. */
- if (instream == stdin || (instream == 0 && readline_hook != NULL))
+ if (instream == stdin || (instream == 0 && deprecated_readline_hook != NULL))
{
for (i = 0; i < control_level; i++)
control_prompt[i] = ' ';
@@ -893,10 +893,10 @@
enum misc_command_type val;
control_level = 0;
- if (readline_begin_hook)
+ if (deprecated_readline_begin_hook)
{
/* Note - intentional to merge messages with no newline */
- (*readline_begin_hook) ("%s %s\n", prompt_arg, END_MESSAGE);
+ (*deprecated_readline_begin_hook) ("%s %s\n", prompt_arg, END_MESSAGE);
}
else if (from_tty && input_from_terminal_p ())
{
@@ -962,9 +962,9 @@
do_cleanups (old_chain);
}
- if (readline_end_hook)
+ if (deprecated_readline_end_hook)
{
- (*readline_end_hook) ();
+ (*deprecated_readline_end_hook) ();
}
return (head);
}
Index: cli/cli-setshow.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-setshow.c,v
retrieving revision 1.14
diff -u -r1.14 cli-setshow.c
--- cli/cli-setshow.c 28 Feb 2004 18:04:37 -0000 1.14
+++ cli/cli-setshow.c 13 Apr 2004 16:25:15 -0000
@@ -344,8 +344,8 @@
else
error ("gdb internal error: bad cmd_type in do_setshow_command");
c->func (c, NULL, from_tty);
- if (c->type == set_cmd && set_hook)
- set_hook (c);
+ if (c->type == set_cmd && deprecated_set_hook)
+ deprecated_set_hook (c);
}
/* Show all the settings in a list of show commands. */
Index: mi/mi-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-interp.c,v
retrieving revision 1.7
diff -u -r1.7 mi-interp.c
--- mi/mi-interp.c 19 Jan 2004 01:20:12 -0000 1.7
+++ mi/mi-interp.c 13 Apr 2004 16:25:15 -0000
@@ -127,17 +127,17 @@
be a better way of doing this... */
clear_interpreter_hooks ();
- show_load_progress = mi_load_progress;
+ deprecated_show_load_progress = mi_load_progress;
/* If we're _the_ interpreter, take control. */
if (current_interp_named_p (INTERP_MI1))
- command_loop_hook = mi1_command_loop;
+ deprecated_command_loop_hook = mi1_command_loop;
else if (current_interp_named_p (INTERP_MI2))
- command_loop_hook = mi2_command_loop;
+ deprecated_command_loop_hook = mi2_command_loop;
else if (current_interp_named_p (INTERP_MI3))
- command_loop_hook = mi3_command_loop;
+ deprecated_command_loop_hook = mi3_command_loop;
else
- command_loop_hook = mi2_command_loop;
+ deprecated_command_loop_hook = mi2_command_loop;
return 1;
}
@@ -282,13 +282,13 @@
static void
mi_insert_notify_hooks (void)
{
- query_hook = mi_interp_query_hook;
+ deprecated_query_hook = mi_interp_query_hook;
}
static void
mi_remove_notify_hooks (void)
{
- query_hook = NULL;
+ deprecated_query_hook = NULL;
}
static int
@@ -341,27 +341,27 @@
uiout = mi_out_new (mi_version);
/* HACK: Override any other interpreter hooks. We need to create a
real event table and pass in that. */
- init_ui_hook = 0;
- /* command_loop_hook = 0; */
- print_frame_info_listing_hook = 0;
- query_hook = 0;
- warning_hook = 0;
- create_breakpoint_hook = 0;
- delete_breakpoint_hook = 0;
- modify_breakpoint_hook = 0;
- interactive_hook = 0;
- registers_changed_hook = 0;
- readline_begin_hook = 0;
- readline_hook = 0;
- readline_end_hook = 0;
- register_changed_hook = 0;
- memory_changed_hook = 0;
- context_hook = 0;
- target_wait_hook = 0;
- call_command_hook = 0;
- error_hook = 0;
- error_begin_hook = 0;
- show_load_progress = mi_load_progress;
+ deprecated_init_ui_hook = 0;
+ /* deprecated_command_loop_hook = 0; */
+ deprecated_print_frame_info_listing_hook = 0;
+ deprecated_query_hook = 0;
+ deprecated_warning_hook = 0;
+ deprecated_create_breakpoint_hook = 0;
+ deprecated_delete_breakpoint_hook = 0;
+ deprecated_modify_breakpoint_hook = 0;
+ deprecated_interactive_hook = 0;
+ deprecated_registers_changed_hook = 0;
+ deprecated_readline_begin_hook = 0;
+ deprecated_readline_hook = 0;
+ deprecated_readline_end_hook = 0;
+ deprecated_register_changed_hook = 0;
+ deprecated_memory_changed_hook = 0;
+ deprecated_context_hook = 0;
+ deprecated_target_wait_hook = 0;
+ deprecated_call_command_hook = 0;
+ deprecated_error_hook = 0;
+ deprecated_error_begin_hook = 0;
+ deprecated_show_load_progress = mi_load_progress;
#endif
/* Turn off 8 bit strings in quoted output. Any character with the
high bit set is printed using C's octal format. */
Index: tui/tui-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v
retrieving revision 1.21
diff -u -r1.21 tui-hooks.c
--- tui/tui-hooks.c 9 Apr 2004 13:54:34 -0000 1.21
+++ tui/tui-hooks.c 13 Apr 2004 16:25:15 -0000
@@ -127,7 +127,7 @@
return retval;
}
-/* Prevent recursion of registers_changed_hook(). */
+/* Prevent recursion of deprecated_registers_changed_hook(). */
static int tui_refreshing_registers = 0;
static void
@@ -283,31 +283,31 @@
void
tui_install_hooks (void)
{
- target_wait_hook = tui_target_wait_hook;
- selected_frame_level_changed_hook = tui_selected_frame_level_changed_hook;
- print_frame_info_listing_hook = tui_print_frame_info_listing_hook;
+ deprecated_target_wait_hook = tui_target_wait_hook;
+ deprecated_selected_frame_level_changed_hook = tui_selected_frame_level_changed_hook;
+ deprecated_print_frame_info_listing_hook = tui_print_frame_info_listing_hook;
- query_hook = tui_query_hook;
+ deprecated_query_hook = tui_query_hook;
/* Install the event hooks. */
tui_old_event_hooks = set_gdb_event_hooks (&tui_event_hooks);
- registers_changed_hook = tui_registers_changed_hook;
- register_changed_hook = tui_register_changed_hook;
- detach_hook = tui_detach_hook;
+ deprecated_registers_changed_hook = tui_registers_changed_hook;
+ deprecated_register_changed_hook = tui_register_changed_hook;
+ deprecated_detach_hook = tui_detach_hook;
}
/* Remove the TUI specific hooks. */
void
tui_remove_hooks (void)
{
- target_wait_hook = 0;
- selected_frame_level_changed_hook = 0;
- print_frame_info_listing_hook = 0;
- query_hook = 0;
- registers_changed_hook = 0;
- register_changed_hook = 0;
- detach_hook = 0;
+ deprecated_target_wait_hook = 0;
+ deprecated_selected_frame_level_changed_hook = 0;
+ deprecated_print_frame_info_listing_hook = 0;
+ deprecated_query_hook = 0;
+ deprecated_registers_changed_hook = 0;
+ deprecated_register_changed_hook = 0;
+ deprecated_detach_hook = 0;
/* Restore the previous event hooks. */
set_gdb_event_hooks (tui_old_event_hooks);
@@ -319,6 +319,6 @@
_initialize_tui_hooks (void)
{
/* Install the permanent hooks. */
- tui_target_new_objfile_chain = target_new_objfile_hook;
- target_new_objfile_hook = tui_new_objfile_hook;
+ tui_target_new_objfile_chain = deprecated_target_new_objfile_hook;
+ deprecated_target_new_objfile_hook = tui_new_objfile_hook;
}
Index: tui/tui-io.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-io.c,v
retrieving revision 1.10
diff -u -r1.10 tui-io.c
--- tui/tui-io.c 9 Apr 2004 13:54:34 -0000 1.10
+++ tui/tui-io.c 13 Apr 2004 16:25:15 -0000
@@ -603,8 +603,8 @@
tui_stderr = tui_fileopen (stderr);
tui_out = tui_out_new (tui_stdout);
- /* Create the default UI. It is not created because we installed
- a init_ui_hook. */
+ /* Create the default UI. It is not created because we installed a
+ deprecated_init_ui_hook. */
tui_old_uiout = uiout = cli_out_new (gdb_stdout);
#ifdef TUI_USE_PIPE_FOR_READLINE