rainers / cv2pdb

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

Lack of structures and classes forward declarations #77

Open ALEXYAL opened 2 years ago

ALEXYAL commented 2 years ago

Lack of forward declarations in 2 cases:

1 ---------------
struct A {
  A* p; //self ptr
}; 
2 ---------------
struct {
} A; //alias typedef
struct B {
  A* p; //ptr to typedefed structure
}

In both cases DIA PDB engine cannot resolve "p" member and in debugger it is inaccessible (cvdump shows type NONE). DWRARF format has different structure and DIA PDB engine not so sophisticated to create maps and resolves symbols in second path.

So I've add synthetic forward declarations (and pointers) for all structures and problem completely gone. Not very nice solution, but it works. (see attached fix.zip file) fix.zip

rainers commented 1 year ago

Thank you for contributing. It would be good if you could make a pull request with your changes so that it's easier to discuss them (e.g. removing the asserts is not so great), your authorship is kept in the commit log and the build checks are run before merging.

Can you also provide full examples demonstrating the issues?