[binutils-gdb] gdb: remove interp_supports_command_editing

Simon Marchi simark@sourceware.org
Fri Sep 8 01:55:42 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3c11aea0297a3f038e552eee424c214dc5a2c4bc

commit 3c11aea0297a3f038e552eee424c214dc5a2c4bc
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Wed Sep 6 15:29:10 2023 -0400

    gdb: remove interp_supports_command_editing
    
    It is a trivial wrapper around the supports_command_editing method,
    remove it.
    
    Change-Id: I0fe3d7dc69601b3b89f82e055f7fe3d4af1becf7
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 gdb/event-top.c | 4 ++--
 gdb/interps.c   | 8 --------
 gdb/interps.h   | 4 ----
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/gdb/event-top.c b/gdb/event-top.c
index 005ef4b7054..d1be23bcbe9 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -299,8 +299,8 @@ change_line_handler (int editing)
 
   /* Don't try enabling editing if the interpreter doesn't support it
      (e.g., MI).  */
-  if (!interp_supports_command_editing (top_level_interpreter ())
-      || !interp_supports_command_editing (command_interp ()))
+  if (!top_level_interpreter ()->supports_command_editing ()
+      || !command_interp ()->supports_command_editing ())
     return;
 
   if (editing)
diff --git a/gdb/interps.c b/gdb/interps.c
index fa294dfa1a3..adac9812523 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -262,14 +262,6 @@ command_interp (void)
     return current_ui->current_interpreter;
 }
 
-/* See interp.h  */
-
-int
-interp_supports_command_editing (struct interp *interp)
-{
-  return interp->supports_command_editing ();
-}
-
 /* interp_exec - This executes COMMAND_STR in the current 
    interpreter.  */
 
diff --git a/gdb/interps.h b/gdb/interps.h
index 95a885d1b69..287df2c8c81 100644
--- a/gdb/interps.h
+++ b/gdb/interps.h
@@ -257,10 +257,6 @@ extern struct interp *command_interp (void);
 
 extern void clear_interpreter_hooks (void);
 
-/* Returns true if INTERP supports using the readline library; false
-   if it uses GDB's own simplified form of readline.  */
-extern int interp_supports_command_editing (struct interp *interp);
-
 /* List the possible interpreters which could complete the given
    text.  */
 extern void interpreter_completer (struct cmd_list_element *ignore,


More information about the Gdb-cvs mailing list