When debugging an executable program completed by Clang, if you set a break to a function, it is often no way to stop right at the line of the function, but jump to the end of the program. For example:
Reading symbols from ./a.out...done. (gdb) b main Breakpoint 1 at 0x4005ec (gdb) r Starting program: /tmp/a.out Breakpoint 1, 0x00000000004005ec in main () (gdb) n Single stepping until exit from function main, which has no line number information. 0x0000ffffbf559ae0 in __libc_start_main () from /usr/lib64/libc.so.6
GDB version: GNU gdb (GDB) 8.2
This patch is trying to solve the issue.