[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #2 from rguenth at gcc dot gnu dot org 2010-05-13 15:36 --- Well, you step to the next line-number and only lines #5 are remaining, so I think you just get what you asked for. I don't know if we could (or should) signal to gdb that there are multiple lines #5 now. Jakub? -- rguenth at gcc dot gnu dot org changed: What|Removed |Added CC||jakub at gcc dot gnu dot ||org, rguenth at gcc dot gnu ||dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #3 from andi-gcc at firstfloor dot org 2010-05-13 16:16 --- I think it should describe multiple lines. next is expected to iterate through loops, not skip them. If I wanted to skip I would use "until" -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #4 from pinskia at gcc dot gnu dot org 2010-05-13 17:13 --- Confirmed. Though with the 4.5.0 and above we do have a debug_stmt with the correct line info at the tree level ... -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords||wrong-debug Known to fail||4.1.3 4.2.4 4.6.0 4.3.2 Last reconfirmed|-00-00 00:00:00 |2010-05-13 17:13:45 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #5 from jakub at gcc dot gnu dot org 2010-05-19 14:52 --- The problem is just that there are no instructions with locus on line 4 - with unrolling no traces of the for loop in the assembly remains and all instructions in the body have line 5 and immediately after it another unrolled iteration has the same line. Apparently gdb on next just puts a breakpoint on the first insn after it that has different file or line number. GCC could emit extra .loc 1 5 0 directives which would just add another row in the line table, or .loc 1 5 0 is_stmt 0 right after the first insn and .loc 1 5 0 is_stmt 1 back before first insn of the next iteration, but apparently this doesn't change anything in gdb. Not even lying and alternating .loc 1 5 0 and .loc 1 5 1 helps. And, putting extra .loc 1 4 0 covering no instructions doesn't change anything either. So I'm afraid there is nothing to do here on the gcc side, except lying that some insn comes from some other line (and for unrolling where the body is just one insn there is nothing to do at all). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #6 from andi-gcc at firstfloor dot org 2010-05-19 15:40 --- Jakub, are you saying this should be fixed in gdb? How could gdb detect this case? If gcc emitted another .loc like you said couldn't gdb check for this? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #7 from jakub at gcc dot gnu dot org 2010-05-19 15:45 --- I guess that needs discussion with the GDB folks... -- jakub at gcc dot gnu dot org changed: What|Removed |Added CC||tromey at gcc dot gnu dot ||org, jan dot kratochvil at ||redhat dot com, drow at gcc ||dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #8 from drow at gcc dot gnu dot org 2010-05-19 18:08 --- It seems to me that a series of line notes for each copy of line 5 are the right debug output, and if GCC can generate that, someone should hack up GDB until it recognizes that and treats it sensibly. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #9 from jakub at gcc dot gnu dot org 2010-05-21 13:00 --- I think it would be better first to change gdb to handle this and then gcc start emitting it. For testing, one can ammend gcc generated assembly with a couple of extra .loc directives. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113
[Bug debug/44113] bad debugging information for unrolled loops
--- Comment #10 from jan dot kratochvil at redhat dot com 2010-05-24 19:49 --- GDB counterpart (no patch now): http://sourceware.org/bugzilla/show_bug.cgi?id=11631 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113