From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31212 invoked by alias); 24 Apr 2002 08:03:30 -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 31166 invoked from network); 24 Apr 2002 08:03:26 -0000 Received: from unknown (HELO pizda.ninka.net) (216.101.162.242) by sources.redhat.com with SMTP; 24 Apr 2002 08:03:26 -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 AAA26822; Wed, 24 Apr 2002 00:53:57 -0700 Date: Wed, 24 Apr 2002 01:03:00 -0000 Message-Id: <20020424.005356.93405052.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/msg00919.txt.bz2 From: Elena Zannoni Date: Tue, 23 Apr 2002 15:05:04 -0400 About symtab.h: it is possible to remove the find_stab_function_addr by making the function static in dbxread.c, and moving its definition there from minsyms.c. I would consider that an obvious fix. Done, as follows: 2002-04-24 David S. Miller * symtab.h (find_stab_function_addr): Kill extern. * minsyms.c (find_stab_function_addr): Remove from here... * dbxread.c: ... to here, and mark it static. --- ./symtab.h.~1~ Tue Apr 9 13:51:33 2002 +++ ./symtab.h Wed Apr 24 00:15:32 2002 @@ -1139,10 +1139,6 @@ enum minimal_symbol_type, char *info, int section, asection * bfd_section, struct objfile *); -#ifdef SOFUN_ADDRESS_MAYBE_MISSING -extern CORE_ADDR find_stab_function_addr (char *, char *, struct objfile *); -#endif - extern unsigned int msymbol_hash_iw (const char *); extern unsigned int msymbol_hash (const char *); --- ./minsyms.c.~1~ Tue Mar 19 11:00:04 2002 +++ ./minsyms.c Wed Apr 24 00:16:29 2002 @@ -504,52 +504,6 @@ { return lookup_minimal_symbol_by_pc_section (pc, find_pc_mapped_section (pc)); } - -#ifdef SOFUN_ADDRESS_MAYBE_MISSING -CORE_ADDR -find_stab_function_addr (char *namestring, char *filename, - struct objfile *objfile) -{ - struct minimal_symbol *msym; - char *p; - int n; - - p = strchr (namestring, ':'); - if (p == NULL) - p = namestring; - n = p - namestring; - p = alloca (n + 2); - strncpy (p, namestring, n); - p[n] = 0; - - msym = lookup_minimal_symbol (p, filename, objfile); - if (msym == NULL) - { - /* Sun Fortran appends an underscore to the minimal symbol name, - try again with an appended underscore if the minimal symbol - was not found. */ - p[n] = '_'; - p[n + 1] = 0; - msym = lookup_minimal_symbol (p, filename, objfile); - } - - if (msym == NULL && filename != NULL) - { - /* Try again without the filename. */ - p[n] = 0; - msym = lookup_minimal_symbol (p, NULL, objfile); - } - if (msym == NULL && filename != NULL) - { - /* And try again for Sun Fortran, but without the filename. */ - p[n] = '_'; - p[n + 1] = 0; - msym = lookup_minimal_symbol (p, NULL, objfile); - } - - return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym); -} -#endif /* SOFUN_ADDRESS_MAYBE_MISSING */ /* Return leading symbol character for a BFD. If BFD is NULL, --- ./dbxread.c.~1~ Thu Mar 21 11:48:54 2002 +++ ./dbxread.c Wed Apr 24 00:16:48 2002 @@ -1230,6 +1230,52 @@ do_cleanups (back_to); } +#ifdef SOFUN_ADDRESS_MAYBE_MISSING +CORE_ADDR +find_stab_function_addr (char *namestring, char *filename, + struct objfile *objfile) +{ + struct minimal_symbol *msym; + char *p; + int n; + + p = strchr (namestring, ':'); + if (p == NULL) + p = namestring; + n = p - namestring; + p = alloca (n + 2); + strncpy (p, namestring, n); + p[n] = 0; + + msym = lookup_minimal_symbol (p, filename, objfile); + if (msym == NULL) + { + /* Sun Fortran appends an underscore to the minimal symbol name, + try again with an appended underscore if the minimal symbol + was not found. */ + p[n] = '_'; + p[n + 1] = 0; + msym = lookup_minimal_symbol (p, filename, objfile); + } + + if (msym == NULL && filename != NULL) + { + /* Try again without the filename. */ + p[n] = 0; + msym = lookup_minimal_symbol (p, NULL, objfile); + } + if (msym == NULL && filename != NULL) + { + /* And try again for Sun Fortran, but without the filename. */ + p[n] = '_'; + p[n + 1] = 0; + msym = lookup_minimal_symbol (p, NULL, objfile); + } + + return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym); +} +#endif /* SOFUN_ADDRESS_MAYBE_MISSING */ + /* Setup partial_symtab's describing each source file for which debugging information is available. */