From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20932 invoked by alias); 20 Nov 2001 16:47:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20834 invoked from network); 20 Nov 2001 16:47:00 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sourceware.cygnus.com with SMTP; 20 Nov 2001 16:47:00 -0000 Received: from rtl.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id IAA21000; Tue, 20 Nov 2001 08:46:54 -0800 (PST) Received: (from ezannoni@localhost) by rtl.cygnus.com (8.11.2/8.11.0) id fAKGrKS01303; Tue, 20 Nov 2001 11:53:20 -0500 X-Authentication-Warning: krustylu.cygnus.com: ezannoni set sender to ezannoni@cygnus.com using -f From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15354.35456.69218.258303@krustylu.cygnus.com> Date: Thu, 08 Nov 2001 02:06:00 -0000 To: Keith Seitz Cc: , Elena Zannoni Subject: Re: [RFA] top.c: initialize other UIs before cli In-Reply-To: References: X-Mailer: VM 6.97 under Emacs 20.7.1 X-SW-Source: 2001-11/txt/msg00148.txt.bz2 Keith Seitz writes: > Sorry for the self-reply, but I didn't add any comments on this little > hack... > > Reposted below. > Whoops. Sorry Keith, I approved it w/o cc-ing the list. For the record, approved. Elena > On Mon, 19 Nov 2001, Keith Seitz wrote: > > > Hi, > > > > There is currently a little problem with init_ui_hook: if the UI fails to > > initialize (and we should fall back to "gdb -nw"), then the CLI will NOT > > get initialized properly. > > > > This results because init_ui_hook does not return any status indicating > > the failure. > > > > This simple change will correct this anomaly without altering init_ui_hook > > semantics, i.e., it is absolutely the least intrusive. > > > > ? > > Keith > > > > ChangeLog > > 2001-11-19 Keith Seitz > > > > * top.c (gdb_init): Call init_ui_hook before initializing > > the default UI. > > > > Patch > Index: top.c > =================================================================== > RCS file: /cvs/src/src/gdb/top.c,v > retrieving revision 1.48 > diff -u -p -r1.48 top.c > --- top.c 2001/11/10 21:34:56 1.48 > +++ top.c 2001/11/19 21:01:02 > @@ -182,8 +182,11 @@ static void stop_sig (int); > /* Hooks for alternate command interfaces. */ > > /* Called after most modules have been initialized, but before taking users > - command file. */ > + command file. > > + If the UI fails to initialize and it wants GDB to continue > + using the default UI, then it should clear this hook before returning. */ > + > void (*init_ui_hook) (char *argv0); > > /* This hook is called from within gdb's many mini-event loops which could > @@ -2034,6 +2037,11 @@ gdb_init (char *argv0) > set_language (language_c); > expected_language = current_language; /* don't warn about the change. */ > > + /* Allow another UI to initialize. If the UI fails to initialize, and > + it wants GDB to revert to the CLI, it should clear init_ui_hook. */ > + if (init_ui_hook) > + init_ui_hook (argv0); > + > #ifdef UI_OUT > /* Install the default UI */ > if (!init_ui_hook) > @@ -2050,7 +2058,4 @@ gdb_init (char *argv0) > } > } > #endif > - > - if (init_ui_hook) > - init_ui_hook (argv0); > }