| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds the method MCStreamer::EmitBinaryData, which is usually an alias
for EmitBytes. In the MCAsmStreamer case, it is overridden to emit hex
dump output like this:
.byte 0x0e, 0x00, 0x08, 0x10
.byte 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x10, 0x00, 0x00
Also, when verbose asm comments are enabled, this patch prints the dump
output for each comment before its record, like this:
# ArgList (0x1000) {
# TypeLeafKind: LF_ARGLIST (0x1201)
# NumArgs: 0
# Arguments [
# ]
# }
.byte 0x06, 0x00, 0x01, 0x12
.byte 0x00, 0x00, 0x00, 0x00
This should make debugging easier and testing more convenient.
Reviewers: aaboud
Subscribers: majnemer, zturner, amccarth, aaboud, llvm-commits
Differential Revision: http://reviews.llvm.org/D20711
llvm-svn: 271313
|
|
|
|
| |
llvm-svn: 271132
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This converts remaining uses of ByteStream, which was still
left in the symbol stream and type stream, to using the new
StreamInterface zero-copy classes.
RecordIterator is finally deleted, so this is the only way left
now. Additionally, more error checking is added when iterating
the various streams.
With this, the transition to zero copy pdb access is complete.
llvm-svn: 271101
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20712
llvm-svn: 270943
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20707
llvm-svn: 270937
|
|
|
|
| |
llvm-svn: 270934
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Dumping it as ASCII makes it fairly useless.
llvm-svn: 270742
|
|
|
|
|
|
|
| |
We know at least know the meaning of every stream of the
PDB file. Yay!
llvm-svn: 270669
|
|
|
|
| |
llvm-svn: 270661
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20580
Reviewed By: ruiu
llvm-svn: 270597
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes use of the newly introduced `CVSymbolVisitor` to dump details
of each type of symbol record in the symbol streams. Future patches will
bring this visitor based dumping to the publics stream, as well as
creating a `SymbolDumpDelegate` to print more information about
relocations etc.
Differential Revision: http://reviews.llvm.org/D20545
Reviewed By: ruiu
llvm-svn: 270585
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20441
llvm-svn: 270088
|
|
|
|
| |
llvm-svn: 269955
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 268948
|
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20026
Reviewed By: rnk
llvm-svn: 268942
|
|
|
|
|
|
|
| |
Reviewed By: amccarth
Differential Revision: http://reviews.llvm.org/D20038
llvm-svn: 268941
|
|
|
|
|
|
|
|
|
|
| |
This reuses the CVTypeDumper from libcodeview to dump full
information about type records within a PDB file.
Differential Revision: http://reviews.llvm.org/D20022
Reviewed By: rnk
llvm-svn: 268808
|
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D19940
Reviewed By: rnk
llvm-svn: 268791
|
|
|
|
|
|
|
| |
This reverts r268508 and reinstates r268506 with an additional cast from
TypeLeafKind to unsigned to allow conversion to HexNumber.
llvm-svn: 268517
|
|
|
|
|
|
| |
This reverts commit r268506 due to build breakage.
llvm-svn: 268508
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When printing raw PDB file fields, streams, and records, use the
ScopedPrinter class so we have consistency with llvm-readobj's output
format.
For the most part this is pretty mechanical, but I had to fix up the test
file to conform to the new YAMLesque output format. i added a few
additional helper functions to the ScopedPrinter such as one to print a
dotted version, etc.
Differential Revision: http://reviews.llvm.org/D19897
Reviewed By: rnk
llvm-svn: 268506
|
|
|
|
| |
llvm-svn: 268458
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
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 lost the ability to report errors, bring it back. Also, correctly
validate the block size.
llvm-svn: 267955
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now read out the rest of the substreams from the DBI streams. One of
these substreams, the FileInfo substream, contains information about which
source files contribute to each module (aka compiland). This patch
additionally parses out the file information from that substream, and
dumps it in llvm-pdbdump.
Differential Revision: http://reviews.llvm.org/D19634
Reviewed by: ruiu
llvm-svn: 267928
|
|
|
|
|
|
|
|
|
|
|
|
| |
This gets more data out of the DBI strema of the PDB. In
particular it extracts the metadata for the list of modules
(compilands) that this PDB contains info about, and adds support
for dumping these fields to llvm-pdbdump.
Differential Revision: http://reviews.llvm.org/D19570
Reviewed By: ruiu
llvm-svn: 267818
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The DBI stream contains a lot of bookkeeping information for other
streams. In particular it contains information about section contributions
and linked modules. This patch is a first attempt at parsing some of the
information out of the DBI stream. It currently only parses and dumps the
headers of the DBI stream, so none of the module data or section
contribution data is pulled out.
This is just a proof of concept that we understand the basic properties of
the DBI stream's metadata, and followup patches will try to extract more
detailed information out.
Differential Revision: http://reviews.llvm.org/D19500
Reviewed By: majnemer, ruiu
llvm-svn: 267585
|
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D19445
Reviewed By: David Majnemer
llvm-svn: 267564
|
|
|
|
|
|
|
| |
This fixes a number of endianness issues as well as an ODR
violation that hopefully causes everything to be happy.
llvm-svn: 267431
|
|
|
|
|
|
| |
r267049 broke multiple buildbots (e.g. clang-cmake-mips, and clang-x86_64-linux-selfhost-modules) which the follow-ups have not yet resolved and this is preventing subsequent committers from being notified about additional failures on the affected buildbots.
llvm-svn: 267148
|
|
|
|
| |
llvm-svn: 267071
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the
parsing of this code into DebugInfoPDB and makes the dumper use this.
This is achieved by implementing the skeleton of RawPdbSession, the
non-DIA counterpart to the existing PDB read interface. None of the type /
source file / etc information is accessible yet, so this implementation is
not yet close to achieving parity with the DIA counterpart, but the
RawSession class simply holds a reference to a PDBFile class which handles
parsing the file format. Additionally a PDBStream class is introduced
which allows accessing the bytes of a particular stream in a PDB file.
Differential Revision: http://reviews.llvm.org/D19343
Reviewed By: majnemer
llvm-svn: 267049
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D19234
llvm-svn: 266772
|
|
|
|
|
|
|
| |
This patch adds the -lines command line option which will dump
source/line information for each compiland and source file.
llvm-svn: 262962
|
|
|
|
|
|
| |
We can decode a little bit of the first stream now.
llvm-svn: 260754
|
|
|
|
| |
llvm-svn: 257804
|