@@ -854,6 +854,7 @@ public interface ISymbolReader : IDisposable {
854
854
ISymbolWriterProvider GetWriterProvider ( ) ;
855
855
bool ProcessDebugHeader ( ImageDebugHeader header ) ;
856
856
MethodDebugInformation Read ( MethodDefinition method ) ;
857
+ Collection < CustomDebugInformation > Read ( ICustomDebugInformationProvider provider ) ;
857
858
}
858
859
859
860
public interface ISymbolReaderProvider {
@@ -1116,6 +1117,7 @@ public interface ISymbolWriter : IDisposable {
1116
1117
ImageDebugHeader GetDebugHeader ( ) ;
1117
1118
void Write ( MethodDebugInformation info ) ;
1118
1119
void Write ( ) ;
1120
+ void Write ( ICustomDebugInformationProvider provider ) ;
1119
1121
}
1120
1122
1121
1123
public interface ISymbolWriterProvider {
@@ -1224,5 +1226,40 @@ public static bool IsPortablePdb (Stream stream)
1224
1226
stream . Position = position ;
1225
1227
}
1226
1228
}
1229
+
1230
+ public static bool GetHasCustomDebugInformations (
1231
+ this ICustomDebugInformationProvider self ,
1232
+ ref Collection < CustomDebugInformation > collection ,
1233
+ ModuleDefinition module )
1234
+ {
1235
+ if ( module . HasImage ( ) ) {
1236
+ module . Read ( ref collection , self , static ( provider , reader ) => {
1237
+ var symbol_reader = reader . module . symbol_reader ;
1238
+ if ( symbol_reader != null )
1239
+ return symbol_reader . Read ( provider ) ;
1240
+ return null ;
1241
+ } ) ;
1242
+ }
1243
+
1244
+ return ! collection . IsNullOrEmpty ( ) ;
1245
+ }
1246
+
1247
+ public static Collection < CustomDebugInformation > GetCustomDebugInformations (
1248
+ this ICustomDebugInformationProvider self ,
1249
+ ref Collection < CustomDebugInformation > collection ,
1250
+ ModuleDefinition module )
1251
+ {
1252
+ if ( module . HasImage ( ) ) {
1253
+ module . Read ( ref collection , self , static ( provider , reader ) => {
1254
+ var symbol_reader = reader . module . symbol_reader ;
1255
+ if ( symbol_reader != null )
1256
+ return symbol_reader . Read ( provider ) ;
1257
+ return null ;
1258
+ } ) ;
1259
+ }
1260
+
1261
+ Interlocked . CompareExchange ( ref collection , new Collection < CustomDebugInformation > ( ) , null ) ;
1262
+ return collection ;
1263
+ }
1227
1264
}
1228
1265
}
0 commit comments