From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7130 invoked by alias); 24 Apr 2002 08:13:14 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7106 invoked from network); 24 Apr 2002 08:13:12 -0000 Received: from unknown (HELO pizda.ninka.net) (216.101.162.242) by sources.redhat.com with SMTP; 24 Apr 2002 08:13:12 -0000 Received: from localhost (IDENT:davem@localhost.localdomain [127.0.0.1]) by pizda.ninka.net (8.9.3/8.9.3) with ESMTP id BAA26878; Wed, 24 Apr 2002 01:03:43 -0700 Date: Wed, 24 Apr 2002 01:13:00 -0000 Message-Id: <20020424.010342.116378338.davem@redhat.com> To: ezannoni@redhat.com Cc: kevinb@redhat.com, Peter.Schauer@regent.e-technik.tu-muenchen.de, gdb@sources.redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] Kill SOFUN_ADDRESS_MAYBE_MISSING From: "David S. Miller" In-Reply-To: <15557.45152.933354.110197@localhost.redhat.com> References: <1020422152449.ZM1373@localhost.localdomain> <20020423.030048.41805003.davem@redhat.com> <15557.45152.933354.110197@localhost.redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00920.txt.bz2 From: Elena Zannoni Date: Tue, 23 Apr 2002 15:05:04 -0400 If we are willing to add a filename to each minimal symbol everytime, then we could get rid of the uses of the second type, being this much less risky. If this is an acceptable overhead, we can get rid of the ifdefs in symmisc.c, symtab.h, minsyms.c (this stuff was added in 1995 by Jim Kingdon). Ok, below is a patch implementing that. If we decide that the overhead is acceptable, someone can review this for installation. I've commented and worked on as much of your email as I can by myself, the rest requires input/commentary from other people. 2002-04-24 David S. Miller * symmisc.c, symtab.h, minsyms.c (whole file): Act as if SOFUN_ADDRESS_MAYBE_MISSING was always defined, kill ifdefs. --- ./symmisc.c.~1~ Fri Mar 22 10:57:08 2002 +++ ./symmisc.c Wed Apr 24 01:02:44 2002 @@ -321,10 +321,8 @@ dump_msymbols (struct objfile *objfile, { fprintf_filtered (outfile, " %s", SYMBOL_DEMANGLED_NAME (msymbol)); } -#ifdef SOFUN_ADDRESS_MAYBE_MISSING if (msymbol->filename) fprintf_filtered (outfile, " %s", msymbol->filename); -#endif fputs_filtered ("\n", outfile); } if (objfile->minimal_symbol_count != index) --- ./symtab.h.~1~ Wed Apr 24 00:15:32 2002 +++ ./symtab.h Wed Apr 24 01:02:50 2002 @@ -258,10 +258,8 @@ struct minimal_symbol char *info; -#ifdef SOFUN_ADDRESS_MAYBE_MISSING /* Which source file is this symbol in? Only relevant for mst_file_*. */ char *filename; -#endif /* Classification types for this symbol. These should be taken as "advisory only", since if gdb can't easily figure out a classification it simply --- ./minsyms.c.~1~ Wed Apr 24 00:16:29 2002 +++ ./minsyms.c Wed Apr 24 01:03:08 2002 @@ -157,14 +157,12 @@ lookup_minimal_symbol (register const ch unsigned int hash = msymbol_hash (name); unsigned int dem_hash = msymbol_hash_iw (name); -#ifdef SOFUN_ADDRESS_MAYBE_MISSING if (sfile != NULL) { char *p = strrchr (sfile, '/'); if (p != NULL) sfile = p + 1; } -#endif for (objfile = object_files; objfile != NULL && found_symbol == NULL; @@ -193,17 +191,8 @@ lookup_minimal_symbol (register const ch case mst_file_text: case mst_file_data: case mst_file_bss: -#ifdef SOFUN_ADDRESS_MAYBE_MISSING if (sfile == NULL || STREQ (msymbol->filename, sfile)) found_file_symbol = msymbol; -#else - /* We have neither the ability nor the need to - deal with the SFILE parameter. If we find - more than one symbol, just return the latest - one (the user can't expect useful behavior in - that case). */ - found_file_symbol = msymbol; -#endif break; case mst_solib_trampoline: @@ -264,14 +253,12 @@ lookup_minimal_symbol_text (register con struct minimal_symbol *found_symbol = NULL; struct minimal_symbol *found_file_symbol = NULL; -#ifdef SOFUN_ADDRESS_MAYBE_MISSING if (sfile != NULL) { char *p = strrchr (sfile, '/'); if (p != NULL) sfile = p + 1; } -#endif for (objfile = object_files; objfile != NULL && found_symbol == NULL; @@ -291,17 +278,8 @@ lookup_minimal_symbol_text (register con switch (MSYMBOL_TYPE (msymbol)) { case mst_file_text: -#ifdef SOFUN_ADDRESS_MAYBE_MISSING if (sfile == NULL || STREQ (msymbol->filename, sfile)) found_file_symbol = msymbol; -#else - /* We have neither the ability nor the need to - deal with the SFILE parameter. If we find - more than one symbol, just return the latest - one (the user can't expect useful behavior in - that case). */ - found_file_symbol = msymbol; -#endif break; default: found_symbol = msymbol; @@ -338,14 +316,12 @@ lookup_minimal_symbol_solib_trampoline ( struct minimal_symbol *msymbol; struct minimal_symbol *found_symbol = NULL; -#ifdef SOFUN_ADDRESS_MAYBE_MISSING if (sfile != NULL) { char *p = strrchr (sfile, '/'); if (p != NULL) sfile = p + 1; } -#endif for (objfile = object_files; objfile != NULL && found_symbol == NULL;