| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 271056
|
| |
|
|
|
|
|
| |
We were accidentally bounds checking the read against the output
ArrayRef instead of against the size of the read.
llvm-svn: 271040
|
| |
|
|
|
|
|
|
|
| |
Due to differences in template instantiation rules, it is not
portable to static_assert(false) inside of an invalid specialization
of a template. Instead I just =delete the method so that it can't
be used, and leave a comment that it must be explicitly specialized.
llvm-svn: 271027
|
| |
|
|
|
|
|
|
| |
This reverts commit r271024 due to error: static_assert failed
"You must either provide a specialization of VarStreamArrayExtractor
or a custom extractor"
llvm-svn: 271026
|
| |
|
|
|
|
|
|
|
|
| |
This reduces the amount of memory used by llvm-pdbdump by roughly
1/3 of the size of the PDB file.
Differential Revision: http://reviews.llvm.org/D20724
Reviewed By: ruiu
llvm-svn: 271025
|
| |
|
|
| |
llvm-svn: 271013
|
| |
|
|
| |
llvm-svn: 271012
|
| |
|
|
| |
llvm-svn: 271011
|
| |
|
|
|
|
|
| |
The blocksize could be zero on disk causing later checks to divide by
zero.
llvm-svn: 271008
|
| |
|
|
|
|
|
|
|
|
|
| |
Since we want to move toward zero-copy access to stream data, we
want to remove all instances of copying operations. So get rid
of some of those here.
Differential Revision: http://reviews.llvm.org/D20720
Reviewed By: ruiu
llvm-svn: 270960
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PDBs can be extremely large. We're already mapping the entire
PDB into the process's address space, but to make matters worse
the blocks of the PDB are not arranged contiguously. So, when
we have something like an array or a string embedded into the
stream, we have to make a copy. Since it's convenient to use
traditional data structures to iterate and manipulate these
records, we need the memory to be contiguous.
As a result of this, we were using roughly twice as much memory
as the file size of the PDB, because every stream was copied
out and re-stitched together contiguously.
This patch addresses this by improving the MappedBlockStream
to allocate from a BumpPtrAllocator only when a read requires
a discontiguous read. Furthermore, it introduces some data
structures backed by a stream which can iterate over both
fixed and variable length records of a PDB. Since everything
is backed by a stream and not a buffer, we can read almost
everything from the PDB with zero copies.
Differential Revision: http://reviews.llvm.org/D20654
Reviewed By: ruiu
llvm-svn: 270951
|
| |
|
|
|
|
|
|
|
|
| |
We have need to reuse this functionality, including making
additional generic stream types that are smarter about how and
when they copy memory versus referencing the original memory.
So all of these structures belong in the common library
rather than being pdb specific.
llvm-svn: 270751
|
| |
|
|
|
|
|
| |
We know at least know the meaning of every stream of the
PDB file. Yay!
llvm-svn: 270669
|
| |
|
|
| |
llvm-svn: 270661
|
| |
|
|
|
|
|
|
|
|
|
| |
name_ids() did not return all IDs but only the first NameCount items.
The number of non-zero entries in IDs vector is NameCount, but it
does not mean that all non-zero entries are at the beginning of IDs
vector.
Differential Revision: http://reviews.llvm.org/D20611
llvm-svn: 270656
|
| |
|
|
|
|
|
| |
Oddly enough, I realized we don't actually know what stream
0 is (if anything).
llvm-svn: 270655
|
| |
|
|
|
|
|
|
|
| |
Try to figure out what each stream is, and dump its name.
This gives us a better picture of what streams we still don't
understand.
llvm-svn: 270653
|
| |
|
|
|
|
|
|
|
| |
When dumping huge PDB files, too many of the options were grouped
together so you would get neverending spew of output. This patch
introduces more granular display options so you can only dump the
fields you actually care about.
llvm-svn: 270607
|
| |
|
|
|
|
|
|
| |
This helps make clear that we're moving away from std::error_code.
Differential Revision: http://reviews.llvm.org/D20592
llvm-svn: 270604
|
| |
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20580
Reviewed By: ruiu
llvm-svn: 270597
|
| |
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20534
Reviewed By: rnk
llvm-svn: 270511
|
| |
|
|
| |
llvm-svn: 270289
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DBI stream contains a stream number of the symbol record stream.
Symbol record streams is an array of length-type-value members.
Each member represents one symbol.
Publics stream contains offsets to the symbol record stream.
This patch is to print out all symbols that are referenced by
the publics stream.
Note that even with this patch, llvm-pdbdump cannot dump all the
information in a publics stream since it contains more information
than symbol names. I'll improve it in followup patches.
Differential Revision: http://reviews.llvm.org/D20480
llvm-svn: 270262
|
| |
|
|
| |
llvm-svn: 270110
|
| |
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20441
llvm-svn: 270088
|
| |
|
|
| |
llvm-svn: 269955
|
| |
|
|
|
|
|
| |
r269898 fixed the problem with HashBuckets but the same issue occurred with
AddressMap and ThunkMap too.
llvm-svn: 269913
|
| |
|
|
| |
llvm-svn: 269898
|
| |
|
|
|
|
|
|
|
|
| |
I don't yet fully understand the meaning of these data strcutures,
but at least it seems that their sizes and types are correct.
With this change, we can read publics streams till end.
Differential Revision: http://reviews.llvm.org/D20343
llvm-svn: 269861
|
| |
|
|
| |
llvm-svn: 269591
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Publics stream seems to contain information as to public symbols.
It actually contains a serialized hash table along with fixed-sized
headers. This patch is not complete. It scans only till the end of
the stream and dump the header information. I'll write code to
de-serialize the hash table later.
Reviewers: zturner
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20256
llvm-svn: 269484
|
| |
|
|
| |
llvm-svn: 269381
|
| |
|
|
|
|
|
|
| |
warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D20042
llvm-svn: 268989
|
| |
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20026
Reviewed By: rnk
llvm-svn: 268942
|
| |
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D19940
Reviewed By: rnk
llvm-svn: 268791
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Port the dumper in llvm-readobj over to it.
I'm planning to use this visitor to power type stream merging.
While we're at it, try to switch from StringRef to ArrayRef<uint8_t> in some
places.
Reviewers: zturner, amccarth
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19899
llvm-svn: 268535
|
| |
|
|
| |
llvm-svn: 268455
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Ability to parse codeview type streams is also needed by
DebugInfoPDB for parsing PDBs, so moving this into a library
gives us this option. Since DebugInfoPDB had already hand
rolled some code to do this, that code is now convereted over
to using this common abstraction.
Differential Revision: http://reviews.llvm.org/D19887
Reviewed By: dblaikie, amccarth
llvm-svn: 268454
|
| |
|
|
|
|
| |
Apparently operation_not_supported is... not supported everywhere.
llvm-svn: 268348
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This parses the TPI stream (stream 2) from the PDB file. This stream
contains some header information followed by a series of codeview records.
There is some additional complexity here in that alongside this stream of
codeview records is a serialized hash table in order to efficiently query
the types. We parse the necessary bookkeeping information to allow us to
reconstruct the hash table, but we do not actually construct it yet as
there are still a few things that need to be understood first.
Differential Revision: http://reviews.llvm.org/D19840
Reviewed By: ruiu, rnk
llvm-svn: 268343
|
| |
|
|
| |
llvm-svn: 268316
|
| |
|
|
| |
llvm-svn: 268277
|
| |
|
|
| |
llvm-svn: 268270
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
PDB has a lot of similar data structures. We already have code
for parsing a Name Map, but PDB seems to have a different but
very similar structure that is a hash table. This is the
beginning of code needed in order to parse the name hash table,
but it is not yet complete. It parses the basic metadata of
the hash table, the bucket array, and the names buffer, but
doesn't use any of these fields yet as the data structure
requires a non-trivial amount of work to understand.
llvm-svn: 268268
|
| |
|
|
|
|
|
|
|
|
| |
There are probably hundreds of crashers we can find by fuzzing
more. For now we do the simplest possible validation of the
block size. Later, more complicated validations can verify that
other fields of the super block such as directory size, number
of blocks, agree with the size of the file etc.
llvm-svn: 268084
|
| |
|
|
| |
llvm-svn: 268072
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The motivation for this change is that PDB has the notion of
streams and substreams. Substreams often consist of variable
length structures that are convenient to be able to treat as
guaranteed, contiguous byte arrays, whereas the streams they
are contained in are not necessarily so, as a single stream
could be spread across many discontiguous blocks.
So, when processing data from a substream, we want to be able
to assume that we have a contiguous byte array so that we can
cast pointers to variable length arrays and such.
This leads to the question of how to be able to read the same
data structure from either a stream or a substream using the
same interface, which is where this patch comes in.
We separate out the stream's read state from the underlying
representation, and introduce a `StreamReader` class. Then
we change the name of `PDBStream` to `MappedBlockStream`, and
introduce a second kind of stream called a `ByteStream` which is
simply a sequence of contiguous bytes. Finally, we update all
of the std::vectors in `PDBDbiStream` to use `ByteStream` instead
as a proof of concept.
llvm-svn: 268071
|
| |
|
|
|
|
| |
We didn't check that the file was large enough to hold a super block.
llvm-svn: 267965
|
| |
|
|
|
|
|
| |
We lost the ability to report errors, bring it back. Also, correctly
validate the block size.
llvm-svn: 267955
|
| |
|
|
|
|
|
|
|
| |
A bug was introduced when the code was refactored which resulted in a
bad memory access.
This fixes PR27565.
llvm-svn: 267953
|