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]

[RFA] symtab.c: Another fix, now for gdb.c++/templates.exp regressions


On AIX and Digital Unix (and I suspect that this will happen on any non-elf
target) I am observing the following regressions:

FAIL: gdb.c++/templates.exp: print Foo<volatile char *>::foo
FAIL: gdb.c++/templates.exp: print Garply<Garply<char> >::garply
FAIL: gdb.c++/templates.exp: break Garply<Garply<char> >::garply

It is caused by passing SYMBOL_NAME instead of SYMBOL_SOURCE_NAME to
lookup_block_symbol, but lookup_block_symbol has been changed via the
2000-10-12 symtab.c patch to do a SYMBOL_SOURCE_NAME lookup (and by the way,
the comments for lookup_block_symbol have _not_ been changed to reflect the
new reality).
Grepping through the GDB sources for all callers of lookup_block_symbol
and making sure that they are not affected by the semantic change to
lookup_block_symbol would have avoided the problem. And `maint check' on
any C++ executable still remains an unresolved issue, but I am getting tired.

Here is a fix for the regression:

	* symtab.c (lookup_symbol_aux):  Call lookup_block_symbol with
	SYMBOL_SOURCE_NAME instead of SYMBOL_NAME, to reflect 2000-10-12
	changes in lookup_block_symbol semantics.

*** gdb/symtab.c.orig	Fri Oct 27 20:07:28 2000
--- gdb/symtab.c	Sat Oct 28 12:53:15 2000
***************
*** 746,752 ****
  	      /* This is a function which has a symtab for its address.  */
  	      bv = BLOCKVECTOR (s);
  	      block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! 	      sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
  					 namespace);
  	      /* We kept static functions in minimal symbol table as well as
  	         in static scope. We want to find them in the symbol table. */
--- 746,752 ----
  	      /* This is a function which has a symtab for its address.  */
  	      bv = BLOCKVECTOR (s);
  	      block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! 	      sym = lookup_block_symbol (block, SYMBOL_SOURCE_NAME (msymbol),
  					 namespace);
  	      /* We kept static functions in minimal symbol table as well as
  	         in static scope. We want to find them in the symbol table. */
***************
*** 753,759 ****
  	      if (!sym)
  		{
  		  block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! 		  sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
  					     namespace);
  		}
  
--- 753,760 ----
  	      if (!sym)
  		{
  		  block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! 		  sym = lookup_block_symbol (block,
! 					     SYMBOL_SOURCE_NAME (msymbol),
  					     namespace);
  		}
  
***************
*** 913,919 ****
  	    {
  	      bv = BLOCKVECTOR (s);
  	      block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! 	      sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
  					 namespace);
  	      /* We kept static functions in minimal symbol table as well as
  	         in static scope. We want to find them in the symbol table. */
--- 914,920 ----
  	    {
  	      bv = BLOCKVECTOR (s);
  	      block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
! 	      sym = lookup_block_symbol (block, SYMBOL_SOURCE_NAME (msymbol),
  					 namespace);
  	      /* We kept static functions in minimal symbol table as well as
  	         in static scope. We want to find them in the symbol table. */
***************
*** 920,926 ****
  	      if (!sym)
  		{
  		  block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! 		  sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
  					     namespace);
  		}
  	      /* If we found one, return it */
--- 921,928 ----
  	      if (!sym)
  		{
  		  block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
! 		  sym = lookup_block_symbol (block,
! 					     SYMBOL_SOURCE_NAME (msymbol),
  					     namespace);
  		}
  	      /* If we found one, return it */

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de

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