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]

[patch] fix for infinite recursion in lookup_symbol


Hi, all,

The following patch fixes an infinite recursion in the variable lookup 
code for C++ objects that are specified in mangled form.  The old code 
would take the mangled name into lookup_symbol, unmangle it, and then in 
this bit pass the mangled name BACK to lookup_symbol, which would 
unmangle it and come right back here...  Not a good thing.  The bug 
crept in when lookup_symbol was broken up into lookup_symbol and 
lookup_symbol_aux, the correction is clearly what was meant.

2001-01-09  James Ingham  <jingham@inghji.apple.com>

         * symtab.c (lookup_symbol_aux): Call lookup_symbol_aux to 
lookup a
         mangled symbol rather than recursing into lookup_symbol, since 
this
         will just re-unmangle the name & call lookup_symbol_aux - 
leading to
         an infinite recursion.


Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.15
diff -c -w -r1.15 symtab.c
*** symtab.c    2000/09/04 08:29:25     1.15
--- symtab.c    2001/01/12 19:29:21
***************
*** 754,760 ****
             {
               /* This is a mangled variable, look it up by its
                  mangled name.  */
!             return lookup_symbol (SYMBOL_NAME (msymbol), block,
                                     namespace, is_a_field_of_this, 
symtab);
             }
           /* There are no debug symbols for this file, or we are looking
--- 754,760 ----
             {
               /* This is a mangled variable, look it up by its
                  mangled name.  */
!             return lookup_symbol_aux (SYMBOL_NAME (msymbol), block,
                                     namespace, is_a_field_of_this, 
symtab);
             }
           /* There are no debug symbols for this file, or we are looking

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