llvm.org GIT mirror llvm / 29916a1
Add documentation for the PDB Module Info stream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288205 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 2 years ago
4 changed file(s) with 88 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 =====================================
1 CodeView Symbol Records
2 =====================================
3
0 =====================================
1 CodeView Type Records
2 =====================================
3
0 =====================================
11 The Module Information Stream
22 =====================================
3
4 .. contents::
5 :local:
6
7 .. _modi_stream_intro:
8
9 Introduction
10 ============
11
12 The Module Info Stream (henceforth referred to as the Modi stream) contains
13 information about a single module (object file, import library, etc that
14 contributes to the binary this PDB contains debug information about. There
15 is one modi stream for each module, and the mapping between modi stream index
16 and module is contained in the :doc:`DBI Stream `. The modi stream
17 for a single module contains line information for the compiland, as well as
18 all CodeView information for the symbols defined in the compiland. Finally,
19 there is a "global refs" substream which is not well understood.
20
21 .. _modi_stream_layout:
22
23 Stream Layout
24 =============
25
26 A modi stream is laid out as follows:
27
28
29 .. code-block:: c++
30
31 struct ModiStream {
32 uint32_t Signature;
33 uint8_t Symbols[SymbolSize-4];
34 uint8_t C11LineInfo[C11Size];
35 uint8_t C13LineInfo[C13Size];
36
37 uint32_t GlobalRefsSize;
38 uint8_t GlobalRefs[GlobalRefsSize];
39 };
40
41 - **Signature** - Unknown. In practice only the value of ``4`` has been
42 observed. It is hypothesized that this value corresponds to the set of
43 ``CV_SIGNATURE_xx`` defines in ``cvinfo.h``, with the value of ``4``
44 meaning that this module has C13 line information (as opposed to C11 line
45 information). A corollary of this is that we expect to only ever see
46 C13 line info, and that we do not understand the format of C11 line info.
47
48 - **Symbols** - The :ref:`CodeView Symbol Substream `.
49 ``SymbolSize`` is equal to the value of ``SymByteSize`` for the
50 corresponding module's entry in the :ref:`Module Info Substream `
51 of the :doc:`DBI Stream `.
52
53 - **C11LineInfo** - A block containing CodeView line information in C11
54 format. ``C11Size`` is equal to the value of ``C11ByteSize`` from the
55 :ref:`Module Info Substream ` of the
56 :doc:`DBI Stream `. If this value is ``0``, then C11 line
57 information is not present. As mentioned previously, the format of
58 C11 line info is not understood and we assume all line in modern PDBs
59 to be in C13 format.
60
61 - **C13LineInfo** - A block containing CodeView line information in C13
62 format. ``C13Size`` is equal to the value of ``C13ByteSize`` from the
63 :ref:`Module Info Substream ` of the
64 :doc:`DBI Stream `. If this value is ``0``, then C13 line
65 information is not present.
66
67 - **GlobalRefs** - The meaning of this substream is not understood.
68
69 .. _modi_symbol_substream:
70
71 The CodeView Symbol Substream
72 =============================
73
74 The CodeView Symbol Substream. This is an array of variable length
75 records describing the functions, variables, inlining information,
76 and other symbols defined in the compiland. The entire array consumes
77 ``SymbolSize-4`` bytes. The format of a CodeView Symbol Record (and
78 thusly, an array of CodeView Symbol Records) is described in
79 :doc:`CodeViewSymbols`.
5252 PublicStream
5353 GlobalStream
5454 HashStream
55 CodeViewSymbols
56 CodeViewTypes
5557
5658 .. _msf:
5759
160162 the structure of the overall file, and PDB defines the set of streams that
161163 appear within the MSF file and the format of those streams, CodeView defines
162164 the format of **symbol and type records** that appear within specific streams.
163 Refer to the pages on `CodeView Symbol Records` and `CodeView Type Records` for
165 Refer to the pages on :doc:`CodeViewSymbols` and :doc:`CodeViewTypes` for
164166 more information about the CodeView format.