[lld] [llvm] [Symbolizer] Support for Missing Line Numbers. (PR #82240)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 20:58:18 PST 2024


ampandey-1995 wrote:

> Hi @ampandey-1995, I'm glad to see this come up again.
Thanks @gbreynoo for reviewing the patch.

> There was some discussion in the previous PR that we didn't get to the bottom of, so I'll state it here: @jh7370 mentioned the potential different methods of "Use of the last address before the current one with a non-zero line value" vs "The last line table entry before the one for the specified address, with a non-zero line value". See [#71032 (comment)](https://github.com/llvm/llvm-project/pull/71032#issuecomment-1801303252).

Thanks again for pointing the comments of @jh7370.  I think this patch is somewhat related to querying of line table entries(Second method) for extracting significant line information.

Previously , the patch 71032 was based on the approach of <incrementing/decrementing> address from the address having no line information but this approach dosen't fit well since querying llvm-symbolizer for every address used a lot of symbolizer API's calls invoking DWARF API's to extract line information. Also, if no debug information is present in the object then llvm-symbolizer will keep calling into DWARF API's as we don't get any non-zero line information which sometimes hangs the llvm-symbolizer tool itself.

The current patch tries to query the address(having no line information) by introspecting the line table having bounds [lowPC,highPC]. The search happens usually from [lowPC,SearchPC] if <before> is mentioned  or from [SearchPC,highPC] if <after> is mentioned as value of option --approximate-line-info.

> I think the llvm-symbolizer command guide should clearly specify the method used to derive the line number estimation. Maybe the help output as well.

Ok I will update the command guide & help output.

> There is also the question of would it be useful to have both methods available to the user, as outlined by @jh7370 in [#71032 (comment)](https://github.com/llvm/llvm-project/pull/71032#issuecomment-1798014589). I'm torn as although I see the value in giving the user the option, in most cases just outputting the previous entry in the line table would probably be good enough for an estimate and save making this too complicated.

I agree with you about the approach of querying line table as a good estimation method and also in terms of performance also.

> I also think it should be clearer in the output of llvm-symbolizer when it is an approximate output value. You can input multiple addresses into llvm-symbolizer in one invocation so it would be useful to see which outputs required an estimate vs which are accurate.

Yeah, Thanks will do that. Is it ok to attach a tag such as (approximate) similar to (inlined by) at the end of Line Column information.





https://github.com/llvm/llvm-project/pull/82240


More information about the llvm-commits mailing list