From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13041 invoked by alias); 21 Nov 2002 22:54:06 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12719 invoked from network); 21 Nov 2002 22:54:04 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 21 Nov 2002 22:54:04 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 10DB93E4B; Thu, 21 Nov 2002 17:53:58 -0500 (EST) Message-ID: <3DDD6405.2090805@redhat.com> Date: Thu, 21 Nov 2002 14:54:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephane Carrez Cc: gdb-patches@sources.redhat.com, drow@mvista.com Subject: Re: [5.3 PATCH]: Fix TUI breaking gdb interpreters (mi) References: <3DDD5D91.3010500@nerim.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00527.txt.bz2 > Hi! > > Daniel Jacobowitz wrote: >> Two problems: >> TUI broke the MI interface if TUI is enabled at compile time. The change >> which did this does was on Sept. 10th, 2002. There's a typo in the >> ChangeLog which made it hard to find... >> >> * tui-hooks.c (tui_event_loop): New function. >> (tui_command_loop): New function to override gdb loop and make sure >> uiout is set according to TUI mode. >> (tui_command_loop): Install the specific TUI command hook. >> >> (the second tui_command_loop should have been tui_init_hook). >> >> You can't just override the command loop that way! MI does this >> conditionally on -i=mi being specified. >> >> This also breaks the bit at the end of gdb/top.c to handle unknown -i= >> switches. > > Too bad... For the mainline, the thing to do is probably mimic insight: - if the tui sees interpreter_p == "tui" then set things up for the tui. That way -i=tui works. - have the --tui option set interpreter_p to "tui". - create an executable called tui, linked with tui.c (instead of gdb.c) that sets the interpreter to tui (see insight's insight.c) before calling the wrapped main. That way, the program `tui` will start the tui but `gdb` will still start GDB. Andrew > I've committed this patch to avoid the TUI initialization when some interpreter > was specified (It does not make sense to enable TUI when there such interpreter). > I also fixed the ChangeLog typo. > > gdb -i=mi seems to work after that (at least better than without it). > > Stephane > > 2002-11-21 Stephane Carrez > > * tui-hooks.c (tui_init_hook): Don't enable the TUI if a specific > interpreter is installed. > > > > Index: tui-hooks.c > =================================================================== > RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v > retrieving revision 1.7.2.1 > diff -u -p -r1.7.2.1 tui-hooks.c > --- tui-hooks.c 10 Sep 2002 20:00:55 -0000 1.7.2.1 > +++ tui-hooks.c 21 Nov 2002 21:13:02 -0000 > @@ -420,6 +420,10 @@ tui_event_loop (void) > static void > tui_init_hook (char *argv0) > { > + /* Don't enable the TUI if a specific interpreter is installed. */ > + if (interpreter_p) > + return; > + > /* Install exit handler to leave the screen in a good shape. */ > atexit (tui_exit); >