www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18881] New: extern(C++) classes don't work properly in


          Issue ID: 18881
           Summary: extern(C++) classes don't work properly in debuginfo
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: visuald
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

Here's a test class:

extern(C++) class BaseCPP
        ~this() {}
        void poo() {}

        int x = 10;
        int y = 20;

extern(C++) class DerivedCPP : BaseCPP
        int z;

void main()
  DerivedCPP d = new DerivedCPP;
  BaseCPP b = d;

  int x = 10; // PLACE BREAKPOINT HERE

At the breakpoint, inspect the value of 'b'.

You should expect to see:
- b                0x0073fb2c {z=0}                   BaseCPP* {DerivedCPP}
+    [DerivedCPP]  {z=0}                              DerivedCPP
+    __vfptr       0x00394c50 {DerivedCPP.__vftable}  void**
     x             10                                 int
     y             20                                 int

But instead, there is only the 2 members of BaseCPP: `x` and `y`.

extern(C++) classes are missing their type, entry to get from base-class
pointer to the most-derived type, and the vtable.
C++ populates the class with all this information, so extern(C++) classes
should be able to show the exact same set of members as when debugging in C++?

May 19 2018