From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: bfd_section should not be NULL in call to prim_record_minimal_*
Date: Tue, 17 Apr 2012 12:03:00 -0000 [thread overview]
Message-ID: <87zkaawp9g.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1334610821-10974-1-git-send-email-brobecker@adacore.com> (Joel Brobecker's message of "Mon, 16 Apr 2012 23:13:39 +0200")
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> But I think it is wrong, because I think a lot of places in the GDB code
Joel> make the assumption that a minimal symbol's obj_section is not NULL, and
Joel> the only way to set it, I think, is to have the BFD section.
Joel> So, I think the function documentation should be changed to remove
Joel> the permission to pass NULL, and a gdb_assert should also be added
Joel> to verify that SYMBOL_OBJ_SECTION (msymbol) != NULL after the
Joel> BFD section to obj_section search.
Joel> In the meantime, patch #2 fixes the problem by making sure that we
Joel> always pass a BFD section. I haven't tested it against the official
Joel> testsuite, I will do so now, but I also wanted to start this discussion
Joel> before I forget.
This change is fine with me -- even more than fine, I think removing
special cases is generally better when possible.
However, if this is just a regression caused by linespec changes, maybe
it can also be fixed in another way. That is, you can find a minsym's
objfile using msymbol_objfile; I think this would fix the possibly
problematic uses I see in linespec.c (the one in minsym_found is maybe
ok).
I wanted to mention this in case the change causes other regressions in
your testing.
Did you audit the other symbol readers?
Tom
next prev parent reply other threads:[~2012-04-17 11:51 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 ` Tom Tromey [this message]
2012-04-17 15:17 ` RFC: bfd_section should not be NULL in call to prim_record_minimal_* 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
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=87zkaawp9g.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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