Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: bfd_section should not be NULL in call to prim_record_minimal_*
Date: Wed, 18 Apr 2012 00:24:00 -0000	[thread overview]
Message-ID: <20120417235138.GT2852@adacore.com> (raw)
In-Reply-To: <87zkaawp9g.fsf@fleche.redhat.com>

> Did you audit the other symbol readers?

Here is what I found - not exactly completely pretty, and definitely
shows that it would have been a bad idea to add an assertion ;-).

What it also tells me is that, if some of the code out there
explicitly makes the assumption that the minsym's obj_section
is set, it is wrong. I remember seeing this, but in fact, that
was in elfread.c, where the assumption is true.

| * coff-pe-read.c:
|   Says: Used as a last resort if no debugging symbols recognized
|
|     - Calls prim_record_minimal_symbol from add_pe_exported_sym
|         => No bfd_section => No obj_section.
|       Fixing might not be completely straightforward, depends
|       (needs deeper investigation)...
|
| * dbxread.c:
|     - Calls prim_record_minimal_symbol from read_dbx_dynamic_symtab.
|         => No bfd_section.
|       Should be possible to fix? Need to re-learn about format first.
|
| * mdebugread.c:
|     - Calls prim_record_minimal_symbol_and_info, but sometimes with
|       NULL bfd_section. May not always be fixable:
|
|       What does the following mean? When can this happen?
|       > default:
|       >   /* This kind of symbol is not associated to a section.  */
|       >   section = -1;
|       >   bfd_section = NULL;
|
|     - The other calls to prim_record_minimal_symbol_and_info (with a NULL
|       bfd_class) should be replaceable by a call to record_minimal_symbol,
|       which provides the bfd_section (apart from the exception above).
|
| * mips-read.c:  Do we still support this format??? (bfd_arch_alpha)
|     - read_alphacoff_dynamic_symtab calls prim_record_minimal_symbol
|       => No bfd_section.
|
| * somread.c: (pa-hpux format - time to propose deprecation?)
|    - som_symtab_read calls prim_record_minimal_symbol => No bfd_section.
|      Don't remember SOM format anymore, but maybe fixable.
|
| * coffread.c, machoread.c:
|   OK: Calls prim_record_minimal_symbol_and_info with a bfd_section.
|
| * elfread.c:
|   OK: Calls prim_record_minimal_symbol_full with a bfd_section.

-- 
Joel


  parent reply	other threads:[~2012-04-17 23:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 21:14 Joel Brobecker
2012-04-16 21:14 ` [RFA/commit 1/2] Unused local variables in xcoffread.c:read_xcoff_symtab Joel Brobecker
2012-04-16 21:19   ` [RFA/commit 2/2] pspace != NULL failed assertion on ppc-aix Joel Brobecker
2012-04-18  0:43     ` Joel Brobecker
2012-04-18 10:17       ` Pedro Alves
2012-04-18 14:57         ` Joel Brobecker
2012-04-18 15:13           ` Pedro Alves
2012-04-18  0:32   ` checked in: [RFA/commit 1/2] Unused local variables in xcoffread.c:read_xcoff_symtab Joel Brobecker
2012-04-17 12:03 ` RFC: bfd_section should not be NULL in call to prim_record_minimal_* Tom Tromey
2012-04-17 15:17   ` Joel Brobecker
2012-04-17 15:23     ` Tom Tromey
2012-04-17 23:26       ` Joel Brobecker
2012-04-18 15:01         ` Tom Tromey
2012-04-18  0:24   ` Joel Brobecker [this message]
2012-04-17 12:45 ` Pedro Alves
2012-04-17 14:21   ` Tom Tromey
2012-04-17 14:29     ` Pedro Alves

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=20120417235138.GT2852@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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