[PATCH] Add a trie to map quickly from address range to compilation unit.

Steinar H. Gunderson sesse@google.com
Thu Mar 24 08:01:38 GMT 2022


On Thu, Mar 24, 2022 at 03:52:27PM +1030, Alan Modra wrote:
> Huh, I remember looking at this code a while ago and finding it
> confusing.  I think the code would be clearer, and behave the same on
> normal line number info with the following patch:

An interesting question is: Do you want to keep searching through
compilation units once you've found a match with a line number?
Should we go straight to “goto done” then?

Currently, it seems that even if we find a match with line numbers, we
keep searching for a more specific match (range <= min_range) in
different compilation units... but only among compilation units we've
already parsed debug information for. If we have a line number by then,
we stop searching; we only parse new units if we're line-number-less
or have no match at all.

And if we find a match, no matter how bad, in those new units, we accept
it and stop searching, no matter whether we have line numbers or if it's
a more specific match or not. (Is that a correct interpretation?) Your
patch changes the exit-after-already-parsed to also include a match
_without_ line numbers. It's a change, but I don't know if it's
intended. My patch, as a side effect, introduces the more-specific logic
into the second loop, where it wasn't before.

/* Steinar */


More information about the Binutils mailing list