[llvm] [Symbolizer] Compute Nearest Line Info for Address. (PR #71032)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 00:18:58 PST 2023


jh7370 wrote:

> @jh7370 what're your thoughts on the functionality in general (patch/code details notwithstanding, and enabling the functionality only behind a flag)?

Honestly, I don't have much to add beyond what @gbreynoo has said (for clarity, @gbreynoo is on our company's team that is responsible for maintaining our downstream versions of these tools, I no longer am, but keep monitoring upstream anyway). As I understand it, line 0 is used in places where it's not clear what the real line is. Picking 0 avoids confusion and misleading information. However, as long as the proposed functionality is optional, I think it makes a degree of sense to provide users with a method to try to guess the real line. Exactly the form this takes probably deserves a wider discussion. In particular, I doubt there'll be a single right answer, and it might be necessary to parameterise the option to provide different methods. In particular, I'm thinking:
1) The last address before the current one with a non-zero line value.
2) Same as 1) but the next address rather than the previous one.
3) The last line table entry before the one for the specified address, with a non-zero line value.
4) Same as 3) but using the next entry instead of the previous one.

If this implemented however, it needs to be clear in the command guide and help text that the option is not going to give 100% accurate results, possibly with some good examples in the docs.

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


More information about the llvm-commits mailing list