1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
//! Raw `CustomDebugInformation` table representation for Portable PDB format.
//!
//! This module provides the [`crate::metadata::tables::customdebuginformation::CustomDebugInformationRaw`] struct that represents
//! the binary format of `CustomDebugInformation` table entries as they appear in
//! the metadata tables stream. This is the low-level representation used during
//! the initial parsing phase, containing unresolved heap indices that require
//! resolution to access actual data.
//!
//! # Key Components
//!
//! - [`crate::metadata::tables::customdebuginformation::CustomDebugInformationRaw`] - Raw binary representation with unresolved indices
//!
//! # Thread Safety
//!
//! All types in this module are [`Send`] and [`Clone`], enabling safe sharing
//! across threads and efficient copying when needed.
use crate::;
use Arc;
/// Raw binary representation of a `CustomDebugInformation` table entry
///
/// This structure matches the exact binary layout of `CustomDebugInformation` table
/// entries in the metadata tables stream. All fields contain unresolved indices
/// that must be resolved during conversion to the owned [`crate::metadata::tables::customdebuginformation::CustomDebugInformation`] variant.
///
/// # Binary Format
///
/// Each `CustomDebugInformation` table entry consists of:
/// - **Parent** (variable bytes): `HasCustomDebugInformation` coded index to the metadata element
/// - **Kind** (variable bytes): GUID heap index identifying the type of custom debug information
/// - **Value** (variable bytes): Blob heap index containing the custom debug information data
///
/// # Coded Index: `HasCustomDebugInformation`
///
/// The Parent field uses the `HasCustomDebugInformation` coded index which can reference:
/// - `MethodDef`, `Field`, `TypeRef`, `TypeDef`, `Param`, `InterfaceImpl`, `MemberRef`, `Module`
/// - `DeclSecurity`, `Property`, `Event`, `StandAloneSig`, `ModuleRef`, `TypeSpec`, `Assembly`
/// - `AssemblyRef`, `File`, `ExportedType`, `ManifestResource`, `GenericParam`, `GenericParamConstraint`
/// - `MethodSpec`, `Document`, `LocalScope`, `LocalVariable`, `LocalConstant`, `ImportScope`
///
/// # Custom Debug Information Types
///
/// Common Kind GUIDs include:
/// - `{6DA9A61E-F8C7-4874-BE62-68BC5630DF71}`: State Machine Hoisted Local Scopes
/// - `{83C563C4-B4F3-47D5-B824-BA5441477EA8}`: Dynamic Local Variables
/// - `{58b2eab6-209f-4e4e-a22c-b2d0f910c782}`: Default Namespace (VB)
/// - `{755F52A8-91C5-45BE-B4B8-209571E552BD}`: Edit and Continue Local Slot Map
/// - `{A643004C-0240-496F-A783-30D64F4979DE}`: Edit and Continue Lambda and Closure Map
/// - `{0E8A571B-6926-466E-B4AD-8AB04611F5FE}`: Embedded Source
/// - `{CC110556-A091-4D38-9FEC-25AB9A351A6A}`: Source Link
///
/// # Constraints
///
/// - Table must be sorted by Parent column
/// - Multiple entries can have the same Parent (different kinds of debug info for same element)
/// - Each Kind GUID defines its own Value blob format
///
/// # References
///
/// - [Portable PDB Format - CustomDebugInformation Table](https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PortablePdb-Metadata.md#customdebuginformation-table-0x37)