You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding is that the convention for addresses with no line correspondence is to associate them with line 0.
From the DWARF 5 spec section 6.2.2 State Machine Registers from the entry on the meaning of the line register:
An unsigned integer indicating a source line
number. Lines are numbered beginning at 1.
The compiler may emit the value 0 in cases
where an instruction cannot be attributed to any
source line
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:
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) *
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) *
My understanding is that the convention for addresses with no line correspondence is to associate them with line 0.
From the DWARF 5 spec section
6.2.2 State Machine Registers
from the entry on the meaning of the line register: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:
Proposed:
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:
Proposed:
Other notes:
The text was updated successfully, but these errors were encountered: