1 =====================================
2 CodeView Symbol Records
3 =====================================
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.
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:
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
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.
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>`).
120 S_UNAMESPACE (0x1124)
121 ^^^^^^^^^^^^^^^^^^^^^
123 S_TRAMPOLINE (0x112c)
124 ^^^^^^^^^^^^^^^^^^^^^
135 S_CALLSITEINFO (0x1139)
136 ^^^^^^^^^^^^^^^^^^^^^^^
138 S_FRAMECOOKIE (0x113a)
139 ^^^^^^^^^^^^^^^^^^^^^^
153 S_DEFRANGE_SUBFIELD (0x1140)
154 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156 S_DEFRANGE_REGISTER (0x1141)
157 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159 S_DEFRANGE_FRAMEPOINTER_REL (0x1142)
160 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
162 S_DEFRANGE_SUBFIELD_REGISTER (0x1143)
163 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165 S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE (0x1144)
166 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168 S_DEFRANGE_REGISTER_REL (0x1145)
169 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
171 S_LPROC32_ID (0x1146)
172 ^^^^^^^^^^^^^^^^^^^^^
174 S_GPROC32_ID (0x1147)
175 ^^^^^^^^^^^^^^^^^^^^^
180 S_INLINESITE (0x114d)
181 ^^^^^^^^^^^^^^^^^^^^^
183 S_INLINESITE_END (0x114e)
184 ^^^^^^^^^^^^^^^^^^^^^^^^^
186 S_PROC_ID_END (0x114f)
187 ^^^^^^^^^^^^^^^^^^^^^^
189 S_FILESTATIC (0x1153)
190 ^^^^^^^^^^^^^^^^^^^^^
192 S_LPROC32_DPC (0x1155)
193 ^^^^^^^^^^^^^^^^^^^^^^
195 S_LPROC32_DPC_ID (0x1156)
196 ^^^^^^^^^^^^^^^^^^^^^^^^^
204 S_HEAPALLOCSITE (0x115e)
205 ^^^^^^^^^^^^^^^^^^^^^^^^
213 .. _module_and_global_symbols:
215 Symbols which can go in either/both of the module info stream & global stream
216 -----------------------------------------------------------------------------
233 S_MANCONSTANT (0x112d)
234 ^^^^^^^^^^^^^^^^^^^^^^