From patchwork Wed Sep 6 19:29:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 75393 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80626385840A for ; Wed, 6 Sep 2023 19:29:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80626385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694028583; bh=aIn/xZxbCugh8MMF4CY2mTsenzwReTM0LBRS8eHPrug=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=wX+Co8QN9WnrslRPbELIrhXRaWK45Zy/GnJo+dFF+tUpTCPL3yjBA/vNIqGBB21D9 U7al3OZFnKJeK/pcZ5BbJnLNGIsBl6a4FycMV66ZH3pTc1h1KSkReGclnWZX2DNadi M1sgT0JCLF2yh8AEBqGxmGb+Okd7MRVDbdB6J/Gw= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3AA623857721 for ; Wed, 6 Sep 2023 19:29:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AA623857721 Received: from localhost.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8E8AE1E092; Wed, 6 Sep 2023 15:29:17 -0400 (EDT) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/2] gdb: remove interp_pre_command_loop Date: Wed, 6 Sep 2023 15:29:09 -0400 Message-ID: <20230906192916.210156-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1173.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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(-) base-commit: 313b2841b8e9046ea658104988e01bedf6148d5f 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 (); From patchwork Wed Sep 6 19:29:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 75395 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AA5BD3857727 for ; Wed, 6 Sep 2023 19:30:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA5BD3857727 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694028605; bh=OxB98lEIS/2rxrd/qc46kQg/QeRIyGJGkpEjHT4AH6M=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=F61LzE42VTdEAEup2yk6vX4ZjBEBoEeWHSmwA+zqryIdmSjx0ehb1rszGnYAKkojn j83QsKUO0Co8wR+lsOGhp0IVksfbjeCUU9M3q1OMlZyi/gIVRT5aImn5xvBIzUusLi NmpX2grcCv1STAv1tDxZ7qfikko/EarbyiQIO05g= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3805A385771C for ; Wed, 6 Sep 2023 19:29:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3805A385771C Received: from localhost.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BC6C91E0C2; Wed, 6 Sep 2023 15:29:17 -0400 (EDT) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 2/2] gdb: remove interp_supports_command_editing Date: Wed, 6 Sep 2023 15:29:10 -0400 Message-ID: <20230906192916.210156-2-simon.marchi@efficios.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230906192916.210156-1-simon.marchi@efficios.com> References: <20230906192916.210156-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1173.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" It is a trivial wrapper around the supports_command_editing method, remove it. Change-Id: I0fe3d7dc69601b3b89f82e055f7fe3d4af1becf7 --- 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 005ef4b7054d..d1be23bcbe9b 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 fa294dfa1a3d..adac98125239 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 95a885d1b691..287df2c8c810 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,