]> granicus.if.org Git - llvm/commitdiff
Add documentation for the PDB Module Info stream.
authorZachary Turner <zturner@google.com>
Tue, 29 Nov 2016 22:14:56 +0000 (22:14 +0000)
committerZachary Turner <zturner@google.com>
Tue, 29 Nov 2016 22:14:56 +0000 (22:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288205 91177308-0d34-0410-b5e6-96231b3b80d8

docs/PDB/CodeViewSymbols.rst [new file with mode: 0644]
docs/PDB/CodeViewTypes.rst [new file with mode: 0644]
docs/PDB/ModiStream.rst
docs/PDB/index.rst

diff --git a/docs/PDB/CodeViewSymbols.rst b/docs/PDB/CodeViewSymbols.rst
new file mode 100644 (file)
index 0000000..8b2133c
--- /dev/null
@@ -0,0 +1,4 @@
+=====================================\r
+CodeView Symbol Records\r
+=====================================\r
+\r
diff --git a/docs/PDB/CodeViewTypes.rst b/docs/PDB/CodeViewTypes.rst
new file mode 100644 (file)
index 0000000..ad806a7
--- /dev/null
@@ -0,0 +1,4 @@
+=====================================\r
+CodeView Type Records\r
+=====================================\r
+\r
index 3eb4505c5ae47f74f321323b79703685c48dbe46..7e500bd921c6fec934e0610e52ea35f58e6efaed 100644 (file)
@@ -1,3 +1,80 @@
 =====================================\r
 The Module Information Stream\r
 =====================================\r
+\r
+.. contents::\r
+   :local:\r
+\r
+.. _modi_stream_intro:\r
+\r
+Introduction\r
+============\r
+\r
+The Module Info Stream (henceforth referred to as the Modi stream) contains\r
+information about a single module (object file, import library, etc that\r
+contributes to the binary this PDB contains debug information about.  There\r
+is one modi stream for each module, and the mapping between modi stream index\r
+and module is contained in the :doc:`DBI Stream <DbiStream>`.  The modi stream\r
+for a single module contains line information for the compiland, as well as\r
+all CodeView information for the symbols defined in the compiland.  Finally,\r
+there is a "global refs" substream which is not well understood.\r
+\r
+.. _modi_stream_layout:\r
+\r
+Stream Layout\r
+=============\r
+\r
+A modi stream is laid out as follows:\r
+\r
+\r
+.. code-block:: c++\r
+\r
+  struct ModiStream {\r
+    uint32_t Signature;\r
+    uint8_t Symbols[SymbolSize-4];\r
+    uint8_t C11LineInfo[C11Size];\r
+    uint8_t C13LineInfo[C13Size];\r
+    \r
+    uint32_t GlobalRefsSize;\r
+    uint8_t GlobalRefs[GlobalRefsSize];\r
+  };\r
+\r
+- **Signature** - Unknown.  In practice only the value of ``4`` has been\r
+  observed.  It is hypothesized that this value corresponds to the set of\r
+  ``CV_SIGNATURE_xx`` defines in ``cvinfo.h``, with the value of ``4``\r
+  meaning that this module has C13 line information (as opposed to C11 line\r
+  information).  A corollary of this is that we expect to only ever see\r
+  C13 line info, and that we do not understand the format of C11 line info.\r
+  \r
+- **Symbols** - The :ref:`CodeView Symbol Substream <modi_symbol_substream>`.\r
+  ``SymbolSize`` is equal to the value of ``SymByteSize`` for the\r
+  corresponding module's entry in the :ref:`Module Info Substream <dbi_mod_info_substream>`\r
+  of the :doc:`DBI Stream <DbiStream>`.\r
+\r
+- **C11LineInfo** - A block containing CodeView line information in C11\r
+  format.  ``C11Size`` is equal to the value of ``C11ByteSize`` from the\r
+  :ref:`Module Info Substream <dbi_mod_info_substream>` of the\r
+  :doc:`DBI Stream <DbiStream>`.  If this value is ``0``, then C11 line\r
+  information is not present.  As mentioned previously, the format of\r
+  C11 line info is not understood and we assume all line in modern PDBs\r
+  to be in C13 format.\r
+  \r
+- **C13LineInfo** - A block containing CodeView line information in C13\r
+  format.  ``C13Size`` is equal to the value of ``C13ByteSize`` from the\r
+  :ref:`Module Info Substream <dbi_mod_info_substream>` of the\r
+  :doc:`DBI Stream <DbiStream>`.  If this value is ``0``, then C13 line\r
+  information is not present.\r
+  \r
+- **GlobalRefs** - The meaning of this substream is not understood.\r
+\r
+.. _modi_symbol_substream:\r
+\r
+The CodeView Symbol Substream\r
+=============================\r
+\r
+The CodeView Symbol Substream.  This is an array of variable length\r
+records describing the functions, variables, inlining information,\r
+and other symbols defined in the compiland.  The entire array consumes\r
+``SymbolSize-4`` bytes.  The format of a CodeView Symbol Record (and\r
+thusly, an array of CodeView Symbol Records) is described in\r
+:doc:`CodeViewSymbols`.\r
index 95328cfc5a47f267031858c160bd859bd1dcce4e..5300588b1d8aee8f622f4f980aa7c95fd5a2cca9 100644 (file)
@@ -53,6 +53,8 @@ File Layout
    PublicStream\r
    GlobalStream\r
    HashStream\r
+   CodeViewSymbols\r
+   CodeViewTypes\r
 \r
 .. _msf:\r
 \r
@@ -161,5 +163,5 @@ CodeView is another format which comes into the picture.  While MSF defines
 the structure of the overall file, and PDB defines the set of streams that\r
 appear within the MSF file and the format of those streams, CodeView defines\r
 the format of **symbol and type records** that appear within specific streams.\r
-Refer to the pages on `CodeView Symbol Records` and `CodeView Type Records` for\r
+Refer to the pages on :doc:`CodeViewSymbols` and :doc:`CodeViewTypes` for\r
 more information about the CodeView format.\r