| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would read a PDB, then write some of it back out,
but write the directory, super block, and other pertinent metadata
back out unchanged. This generates incorrect PDBs since the amount
of data written was not always the same as the amount of data read.
This patch changes things to use the newly introduced `MsfBuilder`
class to write out a correct and accurate set of Msf metadata for
the data *actually* written, which opens up the door for adding and
removing type records, symbol records, and other types of data to
an existing PDB.
llvm-svn: 275627
|
|
|
|
|
|
| |
Fix a few initialization ordering warnings from gcc from `-Wreorder`. NFC.
llvm-svn: 275615
|
|
|
|
|
|
|
| |
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D22308
llvm-svn: 275611
|
|
|
|
|
|
|
| |
We didn't read unique names correctly. As a result, we computed
hashes on (non-)unique names instead of unique names.
llvm-svn: 275150
|
|
|
|
| |
llvm-svn: 275110
|
|
|
|
| |
llvm-svn: 275014
|
|
|
|
|
|
|
|
| |
Some abstractions in LLVM "know" that they are reading in-bounds,
FixedStreamArray, and provide a simple result. This breaks down if the
stream map is bogus.
llvm-svn: 275010
|
|
|
|
|
|
|
| |
PDBFile::getBlockData didn't really return any indication that it
failed. It merely returned an empty buffer.
llvm-svn: 275009
|
|
|
|
|
|
| |
This gets writing of the PDB stream working.
llvm-svn: 274647
|
|
|
|
| |
llvm-svn: 274639
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This issue was encountered on libcmt.pdb, which has a type record that
looks like this:
Struct (0x1094) {
TypeLeafKind: LF_STRUCTURE (0x1505)
MemberCount: 3
Properties [ (0x200)
HasUniqueName (0x200)
]
FieldList: <field list> (0x1093)
DerivedFrom: 0x0
VShape: 0x0
SizeOf: 4
Name: <unnamed-tag>
LinkageName: .?AU<unnamed-tag>@@
}
The checks for startswith/endswith "<unnamed-tag>" should look at the
display name, not the linkage name.
llvm-svn: 274376
|
|
|
|
| |
llvm-svn: 274309
|
|
|
|
| |
llvm-svn: 274308
|
|
|
|
|
|
|
|
|
| |
Somehow all the functionality to write PDB files got removed,
probably accidentally when uploading the patch perhaps the wrong
one got uploaded. This re-adds all the code, as well as the
corresponding test.
llvm-svn: 274248
|
|
|
|
|
|
| |
My PDBs always have this size for stream 11. Not sure why.
llvm-svn: 273504
|
|
|
|
|
|
|
| |
This patch adds a function that corresponds to `fUDTAnon`
and use that to compute TPI hash values as the reference does.
llvm-svn: 273139
|
|
|
|
|
|
|
|
| |
64-bit PDBs never have FPO data. They have xdata instead.
Also improve error recovery of stream summary dumping while I'm here.
llvm-svn: 273046
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D21393
llvm-svn: 272930
|
|
|
|
|
|
|
| |
There was a regression introduced during type stream merging when
visiting a field list record. This has been fixed in this patch.
llvm-svn: 272929
|
|
|
|
|
|
|
|
| |
This reverts commit fb0dd311e1ad945827b8ffd5354f4810e2be1579.
This breaks some llvm-readobj tests.
llvm-svn: 272927
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows better catching of compiler errors since we can use
the override keyword to verify that methods are actually
overridden.
Also in this patch I've changed from storing a boolean Error
code everywhere to returning an llvm::Error, to propagate richer
error information up the call stack.
Reviewed By: ruiu, rnk
Differential Revision: http://reviews.llvm.org/D21410
llvm-svn: 272926
|
|
|
|
|
|
|
|
|
| |
Both parameters to visitTypeBegin are actually members of CVRecord,
so we can just pass CVRecord instead of destructuring it.
Differential Revision: http://reviews.llvm.org/D21435
llvm-svn: 272899
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D21433
llvm-svn: 272898
|
|
|
|
| |
llvm-svn: 272894
|
|
|
|
| |
llvm-svn: 272889
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D21418
llvm-svn: 272888
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D21361
llvm-svn: 272815
|
|
|
|
| |
llvm-svn: 272728
|
|
|
|
|
|
|
| |
Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21220
llvm-svn: 272708
|
|
|
|
|
|
|
|
|
| |
This reverts commit 879139e1c6577b09df52de56a6bab856a19ed185.
This was committed accidentally when I blindly typed git svn
dcommit instead of the command to generate a patch.
llvm-svn: 272693
|
|
|
|
| |
llvm-svn: 272692
|
|
|
|
|
|
|
|
|
| |
This fixes an alignment issue by forcing all cached allocations
to be 8 byte aligned, and also fixes an issue arising on big
endian systems by writing ulittle32_t's instead of uint32_t's
in the test.
llvm-svn: 272437
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the next step towards being able to write PDBs.
MemoryBuffer is immutable, and StreamInterface is our replacement
which can be any combination of read-only, read-write, or write-only
depending on the particular implementation.
The one place where we were creating a PDBFile (in RawSession) is
updated to subclass ByteStream with a simple adapter that holds
a MemoryBuffer, and initializes the superclass with the buffer's
array, so that all the functionality of ByteStream works
transparently.
llvm-svn: 272370
|
|
|
|
|
|
|
|
|
|
|
| |
This adds method and tests for writing to a PDB stream. With
this, even a PDB stream which is discontiguous can be treated
as a sequential stream of bytes for the purposes of writing.
Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21157
llvm-svn: 272369
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TPI hash table contains a parallel array for the type records.
For each type record R, a hash value is calculated by `H(R) % NumBuckets`
where H is a hash function, and the result is stored to a bucket element.
H is TPI1::hashPrec function in microsoft-pdb repository.
Our hash function does not support all type record types yet.
Currently it supports only records for line number.
I'll extend it in a follow up patch.
The aim of verify the hash table is not only detect corrupted files.
It ensures that our understanding of how the hash values are calculated
is correct.
llvm-svn: 272229
|
|
|
|
| |
llvm-svn: 272225
|
|
|
|
|
|
|
|
| |
We are going to use the hash functions from TPI streams.
Differential Revision: http://reviews.llvm.org/D21142
llvm-svn: 272223
|
|
|
|
|
|
|
| |
Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21128
llvm-svn: 272172
|
|
|
|
| |
llvm-svn: 272171
|
|
|
|
| |
llvm-svn: 272078
|
|
|
|
|
|
| |
In the reference code, the field name is `cHashBuckets`.
llvm-svn: 272075
|
|
|
|
| |
llvm-svn: 272073
|
|
|
|
| |
llvm-svn: 272058
|
|
|
|
| |
llvm-svn: 272043
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to efficiently write PDBs, we need to be able to make a
StreamWriter class similar to a StreamReader, which can transparently deal
with writing to discontiguous streams, and we need to use this for all
writing, similar to how we use StreamReader for all reading.
Most discontiguous streams are the typical numbered streams that appear in
a PDB file and are described by the directory, but the exception to this,
that until now has been parsed by hand, is the directory itself.
MappedBlockStream works by querying the directory to find out which blocks
a stream occupies and various other things, so naturally the same logic
could not possibly work to describe the blocks that the directory itself
resided on.
To solve this, I've introduced an abstraction IPDBStreamData, which allows
the client to query for the list of blocks occupied by the stream, as well
as the stream length. I provide two implementations of this: one which
queries the directory (for indexed streams), and one which queries the
super block (for the directory stream).
This has the side benefit of vastly simplifying the code to parse the
directory. Whereas before a mini state machine was rolled by hand, now we
simply use FixedStreamArray to read out the stream sizes, then build a
vector of FixedStreamArrays for the stream map, all in just a few lines of
code.
Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21046
llvm-svn: 271982
|
|
|
|
| |
llvm-svn: 271967
|
|
|
|
| |
llvm-svn: 271954
|
|
|
|
|
|
|
|
|
|
| |
The data strucutre in the new FPO stream is described in the
PE/COFF spec. There is one record per function if frame pointer
is omitted.
Differential Revision: http://reviews.llvm.org/D20999
llvm-svn: 271926
|
|
|
|
|
|
|
| |
The name map might not be densely packed on disk. Using a sparse map
will save memory in such situations.
llvm-svn: 271811
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20945
llvm-svn: 271736
|