OSDN Git Service

[PDB Docs] Add skeleton of documentation for CodeView symbols.
[android-x86/external-llvm.git] / docs / PDB / CodeViewSymbols.rst
1 =====================================
2 CodeView Symbol Records
3 =====================================
4
5
6 .. contents::
7    :local:
8
9 .. _symbols_intro:
10
11 Introduction
12 ============
13
14 This document describes the usage and serialization format of the various
15 CodeView symbol records that LLVM understands.  Like
16 :doc:`CodeView Type Records <CodeViewTypes>`, we describe only the important
17 types which are generated by modern C++ toolchains.
18
19 Record Categories
20 =================
21
22 Symbol records share one major similarity with :doc:`type records <CodeViewTypes>`:
23 They start with the same :ref:`record prefix <leaf_types>`, which we will not describe
24 again (refer to the previous link for a description).  As a result of this, a sequence
25 of symbol records can be processed with largely the same code as that which processes
26 type records.  There are several important differences between symbol and type records:
27
28 * Symbol records only appear in the :doc:`PublicStream`, :doc:`GlobalStream`, and
29   :doc:`Module Info Streams <ModiStream>`.
30 * Type records only appear in the :doc:`TPI & IPI streams <TpiStream>`.
31 * While types are referenced from other CodeView records via :ref:`type indices <type_indices>`,
32   symbol records are referenced by the byte offset of the record in the stream that it appears
33   in.
34 * Types can reference types (via type indices), and symbols can reference both types (via type
35   indices) and symbols (via offsets), but types can never reference symbols.
36 * There is no notion of :ref:`Leaf Records <leaf_types>` and :ref:`Member Records <member_types>`
37   as there are with types.  Every symbol record describes is own length.
38 * Certain special symbol records begin a "scope".  For these records, all following records
39   up until the next ``S_END`` record are "children" of this symbol record.  For example,
40   given a symbol record which describes a certain function, all local variables of this
41   function would appear following the function up until the corresponding ``S_END`` record.
42
43 Finally, there are three general categories of symbol record, grouped by where they are legal
44 to appear in a PDB file.  Public Symbols (which appear only in the
45 :doc:`publics stream <PublicStream>`), Global Symbols (which appear only in the
46 :doc:`globals stream <GlobalStream>`) and module symbols (which appear in the
47 :doc:`module info stream <ModiStream>`).
48
49
50 .. _public_symbols:
51
52 Public Symbols
53 --------------
54
55 S_PUB32 (0x110e)
56 ^^^^^^^^^^^^^^^^
57
58 .. _global_symbols:
59
60 Global Symbols
61 --------------
62
63 S_GDATA32
64 ^^^^^^^^^^
65
66 S_GTHREAD32 (0x1113)
67 ^^^^^^^^^^^^^^^^^^^^
68
69 S_PROCREF (0x1125)
70 ^^^^^^^^^^^^^^^^^^
71
72 S_LPROCREF (0x1127)
73 ^^^^^^^^^^^^^^^^^^^
74
75
76 S_GMANDATA (0x111d)
77 ^^^^^^^^^^^^^^^^^^^
78
79 .. _module_symbols:
80
81 Module Symbols
82 --------------
83
84 S_END (0x0006)
85 ^^^^^^^^^^^^^^
86
87 S_FRAMEPROC (0x1012)
88 ^^^^^^^^^^^^^^^^^^^^
89
90 S_OBJNAME (0x1101)
91 ^^^^^^^^^^^^^^^^^^
92
93 S_THUNK32 (0x1102)
94 ^^^^^^^^^^^^^^^^^^
95
96 S_BLOCK32 (0x1103)
97 ^^^^^^^^^^^^^^^^^^
98
99 S_LABEL32 (0x1105)
100 ^^^^^^^^^^^^^^^^^^
101
102 S_REGISTER (0x1106)
103 ^^^^^^^^^^^^^^^^^^^
104
105 S_BPREL32 (0x110b)
106 ^^^^^^^^^^^^^^^^^^
107
108 S_LPROC32 (0x110f)
109 ^^^^^^^^^^^^^^^^^^
110
111 S_GPROC32 (0x1110)
112 ^^^^^^^^^^^^^^^^^^
113
114 S_REGREL32 (0x1111)
115 ^^^^^^^^^^^^^^^^^^^
116
117 S_COMPILE2 (0x1116)
118 ^^^^^^^^^^^^^^^^^^^
119
120 S_UNAMESPACE (0x1124)
121 ^^^^^^^^^^^^^^^^^^^^^
122
123 S_TRAMPOLINE (0x112c)
124 ^^^^^^^^^^^^^^^^^^^^^
125
126 S_SECTION (0x1136)
127 ^^^^^^^^^^^^^^^^^^
128
129 S_COFFGROUP (0x1137)
130 ^^^^^^^^^^^^^^^^^^^^
131
132 S_EXPORT (0x1138)
133 ^^^^^^^^^^^^^^^^^
134
135 S_CALLSITEINFO (0x1139)
136 ^^^^^^^^^^^^^^^^^^^^^^^
137
138 S_FRAMECOOKIE (0x113a)
139 ^^^^^^^^^^^^^^^^^^^^^^
140
141 S_COMPILE3 (0x113c)
142 ^^^^^^^^^^^^^^^^^^^
143
144 S_ENVBLOCK (0x113d)
145 ^^^^^^^^^^^^^^^^^^^
146
147 S_LOCAL (0x113e)
148 ^^^^^^^^^^^^^^^^
149
150 S_DEFRANGE (0x113f)
151 ^^^^^^^^^^^^^^^^^^^
152
153 S_DEFRANGE_SUBFIELD (0x1140)
154 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155
156 S_DEFRANGE_REGISTER (0x1141)
157 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158
159 S_DEFRANGE_FRAMEPOINTER_REL (0x1142)
160 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
161
162 S_DEFRANGE_SUBFIELD_REGISTER (0x1143)
163 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164
165 S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE (0x1144)
166 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167
168 S_DEFRANGE_REGISTER_REL (0x1145)
169 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170
171 S_LPROC32_ID (0x1146)
172 ^^^^^^^^^^^^^^^^^^^^^
173
174 S_GPROC32_ID (0x1147)
175 ^^^^^^^^^^^^^^^^^^^^^
176
177 S_BUILDINFO (0x114c)
178 ^^^^^^^^^^^^^^^^^^^^
179
180 S_INLINESITE (0x114d)
181 ^^^^^^^^^^^^^^^^^^^^^
182
183 S_INLINESITE_END (0x114e)
184 ^^^^^^^^^^^^^^^^^^^^^^^^^
185
186 S_PROC_ID_END (0x114f)
187 ^^^^^^^^^^^^^^^^^^^^^^
188
189 S_FILESTATIC (0x1153)
190 ^^^^^^^^^^^^^^^^^^^^^
191
192 S_LPROC32_DPC (0x1155)
193 ^^^^^^^^^^^^^^^^^^^^^^
194
195 S_LPROC32_DPC_ID (0x1156)
196 ^^^^^^^^^^^^^^^^^^^^^^^^^
197
198 S_CALLEES (0x115a)
199 ^^^^^^^^^^^^^^^^^^
200
201 S_CALLERS (0x115b)
202 ^^^^^^^^^^^^^^^^^^
203
204 S_HEAPALLOCSITE (0x115e)
205 ^^^^^^^^^^^^^^^^^^^^^^^^
206
207 S_FASTLINK (0x1167)
208 ^^^^^^^^^^^^^^^^^^^
209
210 S_INLINEES (0x1168)
211 ^^^^^^^^^^^^^^^^^^^
212
213 .. _module_and_global_symbols:
214
215 Symbols which can go in either/both of the module info stream & global stream
216 -----------------------------------------------------------------------------
217
218 S_CONSTANT (0x1107)
219 ^^^^^^^^^^^^^^^^^^^
220
221 S_UDT (0x1108)
222 ^^^^^^^^^^^^^^
223
224 S_LDATA32 (0x110c)
225 ^^^^^^^^^^^^^^^^^^
226
227 S_LTHREAD32 (0x1112)
228 ^^^^^^^^^^^^^^^^^^^^
229
230 S_LMANDATA (0x111c)
231 ^^^^^^^^^^^^^^^^^^^
232
233 S_MANCONSTANT (0x112d)
234 ^^^^^^^^^^^^^^^^^^^^^^
235