This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Improve "start" command for Ada


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  <brobecker@gnat.com>
 > > 
 > >         * 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]