Bug 21079 – Can't "step" into interface methods in gdb

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-07-27T00:44:38Z
Last change time
2024-12-13T19:10:25Z
Keywords
DebugInfo
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#19753 →

Comments

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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19753 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB