Bug 23478 – Debugging experience with anonymous classes is pretty bad

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2022-11-11T21:35:01Z
Last change time
2024-12-13T19:25:38Z
Keywords
DebugInfo
Assigned to
No Owner
Creator
Marcelo Silva Nascimento Mancini
Moved to GitHub: dmd#20183 →

Comments

Comment #0 by msnmancini — 2022-11-11T21:35:01Z
Basically, I had an anonymous class defined inside a function: ```d class A { string myTestString; this(string str) { myTestString = str; } void tester() { auto c = new class ("Opps") A { int a = 100; int b = 200; this(string str){super(str);} void testB() { //Put breakpoint here. //On Autos tab, you'll notice there is only "this", and it does not show any of its properties. Not a, b, nor myTestString. //Locals and watch does not work too. `this` shows memory address, `this.a` - not found, `this->a` - not found a+= 100; } }; c.testB(); } } void main() { A a = new A("Hello My Test"); a.tester(); } ```
Comment #1 by r.sagitario — 2022-11-15T22:00:44Z
There is no debug info about members of an anonymous class. This is probably caused by this early return: https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/dcgcv.d#L910 Reassigning to dmd. It looks a lot better when compiling with LDC.
Comment #2 by robert.schadek — 2024-12-13T19:25:38Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20183 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB