* [PATCH 11/11] Remove deprecated_print_frame_info_listing_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 06/11] Remove unused deprecated_context_hook Philipp Rudo
` (11 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
This patch removes deprecated_print_frame_info_listing_hook.
In contrast to the previous patches this one needs to change some
functionality for the TUI front-end. According to the comment in
tui/tui-hooks.c:tui_install_hooks the hook is only used to tell
print_frame_info that TUI is active. So check directly if tui_active is
set and remove deprecated_print_frame_info_listing_hook.
A quick test shows that this patch does not change TUIs behavior.
Nevertheless it would be better if somebody with more experience with TUI
takes a look at it.
gdb/ChangeLog
* defs.h (deprecated_print_frame_info_listing_hook): Remove.
* top.c (deprecated_print_frame_info_listing_hook): Remove.
* stack.c (tui/tui.h): New include.
(TUI_ACTIVE): New define.
(print_frame_info): Adjust.
* tui/tui-hooks (tui_dummy_print_frame_info_listing_hook): Remove.
(tui_install_hooks, tui_remove_hooks): Adjust.
* interps.c (clear_interpreter_hooks): Adjust.
---
gdb/defs.h | 4 ----
gdb/interps.c | 1 -
gdb/stack.c | 42 +++++++++++++++++-------------------------
gdb/top.c | 6 ------
gdb/tui/tui-hooks.c | 19 -------------------
5 files changed, 17 insertions(+), 55 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index e15ddf7..ac51ed2 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -666,10 +666,6 @@ extern void (*deprecated_show_load_progress) (const char *section,
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 int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
diff --git a/gdb/interps.c b/gdb/interps.c
index aaab99c..2d983d6 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -388,7 +388,6 @@ interp_exec (struct interp *interp, const char *command_str)
void
clear_interpreter_hooks (void)
{
- deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
deprecated_error_begin_hook = 0;
diff --git a/gdb/stack.c b/gdb/stack.c
index aa3a80e..d13ec30 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -48,6 +48,13 @@
#include "cli/cli-utils.h"
#include "objfiles.h"
+#ifdef TUI
+#include "tui/tui.h"
+#define TUI_ACTIVE tui_active
+#else
+#define TUI_ACTIVE 0
+#endif
+
#include "safe-ctype.h"
#include "symfile.h"
#include "extension.h"
@@ -889,34 +896,19 @@ print_frame_info (struct frame_info *frame, int print_level,
if (annotation_level)
done = identify_source_line (sal.symtab, sal.line, mid_statement,
get_frame_pc (frame));
- if (!done)
+ if (!done && !TUI_ACTIVE)
{
- if (deprecated_print_frame_info_listing_hook)
- deprecated_print_frame_info_listing_hook (sal.symtab,
- sal.line,
- sal.line + 1, 0);
- else
- {
- struct value_print_options opts;
-
- get_user_print_options (&opts);
- /* We used to do this earlier, but that is clearly
- wrong. This function is used by many different
- parts of gdb, including normal_stop in infrun.c,
- which uses this to print out the current PC
- when we stepi/nexti into the middle of a source
- line. Only the command line really wants this
- behavior. Other UIs probably would like the
- ability to decide for themselves if it is desired. */
- if (opts.addressprint && mid_statement)
- {
- uiout->field_core_addr ("addr",
- gdbarch, get_frame_pc (frame));
- uiout->text ("\t");
- }
+ struct value_print_options opts;
- print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
+ get_user_print_options (&opts);
+ if (opts.addressprint && mid_statement)
+ {
+ uiout->field_core_addr ("addr",
+ gdbarch, get_frame_pc (frame));
+ uiout->text ("\t");
}
+
+ print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
}
/* If disassemble-next-line is set to on and there is line debug
diff --git a/gdb/top.c b/gdb/top.c
index 6fac99b..d637209 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -184,12 +184,6 @@ char *lim_at_start;
/* Hooks for alternate command interfaces. */
-/* Called from print_frame_info to list the line we stopped in. */
-
-void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
- int line,
- int stopline,
- int noerror);
/* Replaces most of query. */
int (*deprecated_query_hook) (const char *, va_list);
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 315f5b2..ccc0143 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -160,17 +160,6 @@ tui_refresh_frame_and_register_information (int registers_too_p)
do_cleanups (old_chain);
}
-/* Dummy callback for deprecated_print_frame_info_listing_hook which is called
- from print_frame_info. */
-
-static void
-tui_dummy_print_frame_info_listing_hook (struct symtab *s,
- int line,
- int stopline,
- int noerror)
-{
-}
-
/* Perform all necessary cleanups regarding our module's inferior data
that is required after the inferior INF just exited. */
@@ -219,13 +208,6 @@ static struct observer *tui_register_changed_observer;
void
tui_install_hooks (void)
{
- /* If this hook is not set to something then print_frame_info will
- assume that the CLI, not the TUI, is active, and will print the frame info
- for us in such a way that we are not prepared to handle. This hook is
- otherwise effectively obsolete. */
- deprecated_print_frame_info_listing_hook
- = tui_dummy_print_frame_info_listing_hook;
-
/* Install the event hooks. */
tui_bp_created_observer
= observer_attach_breakpoint_created (tui_event_create_breakpoint);
@@ -247,7 +229,6 @@ tui_install_hooks (void)
void
tui_remove_hooks (void)
{
- deprecated_print_frame_info_listing_hook = 0;
deprecated_query_hook = 0;
/* Remove our observers. */
observer_detach_breakpoint_created (tui_bp_created_observer);
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 06/11] Remove unused deprecated_context_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
2017-02-28 14:50 ` [PATCH 11/11] Remove deprecated_print_frame_info_listing_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 08/11] Remove unused deprecated_{attach|detach}_hook Philipp Rudo
` (10 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_context_hook): Remove.
* top.c (deprecated_context_hook): Remove.
* interps.c (clear_interpreter_hooks): Adjust.
* infrun.c (handle_signal_stop): Adjust.
---
gdb/defs.h | 1 -
gdb/infrun.c | 3 ---
gdb/interps.c | 1 -
gdb/top.c | 4 ----
4 files changed, 9 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index 4f3bdd3..6133eb9 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -672,7 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern void (*deprecated_context_hook) (int);
extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
struct target_waitstatus *status,
int options);
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 1e5e9f1..2085c94 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -5752,9 +5752,6 @@ handle_signal_stop (struct execution_control_state *ecs)
fprintf_unfiltered (gdb_stdlog, "infrun: context switch\n");
context_switch (ecs->ptid);
-
- if (deprecated_context_hook)
- deprecated_context_hook (ptid_to_global_thread_id (ecs->ptid));
}
/* At this point, get hold of the now-current thread's frame. */
diff --git a/gdb/interps.c b/gdb/interps.c
index bc56666..8f122c5 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -391,7 +391,6 @@ clear_interpreter_hooks (void)
deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
- deprecated_context_hook = 0;
deprecated_target_wait_hook = 0;
deprecated_call_command_hook = 0;
deprecated_error_begin_hook = 0;
diff --git a/gdb/top.c b/gdb/top.c
index fd5bd5a..cc5df78 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -213,10 +213,6 @@ ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
void (*deprecated_call_command_hook) (struct cmd_list_element * c,
char *cmd, int from_tty);
-/* Called when the current thread changes. Argument is thread id. */
-
-void (*deprecated_context_hook) (int id);
-
/* The highest UI number ever assigned. */
static int highest_ui_num;
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 08/11] Remove unused deprecated_{attach|detach}_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
2017-02-28 14:50 ` [PATCH 11/11] Remove deprecated_print_frame_info_listing_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 06/11] Remove unused deprecated_context_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 10/11] Remove unused deprecated_ui_load_progress_hook Philipp Rudo
` (9 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses these hooks anymore. So simply remove them.
gdb/ChangeLog
* defs.h (deprecated_attach_hook, deprecated_detach_hook): Remove.
* top.c (deprecated_attach_hook, deprecated_detach_hook): Remove.
* infcmd.c (attach_post_wait, detach_command)
(disconnect_command): Adjust.
* target.c (generic_mourn_inferior): Adjust.
---
gdb/defs.h | 2 --
gdb/infcmd.c | 7 -------
gdb/target.c | 3 ---
gdb/top.c | 6 ------
4 files changed, 18 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index 3c97825..a52db88 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -672,8 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-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);
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index d836162..93d8c3e 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2752,8 +2752,6 @@ attach_post_wait (char *args, int from_tty, enum attach_post_wait_mode mode)
/* Tell the user/frontend where we're stopped. */
normal_stop ();
- if (deprecated_attach_hook)
- deprecated_attach_hook ();
}
}
@@ -3008,9 +3006,6 @@ detach_command (char *args, int from_tty)
threads. */
if (!have_inferiors ())
init_thread_list ();
-
- if (deprecated_detach_hook)
- deprecated_detach_hook ();
}
/* Disconnect from the current target without resuming it (leaving it
@@ -3030,8 +3025,6 @@ disconnect_command (char *args, int from_tty)
target_disconnect (args, from_tty);
no_shared_libraries (NULL, from_tty);
init_thread_list ();
- if (deprecated_detach_hook)
- deprecated_detach_hook ();
}
void
diff --git a/gdb/target.c b/gdb/target.c
index 0ff8515..3820fb7 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3336,9 +3336,6 @@ generic_mourn_inferior (void)
reopen_exec_file ();
reinit_frame_cache ();
-
- if (deprecated_detach_hook)
- deprecated_detach_hook ();
}
\f
/* Convert a normal process ID to a string. Returns the string in a
diff --git a/gdb/top.c b/gdb/top.c
index 0ddef13..e33caf4 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -194,12 +194,6 @@ void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int (*deprecated_query_hook) (const char *, va_list);
-/* Called as appropriate to notify the interface that we have attached
- to or detached from an already running process. */
-
-void (*deprecated_attach_hook) (void);
-void (*deprecated_detach_hook) (void);
-
/* Used by UI as a wrapper around command execution. May do various
things like enabling/disabling buttons, etc... */
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 10/11] Remove unused deprecated_ui_load_progress_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (2 preceding siblings ...)
2017-02-28 14:50 ` [PATCH 08/11] Remove unused deprecated_{attach|detach}_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 03/11] Remove unused deprecated_warning_hook Philipp Rudo
` (8 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_ui_load_progress_hook): Remove.
* symfile.c (deprecated_ui_load_progress_hook): Remove.
(load_progress): Adjust.
---
gdb/defs.h | 3 ---
gdb/symfile.c | 7 +------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index b7df0dc..e15ddf7 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -673,9 +673,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern int (*deprecated_ui_load_progress_hook) (const char *section,
- unsigned long num);
-
/* If this definition isn't overridden by the header files, assume
that isatty and fileno exist on this system. */
#ifndef ISATTY
diff --git a/gdb/symfile.c b/gdb/symfile.c
index a749a2c..bc85c1b 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -65,8 +65,6 @@
#include "psymtab.h"
-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,
@@ -1968,10 +1966,7 @@ load_progress (ULONGEST bytes, void *untyped_arg)
args->buffer += bytes;
totals->write_count += 1;
args->section_sent += bytes;
- if (check_quit_flag ()
- || (deprecated_ui_load_progress_hook != NULL
- && deprecated_ui_load_progress_hook (args->section_name,
- args->section_sent)))
+ if (check_quit_flag ())
error (_("Canceled the download"));
if (deprecated_show_load_progress != NULL)
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 03/11] Remove unused deprecated_warning_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (3 preceding siblings ...)
2017-02-28 14:50 ` [PATCH 10/11] Remove unused deprecated_ui_load_progress_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 02/11] Remove unused deprecated_ui_loop_hook Philipp Rudo
` (7 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_warning_hook): Remove.
* top.c (deprecated_warning_hook): Remove.
* complaints.c (vcomplaint): Adjust.
* interps.c (clear_interpreter_hooks): Adjust.
* utils.c (vwarning): Adjust.
---
gdb/complaints.c | 2 --
gdb/defs.h | 2 --
gdb/interps.c | 1 -
gdb/top.c | 4 ----
gdb/utils.c | 33 ++++++++++++++-------------------
5 files changed, 14 insertions(+), 28 deletions(-)
diff --git a/gdb/complaints.c b/gdb/complaints.c
index dc60dc3..587a039 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -185,8 +185,6 @@ vcomplaint (struct complaints **c, const char *file,
if (complaint->file != NULL)
internal_vwarning (complaint->file, complaint->line, fmt, args);
- else if (deprecated_warning_hook)
- (*deprecated_warning_hook) (fmt, args);
else
{
if (complaints->explanation == NULL)
diff --git a/gdb/defs.h b/gdb/defs.h
index c92c41f..2052dd7 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -672,8 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern void (*deprecated_warning_hook) (const char *, va_list)
- ATTRIBUTE_FPTR_PRINTF(1,0);
extern void (*deprecated_interactive_hook) (void);
extern void (*deprecated_readline_begin_hook) (char *, ...)
ATTRIBUTE_FPTR_PRINTF_1;
diff --git a/gdb/interps.c b/gdb/interps.c
index af86390..1336aaa 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -391,7 +391,6 @@ clear_interpreter_hooks (void)
deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
- deprecated_warning_hook = 0;
deprecated_interactive_hook = 0;
deprecated_readline_begin_hook = 0;
deprecated_readline_hook = 0;
diff --git a/gdb/top.c b/gdb/top.c
index 934f25d..4428b87 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -194,10 +194,6 @@ void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int (*deprecated_query_hook) (const char *, va_list);
-/* Replaces most of warning. */
-
-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 deprecated_readline_begin_hook is
called with a text string that might be (for example) a message for
diff --git a/gdb/utils.c b/gdb/utils.c
index 27021a1..987373a 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -399,27 +399,22 @@ free_current_contents (void *ptr)
void
vwarning (const char *string, va_list args)
{
- if (deprecated_warning_hook)
- (*deprecated_warning_hook) (string, args);
- else
- {
- struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
-
- if (target_supports_terminal_ours ())
- {
- make_cleanup_restore_target_terminal ();
- target_terminal_ours_for_output ();
- }
- if (filtered_printing_initialized ())
- wrap_here (""); /* Force out any buffered output. */
- gdb_flush (gdb_stdout);
- if (warning_pre_print)
- fputs_unfiltered (warning_pre_print, gdb_stderr);
- vfprintf_unfiltered (gdb_stderr, string, args);
- fprintf_unfiltered (gdb_stderr, "\n");
+ struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
- do_cleanups (old_chain);
+ if (target_supports_terminal_ours ())
+ {
+ make_cleanup_restore_target_terminal ();
+ target_terminal_ours_for_output ();
}
+ if (filtered_printing_initialized ())
+ wrap_here (""); /* Force out any buffered output. */
+ gdb_flush (gdb_stdout);
+ if (warning_pre_print)
+ fputs_unfiltered (warning_pre_print, gdb_stderr);
+ vfprintf_unfiltered (gdb_stderr, string, args);
+ fprintf_unfiltered (gdb_stderr, "\n");
+
+ do_cleanups (old_chain);
}
/* Print an error message and return to command level.
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 02/11] Remove unused deprecated_ui_loop_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (4 preceding siblings ...)
2017-02-28 14:50 ` [PATCH 03/11] Remove unused deprecated_warning_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 09/11] Remove unused deprecated_call_command_hook Philipp Rudo
` (6 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_ui_loop_hook): Remove.
* top.c (deprecated_ui_loop_hook): Remove.
* remote-sim.c (gdbsim_interrupt): Adjust.
* ser-base.c (do_ser_base_readchar): Adjust.
* ser-tcp.c (POLL_INTERVAL): Adjust comment.
(wait_for_connect): Adjust.
* ser-unix.c (do_hardwire_readchar): Adjust.
* serial.h (serial_rc): Adjust comment.
* windows-nat.c (windows_wait): Adjust.
---
gdb/defs.h | 1 -
gdb/remote-sim.c | 3 ---
gdb/ser-base.c | 13 -------------
gdb/ser-tcp.c | 11 +----------
gdb/ser-unix.c | 15 ---------------
gdb/serial.h | 5 +----
gdb/top.c | 8 --------
gdb/windows-nat.c | 10 ----------
8 files changed, 2 insertions(+), 64 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index b3086b9..c92c41f 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -661,7 +661,6 @@ struct target_waitstatus;
struct cmd_list_element;
extern void (*selected_frame_level_changed_hook) (int);
-extern int (*deprecated_ui_loop_hook) (int signo);
extern void (*deprecated_show_load_progress) (const char *section,
unsigned long section_sent,
unsigned long section_size,
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index b0c68c6..5df6aae 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -951,9 +951,6 @@ gdbsim_interrupt (struct target_ops *self, ptid_t ptid)
static int
gdb_os_poll_quit (host_callback *p)
{
- if (deprecated_ui_loop_hook != NULL)
- deprecated_ui_loop_hook (0);
-
if (check_quit_flag ()) /* gdb's idea of quit */
return 1;
return 0;
diff --git a/gdb/ser-base.c b/gdb/ser-base.c
index 3e10033..b465836 100644
--- a/gdb/ser-base.c
+++ b/gdb/ser-base.c
@@ -329,19 +329,6 @@ do_ser_base_readchar (struct serial *scb, int timeout)
delta = (timeout == 0 ? 0 : 1);
while (1)
{
- /* N.B. The UI may destroy our world (for instance by calling
- remote_stop,) in which case we want to get out of here as
- quickly as possible. It is not safe to touch scb, since
- someone else might have freed it. The
- deprecated_ui_loop_hook signals that we should exit by
- returning 1. */
-
- if (deprecated_ui_loop_hook)
- {
- if (deprecated_ui_loop_hook (0))
- return SERIAL_TIMEOUT;
- }
-
status = ser_base_wait_for (scb, delta);
if (timeout > 0)
timeout -= delta;
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index 57a7c55..aa65a53 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -75,7 +75,7 @@ static int tcp_auto_retry = 1;
static unsigned int tcp_retry_limit = 15;
-/* How many times per second to poll deprecated_ui_loop_hook. */
+/* How many times per second to poll. */
#define POLL_INTERVAL 5
@@ -89,15 +89,6 @@ wait_for_connect (struct serial *scb, unsigned int *polls)
struct timeval t;
int n;
- /* While we wait for the connect to complete,
- poll the UI so it can update or the user can
- interrupt. */
- if (deprecated_ui_loop_hook && deprecated_ui_loop_hook (0))
- {
- errno = EINTR;
- return -1;
- }
-
/* Check for timeout. */
if (*polls > tcp_retry_limit * POLL_INTERVAL)
{
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index b9e55f0..6c2f700 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -517,7 +517,6 @@ static int
do_hardwire_readchar (struct serial *scb, int timeout)
{
int status, delta;
- int detach = 0;
if (timeout > 0)
timeout++;
@@ -532,20 +531,6 @@ do_hardwire_readchar (struct serial *scb, int timeout)
delta = (timeout == 0 ? 0 : 1);
while (1)
{
-
- /* N.B. The UI may destroy our world (for instance by calling
- remote_stop,) in which case we want to get out of here as
- quickly as possible. It is not safe to touch scb, since
- someone else might have freed it. The
- deprecated_ui_loop_hook signals that we should exit by
- returning 1. */
-
- if (deprecated_ui_loop_hook)
- detach = deprecated_ui_loop_hook (0);
-
- if (detach)
- return SERIAL_TIMEOUT;
-
scb->timeout_remaining = (timeout < 0 ? timeout : timeout - delta);
status = wait_for (scb, delta);
diff --git a/gdb/serial.h b/gdb/serial.h
index cf4e659..979288b 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -100,10 +100,7 @@ extern void serial_un_fdopen (struct serial *scb);
enum serial_rc {
SERIAL_ERROR = -1, /* General error. */
- SERIAL_TIMEOUT = -2, /* Timeout or data-not-ready during read.
- Unfortunately, through
- deprecated_ui_loop_hook (), this can also
- be a QUIT indication. */
+ SERIAL_TIMEOUT = -2, /* Timeout or data-not-ready during read. */
SERIAL_EOF = -3 /* General end-of-file or remote target
connection closed, indication. Includes
things like the line dropping dead. */
diff --git a/gdb/top.c b/gdb/top.c
index 6bf9d8c..934f25d 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -184,14 +184,6 @@ char *lim_at_start;
/* Hooks for alternate command interfaces. */
-/* 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 non-zero if the user is requesting a detach, zero
- otherwise. */
-
-int (*deprecated_ui_loop_hook) (int);
-
-
/* Called from print_frame_info to list the line we stopped in. */
void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 9cc755f..87f6a5b 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1662,16 +1662,6 @@ windows_wait (struct target_ops *ops,
if (retval)
return ptid_build (current_event.dwProcessId, 0, retval);
- else
- {
- int detach = 0;
-
- if (deprecated_ui_loop_hook != NULL)
- detach = deprecated_ui_loop_hook (0);
-
- if (detach)
- windows_kill_inferior (ops);
- }
}
}
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 09/11] Remove unused deprecated_call_command_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (5 preceding siblings ...)
2017-02-28 14:50 ` [PATCH 02/11] Remove unused deprecated_ui_loop_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 01/11] Remove unused deprecated_{pre|post}_add_symbol_hook Philipp Rudo
` (5 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_call_command_hook): Remove.
* top.c (deprecated_call_command_hook): Remove.
(execute_command): Adjust.
* interps.c (clear_interpreter_hooks): Adjust.
---
gdb/defs.h | 2 --
gdb/interps.c | 1 -
gdb/top.c | 8 --------
3 files changed, 11 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index a52db88..b7df0dc 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -672,8 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
- char *cmd, int from_tty);
extern int (*deprecated_ui_load_progress_hook) (const char *section,
unsigned long num);
diff --git a/gdb/interps.c b/gdb/interps.c
index 4cc9ae5..aaab99c 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -391,7 +391,6 @@ clear_interpreter_hooks (void)
deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
- deprecated_call_command_hook = 0;
deprecated_error_begin_hook = 0;
}
diff --git a/gdb/top.c b/gdb/top.c
index e33caf4..6fac99b 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -194,12 +194,6 @@ void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int (*deprecated_query_hook) (const char *, va_list);
-/* Used by UI as a wrapper around command execution. May do various
- things like enabling/disabling buttons, etc... */
-
-void (*deprecated_call_command_hook) (struct cmd_list_element * c,
- char *cmd, int from_tty);
-
/* The highest UI number ever assigned. */
static int highest_ui_num;
@@ -618,8 +612,6 @@ execute_command (char *p, int from_tty)
do_show_command (arg, from_tty, c);
else if (!cmd_func_p (c))
error (_("That is not a command, just a help topic."));
- else if (deprecated_call_command_hook)
- deprecated_call_command_hook (c, arg, from_tty);
else
cmd_func (c, arg, from_tty);
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 01/11] Remove unused deprecated_{pre|post}_add_symbol_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (6 preceding siblings ...)
2017-02-28 14:50 ` [PATCH 09/11] Remove unused deprecated_call_command_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 14:50 ` [PATCH 05/11] Remove unused deprecated_readline{_begin|_end}_hook Philipp Rudo
` (4 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses those hooks anymore. So simply remove them.
gdb/ChangeLog
* defs.h (deprecated_pre_add_symbol_hook)
(deprecated_post_add_symbol_hook): Remove.
* symfile.c (deprecated_pre_add_symbol_hook)
(deprecated_post_add_symbol_hook): Remove.
(symbol_file_add_with_addrs): Adjust.
---
gdb/defs.h | 2 --
gdb/symfile.c | 18 ++++--------------
2 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index aa58605..b3086b9 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -660,8 +660,6 @@ extern char *interpreter_p;
struct target_waitstatus;
struct cmd_list_element;
-extern void (*deprecated_pre_add_symbol_hook) (const char *);
-extern void (*deprecated_post_add_symbol_hook) (void);
extern void (*selected_frame_level_changed_hook) (int);
extern int (*deprecated_ui_loop_hook) (int signo);
extern void (*deprecated_show_load_progress) (const char *section,
diff --git a/gdb/symfile.c b/gdb/symfile.c
index f2528fc..a749a2c 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -72,8 +72,6 @@ void (*deprecated_show_load_progress) (const char *section,
unsigned long section_size,
unsigned long total_sent,
unsigned long total_size);
-void (*deprecated_pre_add_symbol_hook) (const char *);
-void (*deprecated_post_add_symbol_hook) (void);
static void clear_symtab_users_cleanup (void *ignore);
@@ -1174,14 +1172,9 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name,
performed, or need to read an unmapped symbol table. */
if (should_print)
{
- if (deprecated_pre_add_symbol_hook)
- deprecated_pre_add_symbol_hook (name);
- else
- {
- printf_unfiltered (_("Reading symbols from %s..."), name);
- wrap_here ("");
- gdb_flush (gdb_stdout);
- }
+ printf_unfiltered (_("Reading symbols from %s..."), name);
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
}
syms_from_objfile (objfile, addrs, add_flags);
@@ -1212,10 +1205,7 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name,
if (should_print)
{
- if (deprecated_post_add_symbol_hook)
- deprecated_post_add_symbol_hook ();
- else
- printf_unfiltered (_("done.\n"));
+ printf_unfiltered (_("done.\n"));
}
/* We print some messages regardless of whether 'from_tty ||
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 05/11] Remove unused deprecated_readline{_begin|_end}_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (7 preceding siblings ...)
2017-02-28 14:50 ` [PATCH 01/11] Remove unused deprecated_{pre|post}_add_symbol_hook Philipp Rudo
@ 2017-02-28 14:50 ` Philipp Rudo
2017-02-28 15:28 ` [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Tom Tromey
` (3 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 14:50 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses those hooks anymore. So simply remove them.
gdb/ChangeLog
* defs.h (deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook): Remove.
* top.c (deprecated_readline_begin_hook, deprecated_readline_hook)
(deprecated_readline_end_hook): Remove.
(command_line_input): Adjust.
* cli/cli-scrip.c (read_next_line, read_command_lines) Adjust.
* interps.c (clear_interpreter_hooks): Adjust.
---
gdb/cli/cli-script.c | 21 +++------------------
gdb/defs.h | 4 ----
gdb/interps.c | 3 ---
gdb/top.c | 24 +-----------------------
4 files changed, 4 insertions(+), 48 deletions(-)
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index c3f1c65..9603261 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -889,8 +889,7 @@ read_next_line (void)
error (_("Control nesting too deep!"));
/* Set a prompt based on the nesting of the control commands. */
- if (from_tty
- || (ui->instream == 0 && deprecated_readline_hook != NULL))
+ if (from_tty)
{
for (i = 0; i < control_level; i++)
control_prompt[i] = ' ';
@@ -1216,17 +1215,8 @@ read_command_lines (char *prompt_arg, int from_tty, int parse_commands,
if (from_tty && input_interactive_p (current_ui))
{
- if (deprecated_readline_begin_hook)
- {
- /* Note - intentional to merge messages with no newline. */
- (*deprecated_readline_begin_hook) ("%s %s\n", prompt_arg,
- END_MESSAGE);
- }
- else
- {
- printf_unfiltered ("%s\n%s\n", prompt_arg, END_MESSAGE);
- gdb_flush (gdb_stdout);
- }
+ printf_unfiltered ("%s\n%s\n", prompt_arg, END_MESSAGE);
+ gdb_flush (gdb_stdout);
}
@@ -1245,11 +1235,6 @@ read_command_lines (char *prompt_arg, int from_tty, int parse_commands,
do_cleanups (old_chain);
}
- if (from_tty && input_interactive_p (current_ui)
- && deprecated_readline_end_hook)
- {
- (*deprecated_readline_end_hook) ();
- }
return (head);
}
diff --git a/gdb/defs.h b/gdb/defs.h
index f83fd8a..4f3bdd3 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -672,10 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern void (*deprecated_readline_begin_hook) (char *, ...)
- ATTRIBUTE_FPTR_PRINTF_1;
-extern char *(*deprecated_readline_hook) (const char *);
-extern void (*deprecated_readline_end_hook) (void);
extern void (*deprecated_context_hook) (int);
extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
struct target_waitstatus *status,
diff --git a/gdb/interps.c b/gdb/interps.c
index 560ba70..bc56666 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -391,9 +391,6 @@ clear_interpreter_hooks (void)
deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
- deprecated_readline_begin_hook = 0;
- deprecated_readline_hook = 0;
- deprecated_readline_end_hook = 0;
deprecated_context_hook = 0;
deprecated_target_wait_hook = 0;
deprecated_call_command_hook = 0;
diff --git a/gdb/top.c b/gdb/top.c
index 3f8dfa9..fd5bd5a 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -194,22 +194,6 @@ void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int (*deprecated_query_hook) (const char *, va_list);
-/* 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) (const char *);
-void (*deprecated_readline_end_hook) (void);
-
/* Called as appropriate to notify the interface that we have attached
to or detached from an already running process. */
@@ -1263,16 +1247,10 @@ command_line_input (const char *prompt_arg, int repeat, char *annotation_suffix)
}
/* Don't use fancy stuff if not talking to stdin. */
- if (deprecated_readline_hook
+ if (command_editing_p
&& from_tty
&& input_interactive_p (current_ui))
{
- rl = (*deprecated_readline_hook) (prompt);
- }
- else if (command_editing_p
- && from_tty
- && input_interactive_p (current_ui))
- {
rl = gdb_readline_wrapper (prompt);
}
else
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (8 preceding siblings ...)
2017-02-28 14:50 ` [PATCH 05/11] Remove unused deprecated_readline{_begin|_end}_hook Philipp Rudo
@ 2017-02-28 15:28 ` Tom Tromey
2017-02-28 15:52 ` Simon Marchi
2017-02-28 18:01 ` [PATCH 04/11] Remove unused deprecated_interactive_hook Philipp Rudo
` (2 subsequent siblings)
12 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2017-02-28 15:28 UTC (permalink / raw)
To: Philipp Rudo; +Cc: gdb-patches, arnez
>>>>> "Philipp" == Philipp Rudo <prudo@linux.vnet.ibm.com> writes:
Philipp> this series cleans up several hooks in defs.h which were deprecated in 2004
Philipp> (9a4105ab). Most of these hooks are no longer used and can be removed without
Philipp> problem.
You also have to check Insight. It's often the sole remaining user of a
given hook.
I don't know whether Insight is still supported or if being able to
build it is still worthwhile to gdb; but in the past this is why these
hooks weren't removed.
Tom
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h
2017-02-28 15:28 ` [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Tom Tromey
@ 2017-02-28 15:52 ` Simon Marchi
2017-03-01 9:11 ` Philipp Rudo
0 siblings, 1 reply; 17+ messages in thread
From: Simon Marchi @ 2017-02-28 15:52 UTC (permalink / raw)
To: Tom Tromey; +Cc: Philipp Rudo, gdb-patches, arnez, Patrick Monnerat
On 2017-02-28 10:28, Tom Tromey wrote:
> I don't know whether Insight is still supported or if being able to
> build it is still worthwhile to gdb; but in the past this is why these
> hooks weren't removed.
[CCing Patrick, maintainer of Insight]
AFAIK, we are doing a best effort of keeping Insight happy. I've
adapted some of my patches and Insight in the past to keep Insight
building, and it was not an effort of significant size (things like
changing a function signature).
However, I think we are in a weird position where we have some
deprecated features used by a program that we don't want to break, but
that will most likely not change to stop using these features. If we
want to exit that endless loop some day, I guess Insight should be
converted to use MI, like other frontends.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h
2017-02-28 15:52 ` Simon Marchi
@ 2017-03-01 9:11 ` Philipp Rudo
2017-03-01 22:17 ` Yao Qi
0 siblings, 1 reply; 17+ messages in thread
From: Philipp Rudo @ 2017-03-01 9:11 UTC (permalink / raw)
To: Simon Marchi
Cc: Tom Tromey, gdb-patches, arnez, Patrick Monnerat, Keith Seitz
Hi
thanks for pointing out that these hooks are still in use...
On Tue, 28 Feb 2017 10:52:54 -0500
Simon Marchi <simon.marchi@polymtl.ca> wrote:
> On 2017-02-28 10:28, Tom Tromey wrote:
> > I don't know whether Insight is still supported or if being able to
> > build it is still worthwhile to gdb; but in the past this is why
> > these hooks weren't removed.
>
> [CCing Patrick, maintainer of Insight]
>
> AFAIK, we are doing a best effort of keeping Insight happy. I've
> adapted some of my patches and Insight in the past to keep Insight
> building, and it was not an effort of significant size (things like
> changing a function signature).
>
> However, I think we are in a weird position where we have some
> deprecated features used by a program that we don't want to break,
> but that will most likely not change to stop using these features.
> If we want to exit that endless loop some day, I guess Insight should
> be converted to use MI, like other frontends.
This really is a tricky situation. I think converting to MI will be
the best for insight. Although I fear that this will be a bigger
task. What I found out when I looked at deprecated_query_hook (still
used in MI interpreter) this is not so simple as setting this hook only
changes GDBs behavior on certain conditions. Such that just checking
for "interp->is_mi_like ()" would not help. I fear for insight this
will be similar.
@Patrick: Can you estimate how much work convering to MI would be?
From https://sourceware.org/ml/gdb-patches/2017-02/msg00730.html
Keith> However, I don't think this patch should be dismissed solely
Keith> because Insight still uses them. [Insight was "kicked out" of
Keith> the official GDB repository several years ago.]
Keith>
Keith> Instead, I would like to ask maintainers to consider
Keith> that the "true" deprecation of these hooks be phased in over
Keith> a release or three to give time to either replace
Keith> them or assess how much time may be needed to properly replace
Keith> these hooks.
Considering that insight still uses the hooks waiting for N releases so
they have time to adept sounds fair.
By the way, is there something like a deprecation policy for GDB? Or a
place where deprecated features are collected? If not a policy like
"When GDB deprecates features they are prefixed with 'deprecated_' and
deleted N releases after deprecation. Deprecated features and their
time of deletion are collected in the Wiki/NEWS/FIXME."
might be good. What would that mean for code in GDB which still uses
those features? As mentioned before MI also uses two of those
deprecated hooks. Furthermore other parts of GDB also have deprecated
features...
$ git grep -n -e extern --and -e deprecated -- *.h
annotate.h:101:extern void (*deprecated_annotate_signalled_hook) (void);
annotate.h:102:extern void (*deprecated_annotate_signal_hook) (void);
command.h:218:extern void deprecated_cmd_warning (const char *);
command.h:264:extern show_value_ftype deprecated_show_value_hack;
defs.h:663:extern void (*deprecated_pre_add_symbol_hook) (const char *);
defs.h:664:extern void (*deprecated_post_add_symbol_hook) (void);
defs.h:666:extern int (*deprecated_ui_loop_hook) (int signo);
defs.h:667:extern void (*deprecated_show_load_progress) (const char *section,
defs.h:672:extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
defs.h:676:extern int (*deprecated_query_hook) (const char *, va_list)
defs.h:678:extern void (*deprecated_warning_hook) (const char *, va_list)
defs.h:680:extern void (*deprecated_interactive_hook) (void);
defs.h:681:extern void (*deprecated_readline_begin_hook) (char *, ...)
defs.h:683:extern char *(*deprecated_readline_hook) (const char *);
defs.h:684:extern void (*deprecated_readline_end_hook) (void);
defs.h:685:extern void (*deprecated_context_hook) (int);
defs.h:686:extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
defs.h:690:extern void (*deprecated_attach_hook) (void);
defs.h:691:extern void (*deprecated_detach_hook) (void);
defs.h:692:extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
defs.h:695:extern int (*deprecated_ui_load_progress_hook) (const char *section,
frame.h:740:extern int deprecated_frame_register_read (struct frame_info *frame, int regnum,
frame.h:830:extern struct frame_info *deprecated_safe_get_selected_frame (void);
gdbarch.h:388:extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
gdbarch.h:389:extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
gdbarch.h:600:extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
gdbarch.h:601:extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
gdbarch.h:1745:extern void deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
gdbcore.h:131:extern void (*deprecated_exec_file_display_hook) (const char *filename);
gdbcore.h:136:extern void (*deprecated_file_changed_hook) (char *filename);
gdbcore.h:237:extern void deprecated_add_core_fns (struct core_fns *cf);
target.h:2327:extern void add_deprecated_target_alias (struct target_ops *t, char *alias);
tracepoint.h:305:extern void (*deprecated_trace_find_hook) (char *arg, int from_tty);
tracepoint.h:306:extern void (*deprecated_trace_start_stop_hook) (int start, int from_tty);
utils.h:297:extern void (*deprecated_error_begin_hook) (void);
value.h:110:extern void deprecated_set_value_type (struct value *value,
value.h:145:extern int deprecated_value_modifiable (const struct value *value);
value.h:414:extern enum lval_type *deprecated_value_lval_hack (struct value *);
value.h:434:extern struct internalvar **deprecated_value_internalvar_hack (struct value *);
value.h:441:extern struct frame_id *deprecated_value_next_frame_id_hack (struct value *);
value.h:451:extern int *deprecated_value_regnum_hack (struct value *);
Philipp
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h
2017-03-01 9:11 ` Philipp Rudo
@ 2017-03-01 22:17 ` Yao Qi
0 siblings, 0 replies; 17+ messages in thread
From: Yao Qi @ 2017-03-01 22:17 UTC (permalink / raw)
To: Philipp Rudo
Cc: Simon Marchi, Tom Tromey, gdb-patches, Andreas Arnez,
Patrick Monnerat, Keith Seitz
On 17-03-01 10:11:32, Philipp Rudo wrote:
> >
> > However, I think we are in a weird position where we have some
> > deprecated features used by a program that we don't want to break,
> > but that will most likely not change to stop using these features.
> > If we want to exit that endless loop some day, I guess Insight should
> > be converted to use MI, like other frontends.
>
> This really is a tricky situation. I think converting to MI will be
> the best for insight. Although I fear that this will be a bigger
> task. What I found out when I looked at deprecated_query_hook (still
> used in MI interpreter) this is not so simple as setting this hook only
> changes GDBs behavior on certain conditions. Such that just checking
> for "interp->is_mi_like ()" would not help. I fear for insight this
> will be similar.
>
> @Patrick: Can you estimate how much work convering to MI would be?
Why is it MI? MI is for inter-process communication between front-end,
such as Emacs and Eclipse, and GDB. The way Insight using GDB doesn't
fall in this model. It just build with GDB source with gdbtk. There is
no inter-process communication. Observer is a better choice.
Andrew Cagney introduced observers and the deprecated hooks in 2004.
https://sourceware.org/ml/gdb-patches/2004-04/msg00271.html
Some of hooks were replaced by observers, but there are still some
leftovers, as we see today. To be clear, I don't suggest we need to
convert these hooks to observers now.
> From https://sourceware.org/ml/gdb-patches/2017-02/msg00730.html
> Keith> However, I don't think this patch should be dismissed solely
> Keith> because Insight still uses them. [Insight was "kicked out" of
> Keith> the official GDB repository several years ago.]
> Keith>
> Keith> Instead, I would like to ask maintainers to consider
> Keith> that the "true" deprecation of these hooks be phased in over
> Keith> a release or three to give time to either replace
> Keith> them or assess how much time may be needed to properly replace
> Keith> these hooks.
>
> Considering that insight still uses the hooks waiting for N releases so
> they have time to adept sounds fair.
>
> By the way, is there something like a deprecation policy for GDB? Or a
> place where deprecated features are collected? If not a policy like
>
> "When GDB deprecates features they are prefixed with 'deprecated_' and
> deleted N releases after deprecation. Deprecated features and their
> time of deletion are collected in the Wiki/NEWS/FIXME."
Insight is a special case, because GDB isn't compiled with/for other
programs, so the interfaces are CLI and MI. AFAIK, we have
deprecated_cmd_warning. We deprecated some hooks in 2004, but we
didn't provide alternatives.
>
> might be good. What would that mean for code in GDB which still uses
> those features? As mentioned before MI also uses two of those
> deprecated hooks. Furthermore other parts of GDB also have deprecated
> features...
>
If these deprecated_ functions are not used by Insight, we are free to
remove them.
> frame.h:740:extern int deprecated_frame_register_read (struct frame_info *frame, int regnum,
> frame.h:830:extern struct frame_info *deprecated_safe_get_selected_frame (void);
> gdbarch.h:388:extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
> gdbarch.h:389:extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
> gdbarch.h:600:extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
> gdbarch.h:601:extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
> gdbarch.h:1745:extern void deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
> gdbcore.h:237:extern void deprecated_add_core_fns (struct core_fns *cf);
We can remove them, no problem.
> target.h:2327:extern void add_deprecated_target_alias (struct target_ops *t, char *alias);
> tracepoint.h:305:extern void (*deprecated_trace_find_hook) (char *arg, int from_tty);
> tracepoint.h:306:extern void (*deprecated_trace_start_stop_hook) (int start, int from_tty);
These two hooks are not used at all.
> value.h:110:extern void deprecated_set_value_type (struct value *value,
> value.h:145:extern int deprecated_value_modifiable (const struct value *value);
> value.h:414:extern enum lval_type *deprecated_value_lval_hack (struct value *);
> value.h:434:extern struct internalvar **deprecated_value_internalvar_hack (struct value *);
> value.h:441:extern struct frame_id *deprecated_value_next_frame_id_hack (struct value *);
> value.h:451:extern int *deprecated_value_regnum_hack (struct value *);
We can remove them too.
--
Yao
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 04/11] Remove unused deprecated_interactive_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (9 preceding siblings ...)
2017-02-28 15:28 ` [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Tom Tromey
@ 2017-02-28 18:01 ` Philipp Rudo
2017-02-28 19:37 ` [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Keith Seitz
2017-02-28 19:45 ` [PATCH 07/11] Remove unused deprecated_target_wait_hook Philipp Rudo
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 18:01 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_interactive_hook): Remove.
* top.c (deprecated_interactive_hook): Remove.
* interps.c (clear_interpreter_hooks): Adjust.
* utils.c (maybe_quit): Adjust.
---
gdb/defs.h | 1 -
gdb/interps.c | 1 -
gdb/top.c | 5 -----
gdb/utils.c | 3 ---
4 files changed, 10 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index 2052dd7..f83fd8a 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -672,7 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern void (*deprecated_interactive_hook) (void);
extern void (*deprecated_readline_begin_hook) (char *, ...)
ATTRIBUTE_FPTR_PRINTF_1;
extern char *(*deprecated_readline_hook) (const char *);
diff --git a/gdb/interps.c b/gdb/interps.c
index 1336aaa..560ba70 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -391,7 +391,6 @@ clear_interpreter_hooks (void)
deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
- deprecated_interactive_hook = 0;
deprecated_readline_begin_hook = 0;
deprecated_readline_hook = 0;
deprecated_readline_end_hook = 0;
diff --git a/gdb/top.c b/gdb/top.c
index 4428b87..3f8dfa9 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -216,11 +216,6 @@ void (*deprecated_readline_end_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 (*deprecated_interactive_hook) (void);
-
/* Called when going to wait for the target. Usually allows the GUI
to run while waiting for target events. */
diff --git a/gdb/utils.c b/gdb/utils.c
index 987373a..ed193d3 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -955,9 +955,6 @@ maybe_quit (void)
quit ();
quit_handler ();
-
- if (deprecated_interactive_hook)
- deprecated_interactive_hook ();
}
\f
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (10 preceding siblings ...)
2017-02-28 18:01 ` [PATCH 04/11] Remove unused deprecated_interactive_hook Philipp Rudo
@ 2017-02-28 19:37 ` Keith Seitz
2017-02-28 19:45 ` [PATCH 07/11] Remove unused deprecated_target_wait_hook Philipp Rudo
12 siblings, 0 replies; 17+ messages in thread
From: Keith Seitz @ 2017-02-28 19:37 UTC (permalink / raw)
To: gdb-patches
On 02/28/2017 06:50 AM, Philipp Rudo wrote:
> this series cleans up several hooks in defs.h which were deprecated in 2004
> (9a4105ab). Most of these hooks are no longer used and can be removed without
> problem.
As Tom and Simon have already mentioned, Insight still uses many (all?)
of these. [Don't laugh -- I still use Insight almost daily. I know, too,
that I am not alone.]
However, I don't think this patch should be dismissed solely because
Insight still uses them. [Insight was "kicked out" of the official GDB
repository several years ago.]
Instead, I would like to ask maintainers to consider that the "true"
deprecation of these hooks be phased in over a release or three to give
time to either replace them or assess how much time may be needed to
properly replace these hooks.
Keith
For the record, hooks currently used by Insight:
deprecated_ui_loop_hook
deprecated_call_command_hook
deprecated_readline_begin_hook
deprecated_readline_hook
deprecated_readline_end_hook
deprecated_print_frame_info_listing_hook
deprecated_query_hook
deprecated_warning_hook
deprecated_interactive_hook
deprecated_target_wait_hook
deprecated_ui_load_progress_hook
deprecated_ui_loop_hook
deprecated_pre_add_symbol_hook
deprecated_post_add_symbol_hook
deprecated_file_changed_hook
deprecated_attach_hook
deprecated_detach_hook
deprecated_context_hook
deprecated_error_begin_hook
deprecated_annotate_signal_hook
deprecated_annotate_signalled_hook
deprecated_warning_hook
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 07/11] Remove unused deprecated_target_wait_hook
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
` (11 preceding siblings ...)
2017-02-28 19:37 ` [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Keith Seitz
@ 2017-02-28 19:45 ` Philipp Rudo
12 siblings, 0 replies; 17+ messages in thread
From: Philipp Rudo @ 2017-02-28 19:45 UTC (permalink / raw)
To: gdb-patches; +Cc: arnez
Nobody actually uses this hook anymore. So simply remove it.
gdb/ChangeLog
* defs.h (deprecated_target_wait_hook): Remove.
* top.c (deprecated_target_wait_hook): Remove.
* interps.c (clear_interpreter_hooks): Adjust.
* infrun.c (get_last_target_status): Adjust comment.
(do_target_wait, wait_one): Adjust.
---
gdb/defs.h | 4 ----
gdb/infrun.c | 23 ++++++-----------------
gdb/interps.c | 1 -
gdb/top.c | 7 -------
4 files changed, 6 insertions(+), 29 deletions(-)
diff --git a/gdb/defs.h b/gdb/defs.h
index 6133eb9..3c97825 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -672,10 +672,6 @@ extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int noerror);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
-extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
- struct target_waitstatus *status,
- int options);
-
extern void (*deprecated_attach_hook) (void);
extern void (*deprecated_detach_hook) (void);
extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 2085c94..104c91b 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -389,8 +389,8 @@ show_stop_on_solib_events (struct ui_file *file, int from_tty,
static int stop_print_frame;
/* This is a cached copy of the pid/waitstatus of the last event
- returned by target_wait()/deprecated_target_wait_hook(). This
- information is returned by get_last_target_status(). */
+ returned by target_wait(). This information is returned by
+ get_last_target_status(). */
static ptid_t target_last_wait_ptid;
static struct target_waitstatus target_last_waitstatus;
@@ -3514,7 +3514,6 @@ random_pending_event_thread (ptid_t waiton_ptid)
static ptid_t
do_target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
{
- ptid_t event_ptid;
struct thread_info *tp;
/* First check if there is a resumed thread with a wait status
@@ -3630,13 +3629,7 @@ do_target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
}
/* But if we don't find one, we'll have to wait. */
-
- if (deprecated_target_wait_hook)
- event_ptid = deprecated_target_wait_hook (ptid, status, options);
- else
- event_ptid = target_wait (ptid, status, options);
-
- return event_ptid;
+ return target_wait (ptid, status, options);
}
/* Prepare and stabilize the inferior for detaching it. E.g.,
@@ -4050,9 +4043,8 @@ set_last_target_status (ptid_t ptid, struct target_waitstatus status)
}
/* Return the cached copy of the last pid/waitstatus returned by
- 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(). */
+ target_wait(). The data is actually cached by handle_inferior_event(),
+ which gets called immediately after target_wait(). */
void
get_last_target_status (ptid_t *ptidp, struct target_waitstatus *status)
@@ -4341,10 +4333,7 @@ wait_one (struct target_waitstatus *ws)
don't get any event. */
target_dcache_invalidate ();
- if (deprecated_target_wait_hook)
- event_ptid = deprecated_target_wait_hook (wait_ptid, ws, 0);
- else
- event_ptid = target_wait (wait_ptid, ws, 0);
+ event_ptid = target_wait (wait_ptid, ws, 0);
if (debug_infrun)
print_target_wait_results (wait_ptid, event_ptid, ws);
diff --git a/gdb/interps.c b/gdb/interps.c
index 8f122c5..4cc9ae5 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -391,7 +391,6 @@ clear_interpreter_hooks (void)
deprecated_print_frame_info_listing_hook = 0;
/*print_frame_more_info_hook = 0; */
deprecated_query_hook = 0;
- deprecated_target_wait_hook = 0;
deprecated_call_command_hook = 0;
deprecated_error_begin_hook = 0;
}
diff --git a/gdb/top.c b/gdb/top.c
index cc5df78..0ddef13 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -200,13 +200,6 @@ int (*deprecated_query_hook) (const char *, va_list);
void (*deprecated_attach_hook) (void);
void (*deprecated_detach_hook) (void);
-/* Called when going to wait for the target. Usually allows the GUI
- to run while waiting for target events. */
-
-ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
- struct target_waitstatus *status,
- int options);
-
/* Used by UI as a wrapper around command execution. May do various
things like enabling/disabling buttons, etc... */
--
2.8.4
^ permalink raw reply [flat|nested] 17+ messages in thread