14 Commits

Author SHA1 Message Date
Zachary Turner
53e1857e0a Don't build the Tpi Hash map by default.
This is very slow and should be done for specific cases where
lookups will need to happen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348160 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-03 18:32:05 +00:00
Zachary Turner
b47810926d [PDB] Add support for dumping Typedef records.
These work a little differently because they are actually in
the globals stream and are treated as symbol records, even though
DIA presents them as types.  So this also adds the necessary
infrastructure to cache records that live somewhere other than
the TPI stream as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343507 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 17:55:38 +00:00
Zachary Turner
a93560b336 [PDB] Add support for parsing VFTable Shape records.
This allows them to be returned from the native API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343506 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01 17:55:16 +00:00
Zachary Turner
e1b020acef [PDB] Add native support for dumping array types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343412 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 16:19:18 +00:00
Zachary Turner
2adab77756 [NativePDB] Add support for reading function signatures.
This adds support for parsing function signature records and returning
them through the native DIA interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342780 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-21 22:36:28 +00:00
Zachary Turner
9b6c494a00 [PDB] Add native reading support for UDT / class types.
This allows the native reader to find records of class/struct/
union type and dump them.  This behavior is tested by using the
diadump subcommand against golden output produced by actual DIA
SDK on the same PDB file, and again using pretty -native to
confirm that we actually dump the classes.  We don't find class
members or anything like that yet, for now it's just the class
itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342779 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-21 22:36:04 +00:00
Zachary Turner
39b643282c [PDB] Better printing of builtin types when using DIA dumper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342658 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 16:12:05 +00:00
Zachary Turner
0c5ced81dc [PDB] Better support for enumerating pointer types.
There were several issues with the previous implementation.

1) There were no tests.
2) We didn't support creating PDBSymbolTypePointer records for
   builtin types since those aren't described by LF_POINTER
   records.
3) We didn't support a wide enough variety of builtin types even
   ignoring pointers.

This patch fixes all of these issues.  In order to add tests,
it's helpful to be able to ignore the symbol index id hierarchy
because it makes the golden output from the DIA version not match
our output, so I've extended the dumper to disable dumping of id
fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342493 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 16:35:05 +00:00
Zachary Turner
8d5fd87893 [PDB] Make the native reader support enumerators.
Previously we would dump the names of enum types, but not their
enumerator values.  This adds support for enumerator values.  In
doing so, we have to introduce a general purpose mechanism for
caching symbol indices of field list members.  Unlike global
types, FieldList members do not have a TypeIndex.  So instead,
we identify them by the pair {TypeIndexOfFieldList, IndexInFieldList}.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342415 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-17 21:08:11 +00:00
Zachary Turner
a3a0a03db2 [PDB] Make the native reader support modified types.
Previously for cv-qualified types, we would just ignore them
and they would never get printed.  Now we can enumerate them
and cache them like any other symbol type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342414 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-17 21:07:48 +00:00
Zachary Turner
932287b64f [PDB] Refactor a little of the Symbol creation code.
Eventually we need to be able to support nested types, which don't
have an associated CVType record.  To handle this, remove the
CVType from all of the record classes, and instead store the
deserialized record.  Then move the deserialization up to the thing
that creates the type.  This actually makes error handling better
anyway as we can return an invalid symbol instead of asserting false.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342284 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-14 21:03:57 +00:00
Zachary Turner
25ccaa7421 [PDB] Support pointer types in the native reader.
In order to start testing this, I've added a new mode to
llvm-pdbutil which is only really useful for writing tests.
It just dumps the value of raw fields in record format.
This isn't really ideal and it won't allow us to test some
important cases, but it's better than nothing for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341729 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 23:21:33 +00:00
Zachary Turner
6d1036d22d [PDB] Rename some files in the native reader.
By calling these NativeType<foo>.cpp, they will all be sorted
together, and it also distinguishes the types from the symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341609 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 00:12:56 +00:00
Zachary Turner
7428f4506c [PDB] Create a SymbolCache class.
Part of the responsibility of the native PDB reader is to cache
symbols the first time they are accessed, so they can then be
looked up by an ID.  Furthermore, we need to resolve type indices
to records that we vend to the user, and other things.  Previously
this code was all thrown together a bit haphazardly in the native
session class, but it makes sense to collect all of this into a
single class whose sole responsibility is to manage the collection
of known symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341608 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 00:12:34 +00:00