Commit Graph

7 Commits

Author SHA1 Message Date
Zachary Turner
06e4df3aff [llvm-pdbutil] Add the ability to explain binary files.
Using this, you can use llvm-pdbutil to export the contents of a
stream to a binary file, then run explain on the binary file so
that it treats the offset as an offset into the stream instead
of an offset into a file.  This makes it easy to compare the
contents of the same stream from two different files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329207 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 17:29:09 +00:00
Zachary Turner
b145b4e996 Fix some signed / unsigned conversion problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328881 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-30 17:28:35 +00:00
Zachary Turner
21ff13f9ff [llvm-pdbutil] Dig deeper into the PDB and DBI streams when explaining.
This will show more detail when using `llvm-pdbutil explain` on an
offset in the DBI or PDB streams.  Specifically, it will dig into
individual header fields and substreams to give a more precise
description of what the byte represents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328878 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-30 17:16:50 +00:00
Zachary Turner
103f6b63eb [PDB] Print some more details when explaining MSF fields.
When we determine that a field belongs to an MSF super block or
the free page map, we wouldn't print any additional information.

With this patch, we now print the value of the field (for super
block fields) or the allocation status of the specified byte (in
the case of offsets in the FPM).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328808 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 17:45:34 +00:00
Zachary Turner
5551cf2225 [PDB] Fix a bug in the explain subcommand.
We were trying to dig into the super block fields and print a
description of the field at the specified offset, but we were
printing the wrong field due to an off-by-one-field-error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328804 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 17:11:14 +00:00
Zachary Turner
5be0416151 Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328802 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 16:46:47 +00:00
Zachary Turner
0ebcf2f5d7 [PDB] Add an explain subcommand.
When investigating various things, we often have a file offset
and what to know what's in the PDB at that address.  For example
we may be doing a binary comparison of two LLD-generated PDBs
to look for sources of non-determinism, or we may wish to compare
an LLD-generated PDB with a Microsoft generated PDB for sources
of byte-for-byte incompatibility.  In these cases, we can do a
binary diff of the two files, and once we find a mismatched byte
we can use explain to figure out what that byte is, immediately
honining in on the problem.

This patch implements this by trying to narrow the meaning of
a particular file offset down as much as possible.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328799 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 16:28:20 +00:00