This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] fix for infinite recursion in lookup_symbol
- To: gdb-patches at sources dot redhat dot com
- Subject: [patch] fix for infinite recursion in lookup_symbol
- From: Jim Ingham <jingham at apple dot com>
- Date: Fri, 12 Jan 2001 11:35:34 -0800
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