$ cat check.c #include<stdio.h> int main() { printf("Hello\n"); return 0; } $clang -target arm64 -g -c check.c $./llvm-dwarfdump --debug-line check.o Address Line Column File ISA Discriminator Flags ------------------ ------ ------ ------ --- ------------- ------------- 0x0000000000000000 4 0 1 0 0 is_stmt 0x0000000000000014 0 0 1 0 0 is_stmt prologue_end 0x0000000000000020 5 4 1 0 0 is_stmt 0x0000000000000028 6 4 1 0 0 is_stmt 0x0000000000000038 6 4 1 0 0 is_stmt end_sequence
In LLVM geneated executables prologue_end in line table is set to zero ,because of that
when we put break point on main it will show line number of main function location at line zero incorrectly.
And in gcc it is working fine. This issue is specific with Global-isel.
This also looks wrong. We would be inheriting a random previous debug location for all instructions created by MIRBuilder if we did this?