<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/92403>92403</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm-symbolizer] Improve output for addresses with no line correspondence
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue,
tools:llvm-symbolizer
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bd1976bris
</td>
</tr>
</table>
<pre>
My understanding is that the convention for addresses with no line correspondence is to associate them with line 0.
We should improve the tool behavior for such addresses to avoid confusion to users.
Suggestions for improvement:
**1. Print \<unknown\> rather than line 0 for such addresses:**
_Current output:_
>llvm-symbolizer.exe --obj=main.elf 0x0000000000000177
f3
main.c:0:0
_Proposed:_
>llvm-symbolizer.exe --obj=main.elf 0x0000000000000177
f3
main.c:\<unknown\>
*Warning: no line correspondence for address. Please try a nearby address or use --skip-line-zero(#82240) *
Although, perhaps it isn't even possible to give a reasonable file for such addresses (compiler inlining scenarios etc) - in which case perhaps only printing the function name would be preferable?
**2. Do not show context lines:**
I noticed that for --print-source-context-lines for line zero addresses you currently get very confusing output where the lines around line zero are displayed:
_Current output:_
>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;
_Proposed:_
>llvm-symbolizer.exe 0x0000000000000156 --obj=main.elf --print-source-context-lines=3
f3
main.c:\<unknown\>
*Warning: no line correspondence for address so no context displayed. Please try a nearby address or use --skip-line-zero(#82240) *
**Other notes:**
- Might be worth checking the interaction with --no-use-symbol-table (https://github.com/llvm/llvm-project/pull/71008)?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vstu2zgU_Rp6cyFDIqVIXniR2jXQRTEBZtFlQVHXIhuaFPiw4379gJSTcV3Po5hJEFuweHjug-eQ5N6r0SCuSfOBNNsFj0Fat-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