This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [patch] fix for infinite recursion in lookup_symbol
- To: Jim Ingham <jingham at apple dot com>
- Subject: Re: [patch] fix for infinite recursion in lookup_symbol
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Fri, 12 Jan 2001 15:12:56 -0500
- CC: gdb-patches at sources dot redhat dot com, insight at sources dot redhat dot com
- Organization: Red Hat , Inc. - Toronto
- References: <200101121935.LAA03678@scv2.apple.com>
Jim,
You saved my life!
This causes Insight to crash. One case I saw is that there were C++ methods
starting with "main", so the look for main to show in the Source Window would
cause a memory exhaust situation. The other case is when a the Variable Balloons
try to show some overloaded symbol and it also goes into loop.
TO THE INSIGHT LIST FOLKS WHO WERE HAVING THOSE PROBLEMS: Can you please
try Jim's patch and let us know if it fixed your problems? Thanks.
Fernando
Jim Ingham wrote:
>
> 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
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9