public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 1/2] gdb: remove interp_pre_command_loop
Date: Wed,  6 Sep 2023 15:29:09 -0400	[thread overview]
Message-ID: <20230906192916.210156-1-simon.marchi@efficios.com> (raw)

It is a trivial wrapper around the pre_command_loop method, remove it.

Change-Id: Idb2c61f9b68988528006a9a9b2b528f43781eef4
---
 gdb/interps.c | 10 ----------
 gdb/interps.h |  4 ----
 gdb/main.c    |  2 +-
 gdb/ui.c      |  2 +-
 4 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/gdb/interps.c b/gdb/interps.c
index 7baa8491eb19..fa294dfa1a3d 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -262,16 +262,6 @@ command_interp (void)
     return current_ui->current_interpreter;
 }
 
-/* See interps.h.  */
-
-void
-interp_pre_command_loop (struct interp *interp)
-{
-  gdb_assert (interp != NULL);
-
-  interp->pre_command_loop ();
-}
-
 /* See interp.h  */
 
 int
diff --git a/gdb/interps.h b/gdb/interps.h
index c041d0d95b61..95a885d1b691 100644
--- a/gdb/interps.h
+++ b/gdb/interps.h
@@ -261,10 +261,6 @@ extern void clear_interpreter_hooks (void);
    if it uses GDB's own simplified form of readline.  */
 extern int interp_supports_command_editing (struct interp *interp);
 
-/* Called before starting an event loop, to give the interpreter a
-   chance to e.g., print a prompt.  */
-extern void interp_pre_command_loop (struct interp *interp);
-
 /* List the possible interpreters which could complete the given
    text.  */
 extern void interpreter_completer (struct cmd_list_element *ignore,
diff --git a/gdb/main.c b/gdb/main.c
index 3e93f5839472..cf46f6acb208 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -470,7 +470,7 @@ captured_command_loop ()
 
   /* Give the interpreter a chance to print a prompt, if necessary  */
   if (ui->prompt_state != PROMPT_BLOCKED)
-    interp_pre_command_loop (top_level_interpreter ());
+    top_level_interpreter ()->pre_command_loop ();
 
   /* Now it's time to start the event loop.  */
   start_event_loop ();
diff --git a/gdb/ui.c b/gdb/ui.c
index 5fe001262a83..38ec61ea6731 100644
--- a/gdb/ui.c
+++ b/gdb/ui.c
@@ -227,7 +227,7 @@ new_ui_command (const char *args, int from_tty)
 
     set_top_level_interpreter (interpreter_name);
 
-    interp_pre_command_loop (top_level_interpreter ());
+    top_level_interpreter ()->pre_command_loop ();
 
     /* Make sure the file is not closed.  */
     stream.release ();

base-commit: 313b2841b8e9046ea658104988e01bedf6148d5f
-- 
2.42.0


             reply	other threads:[~2023-09-06 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 19:29 Simon Marchi [this message]
2023-09-06 19:29 ` [PATCH 2/2] gdb: remove interp_supports_command_editing Simon Marchi
2023-09-07 18:03   ` Tom Tromey
2023-09-07 18:03 ` [PATCH 1/2] gdb: remove interp_pre_command_loop Tom Tromey
2023-09-08  1:56   ` Simon Marchi

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=20230906192916.210156-1-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).