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

via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 16:57:25 PDT 2024


bd1976bris wrote:

I had a look at how this interacts with other options and I everything looks reasonable as far as I can see. For `--print-source-context-lines` I tried printing a line zero address with `--skip-line-zero` and the output looks good:

```
>llvm-symbolizer.exe 0x0000000000000156 --obj=main.elf --skip-line-zero --print-source-context-lines=3
f3
main.c:20:0 (approximate)
19  : {
20 >:   gvar3++;
21  :   if (gvar3 > 1 && b < a)
```

I noticed that for the `--print-source-context-lines` for line zero addresses without `--skip-line-zero` you currently get very confusing output where the lines around line zero are displayed:

```
>llvm-symbolizer.exe 0x0000000000000156 --obj=main.elf --print-source-context-lines=3
f3
main.c:0:0
1  : static int gvar1 = 0;
2  : static int gvar2 = 0;
3  : static int gvar3 = 0;
```

I think that ideally it would be better not to display the context lines for line zero addresses. It might also be nice to emit a warning recommending trying a different address or using `--skip-line-zero`.

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


More information about the llvm-commits mailing list