[PATCH 3/3] move the "main" data into the per-BFD object

Tom Tromey tromey@redhat.com
Mon Jan 6 18:00:00 GMT 2014


>>>>> "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



More information about the Gdb-patches mailing list