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:symtab] SYMBOL_LOCATION_FUNCS -> SYMBOL_OPS


Hello,

This patch generalizes the per-symbol location_funcs, replacing them with a symbol_ops vector (the contents are unchanged). The patch doesn't change the size of the symbol.

As the comment hints:

+  /* NOTE: cagney/2003-11-02: The fields "aclass" and "ops" contain
+     overlaping information.  Since GDB has only a small finite number
+     of symbol classes it should be possible to merge the two fields
+     into a single ops-table "index".  Each entry providing both the
+     "ops" and the "aclass" values.  Doing that would shave 32 bits
+     off every symbol.  */

The patch sets us up for a more significant change - merge "ops" and "aclass" - and hence eliminates 32 bits (or 20%) of each symbol. I should note that right now the details of the merge are "left as an exercise for the reader".

ok?

Ping? I revised the comment thus:


  /* NOTE: cagney/2003-11-02: The fields "aclass" and "ops" contain
     overlapping information.  By creating a per-aclass ops vector, or
     using the aclass as an index into an ops table, the aclass and
     ops fields can be merged.  The latter, for instance, would shave
     32-bits from each symbol (relative to a symbol lookup, any table
     index overhead would be in the noise).  */

Andrew

2003-11-08 Andrew Cagney <cagney@redhat.com>

	* dwarf2loc.c (dwarf_expr_frame_base): Use SYMBOL_OPS instead of
	SYMBOL_LOCATION_FUNCS
	(dwarf2_loclist_funcs, dwarf2_locexpr_funcs): Change type to
	"struct symbol_ops".
	* dwarf2loc.h (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Change
	type to "struct symbol_ops".
	* dwarf2read.c (dwarf2_symbol_mark_computed): Set SYMBOL_OPS
	intead of SYMBOL_LOCATION_FUNCS.
	* ax-gdb.c (gen_var_ref): Ditto for "tracepoint_var_ref".
	* printcmd.c (address_info): Ditto for "describe_location".
	* findvar.c (symbol_read_needs_frame): Call "read_needs_frame"
	when available.  Assert requirement when LOC_COMPUTED or
	LOC_COMPUTED_ARG.
	(read_var_value): Ditto for "read_variable".
	* symtab.h (struct symbol_ops): Rename "struct location_funcs".
	(struct symbol): Replace ".aux_value.loc.funcs" and
	".aux_value.loc.baton" with ".ops" and ".aux_value.ptr".
	(SYMBOL_OBJFILE): Delete macro.
	(SYMBOL_LOCATION_FUNCS): Delete macro.
	(SYMBOL_LOCATION_BATON): Update.


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