From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28764 invoked by alias); 29 Nov 2004 02:12:33 -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 27962 invoked from network); 29 Nov 2004 02:12:27 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 29 Nov 2004 02:12:27 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iAT2CRAp010957 for ; Sun, 28 Nov 2004 21:12:27 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iAT2CMr11530 for ; Sun, 28 Nov 2004 21:12:22 -0500 Received: from localhost.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id iAT2CLQB010441; Sun, 28 Nov 2004 21:12:21 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id F27FF1A467A; Sun, 28 Nov 2004 21:08:21 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16810.33941.938548.637890@localhost.redhat.com> Date: Mon, 29 Nov 2004 02:12:00 -0000 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Improve "start" command for Ada In-Reply-To: <20041101194703.GH27334@gnat.com> References: <20041021034759.GP21300@gnat.com> <01c4b72e$Blat.v2.2.2$b14feb80@zahav.net.il> <20041021210951.GZ21300@gnat.com> <20041101194703.GH27334@gnat.com> X-SW-Source: 2004-11/txt/msg00502.txt.bz2 Joel Brobecker writes: > Ping? (doco already approved by Eli) > > On Thu, Oct 21, 2004 at 02:09:51PM -0700, Joel Brobecker wrote: > > 2004-10-20 Joel Brobecker > > > > * doc/observer.texi (executable_changed): New observer. > > * symtab.c: Include "observer.h". > > (find_main_name): New function. > > (main_name): If name_of_main is unset, then compute it > > using find_main_name. > > (symtab_observer_executable_changed): New function. > > (_initialize_symtab): Attach executable_changed observer. > > * exec.c: Include "observer.h". > > (exec_file_attach): Emit executable_changed notification. > > * symfile.c: Include "observer.h". > > (reread_symbols): Send an executable_changed if appropriate. > > * Makefile.in (exec.o): Add dependency on observer.h. > > (symfile.o): Likewise. > > (symtab.o): Likewise. > > > > Tested on x86-linux. Still fixes 1 FAIL in gdb.ada/null_record.exp. > > We need a testcase where the name of the executable is changed, and this code is exercised. Otherwise ok, except for this: > > +/* Deduce the name of the main procedure, and set NAME_OF_MAIN > > + accordingly. */ > > + > > +static void > > +find_main_name (void) > > +{ > > + char *new_main_name; > > + > > + /* Try to see if the main procedure is in Ada. */ > > + new_main_name = ada_main_name (); > > + if (new_main_name != NULL) > > + { > > + set_main_name (new_main_name); > > + return; > > + } > > + > > + /* The languages above didn't identify the name of the main procedure. > > + Fallback to "main". */ > > + set_main_name ("main"); > > +} > > + > > char * > > main_name (void) > > { > > - if (name_of_main != NULL) > > - return name_of_main; > > - else > > - return "main"; > > + if (name_of_main == NULL) > > + find_main_name (); > > + > > + return name_of_main; > > } > > Can this find_main_name become an element in the language vector? I really don't want to have a special language cases in the symtab file.