Comment #0 by dlang-bugzilla — 2020-07-27T00:44:38Z
Given the program:
///////// test.d ////////
import std.stdio;
interface I
{
void foo();
}
class C : I
{
void foo()
{
writeln("Hello");
}
}
void main()
{
I c = new C;
c.foo();
}
/////////////////////////
When compiling it with `dmd -g test.d`, and debugging it with `gdb ./test`, attempting to "step" into the c.foo() call causes the debugger to skip over it entirely.
Transcript:
(gdb) start
Temporary breakpoint 1 at 0x48095c: file test.d, line 18.
Starting program: /home/vladimir/tmp/2020-07-27-scratch/00:38:03/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Temporary breakpoint 1, D main () at test.d:18
18 I c = new C;
(gdb) next
19 c.foo();
(gdb) step
Hello
20 }
The problem doesn't manifest in GDC and LDC, which correctly step into C.foo, which leads me to believe this is a defect in the debug information generated by DMD.
Comment #1 by robert.schadek — 2024-12-13T19:10:25Z