From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3144 invoked by alias); 11 Oct 2003 20:22:41 -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 3135 invoked from network); 11 Oct 2003 20:22:40 -0000 Received: from unknown (HELO concert.shout.net) (204.253.184.25) by sources.redhat.com with SMTP; 11 Oct 2003 20:22:40 -0000 Received: from duracef.shout.net (duracef.shout.net [204.253.184.12]) by concert.shout.net (8.12.10/8.12.10) with ESMTP id h9BKMdqs020709; Sat, 11 Oct 2003 15:22:39 -0500 Received: from duracef.shout.net (localhost [127.0.0.1]) by duracef.shout.net (8.12.10/8.12.9) with ESMTP id h9BKMdVd021957; Sat, 11 Oct 2003 15:22:39 -0500 Received: (from mec@localhost) by duracef.shout.net (8.12.10/8.12.9/Submit) id h9BKMdnf021956; Sat, 11 Oct 2003 16:22:39 -0400 Date: Sat, 11 Oct 2003 20:22:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200310112022.h9BKMdnf021956@duracef.shout.net> To: ac131313@redhat.com Subject: Re: [rfa] Deprecate msymbol.info, add msymbol.bfd_symbol? Cc: gdb-patches@sources.redhat.com X-SW-Source: 2003-10/txt/msg00413.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? 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. > 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. Michael C