This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: patch to write_dollar_variable()



   From: Jim Blandy <jimb@cygnus.com>
   Date: 23 Sep 1999 15:17:00 -0500

   > As previously discussed on the gdb list, this patch is necessary.  At
   > least until symbol table handling is greatly improved... :-)
   > 
   >         --jtc
   > 
   > 
   > 1999-08-20  J.T. Conklin  <jtc@redback.com>
   > 
   > 	* parse.c (write_dollar_variable): If HPUXHPPA is not defined,
   >  	don't search for $ variables in the symbol table.  Worst case
   >  	symbol table lookup performance is extremely poor.  This causes
   >  	GDB scripts that use convenience variables to execute so slowly
   > 	to be almost unusable.

   Testing HPUXHPPA is a mess, though.  How about this?

   1999-09-23  Jim Blandy  <jimb@zwingli.cygnus.com>

	   * parse.c (write_dollar_variable): Don't check the symbol table
	   for identifiers beginning with `$' unless
	   IDENTIFIERS_CAN_START_WITH_DOLLAR is #defined.
	   * config/pa/tm-hppa.h (IDENTIFIERS_CAN_START_WITH_DOLLAR): Define.
	   * doc/gdbint.texinfo (IDENTIFIERS_CAN_START_WITH_DOLLAR): Document.

This is going in the right direction, but to keep in line with our
future, I'd prefer to see a runtime test:

	if (IDENTIFIERS_CAN_START_WITH_DOLLAR)

that is defaulted to 0 somewhere convenient (like at the top of
parse.c).  This shouldn't cost any more, because GCC can optimize out
the whole block on non-HPs, and will always optimize in on HPs.  If
this ends up going through a gdbarch op in the future, there will be a
small extra cost, although I'm sure that there are many better
opportunities for script optimization before this test becomes an
issue.

								Stan

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