[ spinoff of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95360 ] Consider test-case: ... $ cat small.c unsigned int b,d; static int c[1][2] = {{0, 1}}; int main() { for (; d<1; d++) for (; b<1; b++) c[b][d+1] = 0; return 0; } ... Compiled like so: ... $ gcc-10 -O0 -g small.c ... When stepping through the program, we go straight from line 5 to line 7: ... Temporary breakpoint 1 at 0x400496: file small.c, line 5. Starting program: /home/vries/a.out Temporary breakpoint 1, main () at small.c:5 5 for (; d<1; d++) (gdb) n 7 c[b][d+1] = 0; ... If we disable the filtering in dwarf_record_line_p, we have instead: ... Temporary breakpoint 1 at 0x400496: file small.c, line 5. Starting program: /home/vries/a.out Temporary breakpoint 1, main () at small.c:5 5 for (; d<1; d++) (gdb) n 6 for (; b<1; b++) (gdb) n 7 c[b][d+1] = 0; ...
*** Bug 26059 has been marked as a duplicate of this bug. ***