This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa] revert my previous search_symbols change, add comment
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: David Carlton <carlton at math dot stanford dot edu>
- Cc: gdb-patches at sources dot redhat dot com, Elena Zannoni <ezannoni at redhat dot com>
- Date: Thu, 20 Feb 2003 15:47:20 -0500
- Subject: Re: [rfa] revert my previous search_symbols change, add comment
- References: <ro13cn3377d.fsf@jackfruit.Stanford.EDU>
David Carlton writes:
> In my patch from 2002-12-23, I changed some code in search_symbols
> from a call to lookup_symbol to a call to lookup_symbol_aux_minsyms.
> At that time, I didn't understand exactly what
> lookup_symbol_aux_minsyms did; now that I understand that function
> better, I don't think that change was a good idea.
>
> So this patch reverts that change. At Andrew's suggestion, I've added
> a comment as well, saying what I'd really like to replace the call to
> lookup_symbol with.
OK
>
> In my next patch, I'll change lookup_symbol_aux_minsyms to actually do
> something correct (now that Daniel has been kind enough to demangle
> partial symbols for me), but I wanted to get this part of the change
> out of the way first.
>
Question, where does the other patch I just replied to stand wrt to this?
Should we forget about the old patch?
elena
> Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2; OK to apply?
>
> David Carlton
> carlton at math dot stanford dot edu
>
> 2003-02-04 David Carlton <carlton at math dot stanford dot edu>
>
> * symtab.c (search_symbols): Revert the search_symbols part of my
> 2002-12-23 patch. Add comment.
>
> Index: symtab.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/symtab.c,v
> retrieving revision 1.87
> diff -u -p -r1.87 symtab.c
> --- symtab.c 4 Feb 2003 18:07:01 -0000 1.87
> +++ symtab.c 4 Feb 2003 23:55:02 -0000
> @@ -2967,31 +2967,18 @@ search_symbols (char *regexp, namespace_
> {
> if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))
> {
> - if (kind == FUNCTIONS_NAMESPACE)
> - {
> - found_misc = 1;
> - }
> - else
> - {
> - struct symbol *sym;
> -
> - if (SYMBOL_DEMANGLED_NAME (msymbol) != NULL)
> - sym
> - = lookup_symbol_aux_minsyms (SYMBOL_DEMANGLED_NAME
> - (msymbol),
> - SYMBOL_NAME (msymbol),
> - VAR_NAMESPACE,
> - NULL, NULL);
> - else
> - sym
> - = lookup_symbol_aux_minsyms (SYMBOL_NAME (msymbol),
> - NULL,
> - VAR_NAMESPACE,
> - NULL, NULL);
> -
> - if (sym == NULL)
> - found_misc = 1;
> - }
> + /* FIXME: carlton/2003-02-04: Given that the
> + semantics of lookup_symbol keeps on changing
> + slightly, it would be a nice idea if we had a
> + function lookup_symbol_minsym that found the
> + symbol associated to a given minimal symbol (if
> + any). */
> + if (kind == FUNCTIONS_NAMESPACE
> + || lookup_symbol (SYMBOL_NAME (msymbol),
> + (struct block *) NULL,
> + VAR_NAMESPACE,
> + 0, (struct symtab **) NULL) == NULL)
> + found_misc = 1;
> }
> }
> }