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

via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 03:20:06 PDT 2024


ampandey-1995 wrote:

> 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:

I think that is the default behaviour --print-source-context-lines will display the source lines around the queried address even when that address has no line number. 

> ```
> >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`.

This would require making a change in the default functionality of ```--print-source-context-lines```. Ideally, with/without ```--skip-line-zero``` ```--print-source-context-lines``` should output source context lines by default for any queried address(even it has line zero.).

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


More information about the llvm-commits mailing list