From patchwork Tue Feb 28 14:50:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rudo X-Patchwork-Id: 19401 Received: (qmail 17239 invoked by alias); 28 Feb 2017 14:50:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17082 invoked by uid 89); 28 Feb 2017 14:50:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=121617, do_cleanups, (unknown), old_chain X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Feb 2017 14:50:28 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1SEmtte138439 for ; Tue, 28 Feb 2017 09:50:27 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 28w2hcs3pv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 28 Feb 2017 09:50:27 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 28 Feb 2017 14:50:25 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 28 Feb 2017 14:50:23 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0D4D42190023 for ; Tue, 28 Feb 2017 14:49:24 +0000 (GMT) Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1SEoMNC10027362; Tue, 28 Feb 2017 14:50:22 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D05B52076; Tue, 28 Feb 2017 13:48:58 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id E299152069; Tue, 28 Feb 2017 13:48:57 +0000 (GMT) From: Philipp Rudo 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 15:50:10 +0100 In-Reply-To: <20170228145016.22604-1-prudo@linux.vnet.ibm.com> References: <20170228145016.22604-1-prudo@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022814-0040-0000-0000-000003530BB2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022814-0041-0000-0000-00001F1229A0 Message-Id: <20170228145016.22604-6-prudo@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-28_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702280136 X-IsSubscribed: yes 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