It seems Microsoft has added some new, undocumented, debug type records with the (latest?) VS 2019 16.8 release. For example:
>cat a.cpp
namespace NS {
struct Foo {
explicit Foo(int x) : X(x) {}
int X;
};
}
int main(int argc, char **argv) {
NS::Foo f(argc);
return 0;
}
>cl /c /Z7 /GS- a.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29335 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
a.cpp
>cvdump.exe a.obj | grep "UNRECOGNIZED"
0x1004 : Length = 46, Leaf = 0x1609 UNRECOGNIZED TYPE
0x1009 : Length = 46, Leaf = 0x1609 UNRECOGNIZED TYPEBefore this patch, llvm-pdbutil dump a.obj used to crash. Now it displays "UNKOWN RECORD":
>llvm-pdbutil dump -all a.obj | grep -C2 "0x1609"
Record Kind | Count Size
--------------------------------------
UNKNOWN RECORD (0x1609) | 1 48
--------------------------------------
Total (S_UDT) | 1 16
--
0x1003 | LF_FUNC_ID [size = 20]
name = main, type = 0x1002, parent scope = <no type>
0x1004 | UNKNOWN RECORD (0x1609) [size = 48]
0x1005 | LF_POINTER [size = 12]
referent = 0x1004, mode = pointer, opts = const, kind = ptr64
--
type = 0x1007, vftable offset = -1, attrs = public
- LF_MEMBER [name = `X`, Type = 0x0074 (int), offset = 0, attrs = public]
0x1009 | UNKNOWN RECORD (0x1609) [size = 48]
0x100A | LF_STRING_ID [size = 48] ID: <no type>, String: F:\aganea\llvm-project\__test\a.cpp
0x100B | LF_UDT_SRC_LINE [size = 16]There's also a crash in obj2yaml as well, I can send another review for that.
@gratianlup Do you think if it would be possible to to upgrade the list of records in https://github.com/microsoft/microsoft-pdb ? Thanks in advance!