rainers / cv2pdb

converter of DMD CodeView/DWARF debug information to PDB files
Artistic License 2.0
466 stars 110 forks source link

Debugging Unions #47

Closed ci70 closed 5 years ago

ci70 commented 5 years ago

Works great with MSVC debugger so far. However there is one issue. MSVC debugger shows unions as well, however with this the 7th field is missing.

struct value {
    HKEY hKey;
    LPCSTR lpSubKey;
    LPCSTR lpKeyName;
    DWORD dwFlags;
    DWORD dwType;
    DWORD dwSize;
    union
    {
      DWORD vDWORD;
      DWORD vQWORD;
      LPCSTR vSZ;
    };
};

const value values[] = { }; // fill with some values.
rainers commented 5 years ago

What compiler are you using?

ci70 commented 5 years ago

GCC 8.

rainers commented 5 years ago

The unnamed union is causing trouble, union { /*..*/ } u; should be fine. You'll have to add it to accesses, too, though.

ci70 commented 5 years ago

So some kind macro for debugging then?

rainers commented 5 years ago

This commit should help: https://github.com/rainers/cv2pdb/commit/14641495119635e26aabad1dbccc79a6dd1fc94c

If you don't compile cv2pdb yourself, you'll have to wait for the next build of the Visual D project...

rainers commented 5 years ago

Release link updated