llvm.org GIT mirror llvm / 324cbd6
[PDB Docs] Add some prose describing public and global symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358289 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 6 months ago
1 changed file(s) with 38 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5151 Public Symbols
5252 --------------
5353
54 Public symbols are the CodeView equivalent of DWARF ``.debug_pubnames``. There
55 is one public symbol record for every function or variable in the program that
56 has a mangled name. The :doc:`Publics Stream `, which contains these
57 records, additionally contains a hash table that allows one to quickly locate a
58 record by mangled name.
59
5460 S_PUB32 (0x110e)
5561 ^^^^^^^^^^^^^^^^
5662
63 There is only type of public symbol, an ``S_PUB32`` which describes a mangled
64 name, a flag indicating what kind of symbol it is (e.g. function, variable), and
65 the symbol's address. The :ref:`dbi_section_map_substream` of the
66 :doc:`DBI Stream ` can be consulted to determine what module this address
67 corresponds to, and from there that module's :doc:`module debug stream `
68 can be consulted to locate full information for the symbol with the given address.
69
5770 .. _global_symbols:
5871
5972 Global Symbols
6073 --------------
6174
75 While there is one :ref:`public symbol ` for every symbol in the
76 program with `external` linkage, there is one global symbol for every symbol in the
77 program with linkage (including internal linkage). As a result, global symbols do
78 not describe a mangled name *or* an address, since symbols with internal linkage
79 need not have any mangling at all, and also may not have an address. Thus, all
80 global symbols simply refer directly to the full symbol record via a module/offset
81 combination.
82
83 Similarly to :ref:`public symbols `, all global symbols are contained
84 in a single :doc:`Globals Stream `, which contains a hash table mapping
85 fully qualified name to the corresponding record in the globals stream (which as
86 mentioned, then contains information allowing one to locate the full record in the
87 corresponding module symbol stream).
88
89 Note that a consequence and limitation of this design is that program-wide lookup
90 by anything other than an exact textually matching fully-qualified name of whatever
91 the compiler decided to emit is impractical. This differs from DWARF, where even
92 though we don't necessarily have O(1) lookup by basename within a given scope (including
93 O(1) scope, we at least have O(n) access within a given scope).
94
95 .. important::
96 Program-wide lookup of names by anything other than an exact textually matching fully
97 qualified name is not possible.
98
99
62100 S_GDATA32
63101 ^^^^^^^^^^
64102
71109 S_LPROCREF (0x1127)
72110 ^^^^^^^^^^^^^^^^^^^
73111
74
75112 S_GMANDATA (0x111d)
76113 ^^^^^^^^^^^^^^^^^^^
77114