From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17386 invoked by alias); 25 May 2018 18:12:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17349 invoked by uid 89); 25 May 2018 18:12:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 May 2018 18:12:09 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16CD14187E24; Fri, 25 May 2018 18:12:08 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97A7863535; Fri, 25 May 2018 18:12:07 +0000 (UTC) Subject: Re: [RFA 4/4] Remove interp_name To: Tom Tromey , gdb-patches@sourceware.org References: <20180430051207.19979-1-tom@tromey.com> <20180430051207.19979-5-tom@tromey.com> From: Pedro Alves Message-ID: <0b5df1d7-ea68-8bb0-bbdf-6a370b35042c@redhat.com> Date: Fri, 25 May 2018 18:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180430051207.19979-5-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00694.txt.bz2 On 04/30/2018 06:12 AM, Tom Tromey wrote: > This removes the interp_name function. It is only used a few spots -- > one of which was only calling it on "this". It's simpler to remove > it; and should class interp become opaque in the future, it will be > just as easy to update the two remaining spots to use an accessor. Yeah, IIRC, it used to be opaque until I C++ified it. Not seeing a need to go back. > > ChangeLog > 2018-04-29 Tom Tromey > > * interps.c (interp_name): Remove. > * mi/mi-interp.c (mi_interp::init): Update. > * interps.h (interp_name): Remove. > (~scoped_restore_interp): Update. > * tui/tui.c (tui_enable): Update. > diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c > index 7943a61676..9e2520b4fc 100644 > --- a/gdb/tui/tui.c > +++ b/gdb/tui/tui.c > @@ -415,7 +415,7 @@ tui_enable (void) > > /* If the top level interpreter is not the console/tui (e.g., > MI), enabling curses will certainly lose. */ > - interp = interp_name (top_level_interpreter ()); > + interp = top_level_interpreter ()->name; > if (strcmp (interp, INTERP_TUI) != 0) > error (_("Cannot enable the TUI when the interpreter is '%s'"), interp); Not sure. The name is supposedly read-only, which would suggest renaming the field to m_name and adding a name() getter. WDYT? Thanks, Pedro Alves