From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5936 invoked by alias); 11 Oct 2003 20:42:12 -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 5904 invoked from network); 11 Oct 2003 20:41:36 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.0.121) by sources.redhat.com with SMTP; 11 Oct 2003 20:41:36 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 10F412B89; Sat, 11 Oct 2003 16:41:16 -0400 (EDT) Message-ID: <3F886AEB.5040908@redhat.com> Date: Sat, 11 Oct 2003 20:42:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Elizabeth Chastain Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa] Deprecate msymbol.info, add msymbol.bfd_symbol? References: <200310112022.h9BKMdnf021956@duracef.shout.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-10/txt/msg00414.txt.bz2 > ac says: > > sym = lookup_minimal_symbol_by_pc (memaddr); > if (sym && sym->bfd_symbol is "elf like") > return (ELF_ST_TYPE (((elf_symbol_type *) > (sym->bfd_symbol))->internal_elf_sym.st_info) == STT_LOPROC) > else > return 0; > > Okay, I see. The existing code has a hook in the symbol reader that > reads the bfd symbol and calls MSYMBOL_SET_SPECIAL to stash some bits in > msymbol.info for later. You would get rid of the hook or simplify and > just store a simple pointer in msymbol.bfd_symbol. Have I got that > right? Yep! > Sounds like a great idea to me. A bunch of squirrelly caching and > casting code would go away. > > /* Pass symbol size field in via BFD. FIXME!!! */ > size = ((elf_symbol_type *) sym)->internal_elf_sym.st_size; > msym = record_minimal_symbol_and_info > ((char *) sym->name, symaddr, > ms_type, (void *) size, sym->section, objfile); > > Yeah, for this code, you could either have msymbol.size or use the > information available from msymbol.bfd_symbol. Anything but > mysmbol.info. Yep! >> This could immediatly eliminate two of them. I think the coff version >> of ARM could also be eliminated if coffread (yea, right ... :-) fully >> utilized BFD. > > > I'm saying that this code is already dead: > > gdb_assert (sizeof (void *) >= sizeof (cs->c_sclass)); > msym = prim_record_minimal_symbol_and_info > (cs->c_name, tmpaddr, ms_type, (void *) (long) cs->c_sclass, > sec, NULL, objfile); > > I'm not sure about these lines immediately after it: > > if (msym) > COFF_MAKE_MSYMBOL_SPECIAL (cs->c_sclass, msym); > > I think you are saying that coffread.c can be made to work using > the new fields. I don't know whether the existing code works or not, > I'm juse pointing to the deadness. Yep! (COFF_MAKE_MSYMBOL_SPECIAL is currently be used by arm. coffread doesn't use bfd_canonicalize_symtab so doesn't have access to the bfd symbol.) Andrew