This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] move the "main" data into the per-BFD object
- From: Tom Tromey <tromey at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 06 Jan 2014 11:00:02 -0700
- Subject: Re: [PATCH 3/3] move the "main" data into the per-BFD object
- Authentication-results: sourceware.org; auth=none
- References: <1389028297-16977-1-git-send-email-tromey at redhat dot com> <1389028297-16977-4-git-send-email-tromey at redhat dot com> <CADPb22T4fBYr_BEELyju=p8ORPbvBMQTvnrQim6KYcDT9n+SRg at mail dot gmail dot com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> Seems like there ought to be an invariant that there is only one
Doug> main name. I ask because it's not clear this invariant is
Doug> enforced (or if it is it's too subtle) and thus what if this loop
Doug> finds the wrong one?
I agree there's some room for improvement, but I don't think this series
makes the code worse in any notable way. There is no such invariant
today and I don't know how it would be enforced. I think the new code,
if anything, is slightly more likely to get the correct answer, due to
walking the objfiles in load order, rather than reverse order. For the
DWARF reader at least this only even triggers for Fortran anyway (gdb
doesn't handle DW_AT_main_subprogram yet), which I think implies a lower
exposure to possible difficulties.
Tom