This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: proposed fix for PR 114


Hi Ben,

I've prototyped a fix which slightly alters BFD's interface, adding a
bfd_vma* parameter to bfd_find_nearest_line that returns the address
of the next source line (where possible; otherwise it returns the
requested address).

This seems to have one flaw, however.  Sometimes, due to instruction
reordering at higher optimisation levels, a source line B can begin at
an address that lies between the start and end of source line A.  With
my patch, that source line will not appear in the profile output.  I'm
not quite sure how to handle this, nor am I sure if this would be
considered catastrophic.

I think that it would be bad. It would result in gprof generating bogus line usage information which render its use as a profiling tool suspect.


The entire address to source line mapping procedure can be quite complex. One address can map to multiple lines of source code and a single line of source code can occupy multiple, disjoint and overlapping address ranges.

If BFD were to provide an interface to obtain this information (which in theory is a good idea) then we ought to be careful and make sure that as much information is returned as possible.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]