[NativePDB] Add support for dumping global variables of class type.
authorZachary Turner <zturner@google.com>
Tue, 30 Oct 2018 18:57:08 +0000 (18:57 +0000)
committerZachary Turner <zturner@google.com>
Tue, 30 Oct 2018 18:57:08 +0000 (18:57 +0000)
commit511bff21b4bb0532b6b030996afff2c246671dd1
treee779e2265eaeb441e21a76d5fc21873355feac9d
parente2b1a9c789648cba5e9f1ee3ba134ffaf9829420
[NativePDB] Add support for dumping global variables of class type.

Previous patches added support for dumping global variables of
primitive types, so we now do the same for class types.

For the most part, everything just worked, there was only one
minor bug needing fixed, which was that for variables of modified
types (e.g. const, volatile, etc) we can't resolve the forward
decl in CreateAndCacheType because the PdbSymUid must point to the
LF_MODIFIER which must point to the forward decl.  So when it comes
time to call CompleteType, an assert was firing because we expected
to get a class, struct, union, or enum, but we were getting an
LF_MODIFIER instead.

The other issue is that one the newly added tests is for an array
member, which was not yet supported, so we add support for that
now in this patch.

There's probably room for other interesting layout test cases
here, but this at least should test the basics.

Differential Revision: https://reviews.llvm.org/D53822

llvm-svn: 345629
lldb/lit/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit [new file with mode: 0644]
lldb/lit/SymbolFile/NativePDB/global-classes.cpp [new file with mode: 0644]
lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp
lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.h
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h