rainers / cv2pdb

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

cv2pdb does not add S_GPROC entries to functions with multiple code ranges #52

Closed Marc-Aldorasi-Imprivata closed 2 years ago

Marc-Aldorasi-Imprivata commented 5 years ago

We only add S_GPROC entries if the dwarf entry for a function contains both pchi and pclo entries. If the function has multiple code ranges, we can emit the first range as we do now and emit the additional ranges as S_SEPCODE entries (see https://github.com/Microsoft/microsoft-pdb/blob/082c5290e5aff028ae84e43affa8be717aa7af73/include/cvinfo.h#L4148 for the structure layout, and https://msdl.microsoft.com/download/symbols/iphlpapi.pdb/73C3E5A77A9CF1A38763A6DC6E671DC31/iphlpapi.pdb for a pdb with such entries).

rainers commented 5 years ago

Sounds reasonable, but I probably won't address this in the near future. A pull request is very welcome, thoguh ;-) Do you also have an example where respective DWARF info is emitted?

Marc-Aldorasi-Imprivata commented 5 years ago
void foo();
void bar() {
    try {
        foo();
    } catch (...) {
        foo();
    }
}

If you compile this with GCC 8.2.1 with the options -O3 and -ggdb3, it will place the contents of the catch block outside the main body of bar and so the DWARF for bar will have 2 address ranges.

Marc-Aldorasi-Imprivata commented 2 years ago

Implemented with pull request #71