From patchwork Tue Feb 28 14:50:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Rudo X-Patchwork-Id: 19406 Received: (qmail 18094 invoked by alias); 28 Feb 2017 14:50:38 -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 18007 invoked by uid 89); 28 Feb 2017 14:50:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 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=observers, sk:identif, registers_too_p, sk:tui_ref 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:34 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1SEn3Rt123506 for ; Tue, 28 Feb 2017 09:50:34 -0500 Received: from e06smtp09.uk.ibm.com (e06smtp09.uk.ibm.com [195.75.94.105]) by mx0a-001b2d01.pphosted.com with ESMTP id 28w9ruw7fw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 28 Feb 2017 09:50:33 -0500 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 28 Feb 2017 14:50:31 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp09.uk.ibm.com (192.168.101.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 28 Feb 2017 14:50:30 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id B91B5219004D for ; Tue, 28 Feb 2017 14:49:30 +0000 (GMT) Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1SEoTuh12517712; Tue, 28 Feb 2017 14:50:29 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D83CD52059; Tue, 28 Feb 2017 13:49:04 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id BCACF5204E; Tue, 28 Feb 2017 13:49:04 +0000 (GMT) From: Philipp Rudo To: gdb-patches@sourceware.org Cc: arnez@linux.vnet.ibm.com Subject: [PATCH 11/11] Remove deprecated_print_frame_info_listing_hook Date: Tue, 28 Feb 2017 15:50:16 +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-0036-0000-0000-000003770BFC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022814-0037-0000-0000-000015472E6D Message-Id: <20170228145016.22604-12-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 This patch removes deprecated_print_frame_info_listing_hook. In contrast to the previous patches this one needs to change some functionality for the TUI front-end. According to the comment in tui/tui-hooks.c:tui_install_hooks the hook is only used to tell print_frame_info that TUI is active. So check directly if tui_active is set and remove deprecated_print_frame_info_listing_hook. A quick test shows that this patch does not change TUIs behavior. Nevertheless it would be better if somebody with more experience with TUI takes a look at it. gdb/ChangeLog * defs.h (deprecated_print_frame_info_listing_hook): Remove. * top.c (deprecated_print_frame_info_listing_hook): Remove. * stack.c (tui/tui.h): New include. (TUI_ACTIVE): New define. (print_frame_info): Adjust. * tui/tui-hooks (tui_dummy_print_frame_info_listing_hook): Remove. (tui_install_hooks, tui_remove_hooks): Adjust. * interps.c (clear_interpreter_hooks): Adjust. --- gdb/defs.h | 4 ---- gdb/interps.c | 1 - gdb/stack.c | 42 +++++++++++++++++------------------------- gdb/top.c | 6 ------ gdb/tui/tui-hooks.c | 19 ------------------- 5 files changed, 17 insertions(+), 55 deletions(-) diff --git a/gdb/defs.h b/gdb/defs.h index e15ddf7..ac51ed2 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -666,10 +666,6 @@ extern void (*deprecated_show_load_progress) (const char *section, unsigned long section_size, unsigned long total_sent, unsigned long total_size); -extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, - int line, - int stopline, - int noerror); extern int (*deprecated_query_hook) (const char *, va_list) ATTRIBUTE_FPTR_PRINTF(1,0); diff --git a/gdb/interps.c b/gdb/interps.c index aaab99c..2d983d6 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -388,7 +388,6 @@ interp_exec (struct interp *interp, const char *command_str) void clear_interpreter_hooks (void) { - deprecated_print_frame_info_listing_hook = 0; /*print_frame_more_info_hook = 0; */ deprecated_query_hook = 0; deprecated_error_begin_hook = 0; diff --git a/gdb/stack.c b/gdb/stack.c index aa3a80e..d13ec30 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -48,6 +48,13 @@ #include "cli/cli-utils.h" #include "objfiles.h" +#ifdef TUI +#include "tui/tui.h" +#define TUI_ACTIVE tui_active +#else +#define TUI_ACTIVE 0 +#endif + #include "safe-ctype.h" #include "symfile.h" #include "extension.h" @@ -889,34 +896,19 @@ print_frame_info (struct frame_info *frame, int print_level, if (annotation_level) done = identify_source_line (sal.symtab, sal.line, mid_statement, get_frame_pc (frame)); - if (!done) + if (!done && !TUI_ACTIVE) { - if (deprecated_print_frame_info_listing_hook) - deprecated_print_frame_info_listing_hook (sal.symtab, - sal.line, - sal.line + 1, 0); - else - { - struct value_print_options opts; - - get_user_print_options (&opts); - /* We used to do this earlier, but that is clearly - wrong. This function is used by many different - parts of gdb, including normal_stop in infrun.c, - which uses this to print out the current PC - when we stepi/nexti into the middle of a source - line. Only the command line really wants this - behavior. Other UIs probably would like the - ability to decide for themselves if it is desired. */ - if (opts.addressprint && mid_statement) - { - uiout->field_core_addr ("addr", - gdbarch, get_frame_pc (frame)); - uiout->text ("\t"); - } + struct value_print_options opts; - print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); + get_user_print_options (&opts); + if (opts.addressprint && mid_statement) + { + uiout->field_core_addr ("addr", + gdbarch, get_frame_pc (frame)); + uiout->text ("\t"); } + + print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); } /* If disassemble-next-line is set to on and there is line debug diff --git a/gdb/top.c b/gdb/top.c index 6fac99b..d637209 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -184,12 +184,6 @@ char *lim_at_start; /* Hooks for alternate command interfaces. */ -/* Called from print_frame_info to list the line we stopped in. */ - -void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, - int line, - int stopline, - int noerror); /* Replaces most of query. */ int (*deprecated_query_hook) (const char *, va_list); diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index 315f5b2..ccc0143 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -160,17 +160,6 @@ tui_refresh_frame_and_register_information (int registers_too_p) do_cleanups (old_chain); } -/* Dummy callback for deprecated_print_frame_info_listing_hook which is called - from print_frame_info. */ - -static void -tui_dummy_print_frame_info_listing_hook (struct symtab *s, - int line, - int stopline, - int noerror) -{ -} - /* Perform all necessary cleanups regarding our module's inferior data that is required after the inferior INF just exited. */ @@ -219,13 +208,6 @@ static struct observer *tui_register_changed_observer; void tui_install_hooks (void) { - /* If this hook is not set to something then print_frame_info will - assume that the CLI, not the TUI, is active, and will print the frame info - for us in such a way that we are not prepared to handle. This hook is - otherwise effectively obsolete. */ - deprecated_print_frame_info_listing_hook - = tui_dummy_print_frame_info_listing_hook; - /* Install the event hooks. */ tui_bp_created_observer = observer_attach_breakpoint_created (tui_event_create_breakpoint); @@ -247,7 +229,6 @@ tui_install_hooks (void) void tui_remove_hooks (void) { - deprecated_print_frame_info_listing_hook = 0; deprecated_query_hook = 0; /* Remove our observers. */ observer_detach_breakpoint_created (tui_bp_created_observer);