From: Philipp Rudo <prudo@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Cc: arnez@linux.vnet.ibm.com
Subject: [PATCH 05/11] Remove unused deprecated_readline{_begin|_end}_hook
Date: Tue, 28 Feb 2017 14:50:00 -0000 [thread overview]
Message-ID: <20170228145016.22604-6-prudo@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170228145016.22604-1-prudo@linux.vnet.ibm.com>
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
next prev parent reply other threads:[~2017-02-28 14:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 14:50 [PATCH 00/11] Cleanup deprecated_*_hooks in defs.h Philipp Rudo
2017-02-28 14:50 ` [PATCH 09/11] Remove unused deprecated_call_command_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 02/11] Remove unused deprecated_ui_loop_hook Philipp Rudo
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 [this message]
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 ` [PATCH 08/11] Remove unused deprecated_{attach|detach}_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 03/11] Remove unused deprecated_warning_hook Philipp Rudo
2017-02-28 14:50 ` [PATCH 10/11] Remove unused deprecated_ui_load_progress_hook Philipp Rudo
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
2017-03-01 22:17 ` Yao Qi
2017-02-28 18:01 ` [PATCH 04/11] Remove unused deprecated_interactive_hook 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170228145016.22604-6-prudo@linux.vnet.ibm.com \
--to=prudo@linux.vnet.ibm.com \
--cc=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox