From patchwork Tue Jan 6 15:55:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 4526 Received: (qmail 8924 invoked by alias); 6 Jan 2015 15:58:09 -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 8903 invoked by uid 89); 6 Jan 2015 15:58:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout26.012.net.il Received: from mtaout26.012.net.il (HELO mtaout26.012.net.il) (80.179.55.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jan 2015 15:58:07 +0000 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NHR00F00IV2UX00@mtaout26.012.net.il> for gdb-patches@sourceware.org; Tue, 06 Jan 2015 17:55:26 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NHR00I0OIWEOLN0@mtaout26.012.net.il>; Tue, 06 Jan 2015 17:55:26 +0200 (IST) Date: Tue, 06 Jan 2015 17:55:59 +0200 From: Eli Zaretskii Subject: Re: [PATCHSET] [2/4] Fix various issue in TUI In-reply-to: <54AAE1D9.9000409@redhat.com> To: Pedro Alves Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <834ms39a40.fsf@gnu.org> References: <83y4pnbtnc.fsf@gnu.org> <54AAE1D9.9000409@redhat.com> X-IsSubscribed: yes > Date: Mon, 05 Jan 2015 19:11:21 +0000 > From: Pedro Alves > > > --- gdb/tui/tui-hooks.c~0 2014-06-11 18:34:41 +0300 > > +++ gdb/tui/tui-hooks.c 2014-12-31 14:41:11 +0200 > > @@ -247,12 +247,23 @@ > > tui_display_main (); > > } > > > > +/* Refresh the display when settings important to us change. */ > > +static void > > +tui_note_setting_change (const char *param, const char *value) > > +{ > > + if (tui_active > > + && strncmp (param, "tui ", sizeof ("tui ") - 1) == 0 > > + && tui_update_variables ()) > > + tui_rehighlight_all (); > > +} > > + > > Please do this from the "set" hook of the relevant commands instead. > IOW, replace NULL below (and in the other commands): > > add_setshow_enum_cmd ("active-border-mode", no_class, tui_border_mode_enums, > &tui_active_border_mode, _("\ > ... > NULL, > show_tui_active_border_mode, > &tui_setlist, &tui_showlist); Like this? 2015-01-06 Eli Zaretskii * tui/tui-win.c (tui_set_var_cmd): New function. (_initialize_tui_win) : : Use tui_set_var_cmd as the "set" function. --- gdb/tui/tui-win.c~2 2015-01-04 08:07:30 +0200 +++ gdb/tui/tui-win.c 2015-01-06 08:03:05 +0200 @@ -346,6 +346,12 @@ tui_get_cmd_list (void) return &tuilist; } +void tui_set_var_cmd (char *null_args, int from_tty, struct cmd_list_element *c) +{ + if (tui_update_variables ()) + tui_rehighlight_all (); +} + /* Function to initialize gdb commands, for tui window manipulation. */ @@ -422,7 +428,7 @@ This variable controls the border of TUI space use a white space\n\ ascii use ascii characters + - | for the border\n\ acs use the Alternate Character Set"), - NULL, + tui_set_var_cmd, show_tui_border_kind, &tui_setlist, &tui_showlist); @@ -438,7 +444,7 @@ half use half bright\n\ half-standout use half bright and standout mode\n\ bold use extra bright or bold\n\ bold-standout use extra bright or bold with standout mode"), - NULL, + tui_set_var_cmd, show_tui_border_mode, &tui_setlist, &tui_showlist); @@ -454,7 +460,7 @@ half use half bright\n\ half-standout use half bright and standout mode\n\ bold use extra bright or bold\n\ bold-standout use extra bright or bold with standout mode"), - NULL, + tui_set_var_cmd, show_tui_active_border_mode, &tui_setlist, &tui_showlist); }