Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa] Deprecate msymbol.info, add msymbol.bfd_symbol?
Date: Sat, 11 Oct 2003 20:42:00 -0000	[thread overview]
Message-ID: <3F886AEB.5040908@redhat.com> (raw)
In-Reply-To: <200310112022.h9BKMdnf021956@duracef.shout.net>

> 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



  reply	other threads:[~2003-10-11 20:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-11 20:22 Michael Elizabeth Chastain
2003-10-11 20:42 ` Andrew Cagney [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-14 17:36 Michael Elizabeth Chastain
2003-10-14 20:09 ` Elena Zannoni
2003-10-11 20:44 Michael Elizabeth Chastain
2003-10-11 18:39 Michael Elizabeth Chastain
2003-10-11 20:02 ` Andrew Cagney
2003-10-13 20:28   ` Elena Zannoni
2003-10-11 17:16 Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F886AEB.5040908@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec@shout.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox