[PATCH] Fix return code in _bfd_dwarf2_find_nearest_line().
Steinar H. Gunderson
sesse@google.com
Wed Mar 23 12:01:20 GMT 2022
On Wed, Mar 23, 2022 at 11:47:25AM +0000, Nick Clifton wrote:
> I do not think that it is for fallback, but rather that it is expected
> that all callers of this function will have already decided upon the symbol
> table that they want to use, and so it is provided as a parameter. (A
> single binary file can have multiple symbol tables, so there needs to be
> some way to select which one to use. Making the caller perform this choice
> is the easiest solution).
Wording myself a bit more precisely: It is used for fallback when there
is no debug information that gives precise line/function information; if
there is, we never look at the provided symbol list. I agree it's not a
fallback in the (fairly common) case of e.g. no debug information.
> You probably could make a persistent structure. It is unlikely that the
> code will called with different symbol tables under most use cases. But
> you would need to detect if this has happened and ditch/refresh your
> storage in that case.
But how could it be detected? Even if the pointer being sent in is the
same, the contents of the array could be different, and we'd need to
scan through all of it, defeating the purpose?
/* Steinar */
More information about the Binutils
mailing list