From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22813 invoked by alias); 7 Dec 2001 18:03:53 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 22770 invoked from network); 7 Dec 2001 18:03:41 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 7 Dec 2001 18:03:41 -0000 Received: from rtl.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA10605; Fri, 7 Dec 2001 10:03:37 -0800 (PST) Received: (from ezannoni@localhost) by rtl.cygnus.com (8.11.2/8.11.0) id fB7I9iB10528; Fri, 7 Dec 2001 13:09:44 -0500 X-Authentication-Warning: krustylu.cygnus.com: ezannoni set sender to ezannoni@cygnus.com using -f From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15377.1512.277568.965798@krustylu.cygnus.com> Date: Fri, 07 Dec 2001 10:03:00 -0000 To: Daniel Jacobowitz Cc: Elena Zannoni , gdb@sources.redhat.com Subject: Re: [Fwd: gdb "call" very slow on large C++ program; 2 possible patches] In-Reply-To: <20011207122951.A22977@nevyn.them.org> References: <3C0FE56A.6070203@cygnus.com> <15375.61776.209451.28772@krustylu.cygnus.com> <15376.60556.71170.277249@krustylu.cygnus.com> <20011207122951.A22977@nevyn.them.org> X-Mailer: VM 6.97 under Emacs 20.7.1 X-SW-Source: 2001-12/txt/msg00082.txt.bz2 Daniel Jacobowitz writes: > On Fri, Dec 07, 2001 at 11:21:32AM -0500, Elena Zannoni wrote: > > Yes, something like that happened. I am thinking to send a patch to > > restore some sanity to this function. But... > > > > ...actually, I think that if search_symbols on FUNCTION_NAMESPACES is > > equivalent to make_symbol_overload_list(), we could just get rid of > > make_symbol_overload_list() *and* overload_list_add_symbol(). > > > > It would be nice to clean this up. > > > > Daniel, does search_symbols produces a correct overload list? At first > > sight it would look so. > > Well, I'm not immediately familiar with this code. At first thought, > there might be some complexity because search_symbols takes a regexp, > but that's easily resolvable. More importantly, > make_symbol_overload_list respects scope. So no, the two are not > equivalent. > I was looking at the fact that make_symbol_overload_list is used only for c++ non-member functions, and that search_symbols limits the search to functions. > I found at least one more bug in overload_list_add_symbol (extraneous > realloc calls) while looking this over, though. I also understand > where those loops came from, more or less; see make_completion_list. > This function (and its comments) need some housecleaning. > Yes, there were calls (which were wrong) to overload_list_add_symbol, in each loop. Sometimes ago, the #if 0 was lost, and so were the calls in the loops. Elena /* Comment and #if 0 from Rajiv Mirani . However, leaving #if 0's around is uncool. We need to figure out what this is really trying to do, decide whether we want that, and either fix it or delete it. --- Jim Blandy, Mar 1999 */ /* ??? RM: What in hell is this? overload_list_add_symbol expects a symbol, * not a partial_symbol or a minimal_symbol. And it looks at the type field * of the symbol, and we don't know the type of minimal and partial symbols */ #if 0 /* Look through the partial symtabs for all symbols which begin by matching OLOAD_NAME. Add each one that you find to the list. */ ALL_PSYMTABS (objfile, ps) { /* If the psymtab's been read in we'll get it when we search through the blockvector. */ if (ps->readin) continue; for (psym = objfile->global_psymbols.list + ps->globals_offset; psym < (objfile->global_psymbols.list + ps->globals_offset + ps->n_global_syms); psym++) { /* If interrupted, then quit. */ QUIT; overload_list_add_symbol (*psym, oload_name); } for (psym = objfile->static_psymbols.list + ps->statics_offset; psym < (objfile->static_psymbols.list + ps->statics_offset + ps->n_static_syms); psym++) { QUIT; overload_list_add_symbol (*psym, oload_name); } } /* At this point scan through the misc symbol vectors and add each symbol you find to the list. Eventually we want to ignore anything that isn't a text symbol (everything else will be handled by the psymtab code above). */ ALL_MSYMBOLS (objfile, msymbol) { QUIT; overload_list_add_symbol (msymbol, oload_name); } #endif /* Search upwards from currently selected frame (so that we can complete on local vars. */