390 {
391 if (peImagePath == null)
392 {
393 Throw.ArgumentNull(
"peImagePath");
394 }
395 if (pdbFileStreamProvider == null)
396 {
397 Throw.ArgumentNull(
"pdbFileStreamProvider");
398 }
399 pdbReaderProvider = null;
400 pdbPath = null;
401 string directoryName;
402 try
403 {
405 }
406 catch (Exception ex)
407 {
409 }
410 Exception errorToReport = null;
412 DebugDirectoryEntry codeViewEntry =
collection.FirstOrDefault((DebugDirectoryEntry e) => e.IsPortableCodeView);
413 if (codeViewEntry.DataSize != 0 &&
TryOpenCodeViewPortablePdb(codeViewEntry, directoryName, pdbFileStreamProvider, out pdbReaderProvider, out pdbPath, ref errorToReport))
414 {
415 return true;
416 }
417 DebugDirectoryEntry embeddedPdbEntry =
collection.FirstOrDefault((DebugDirectoryEntry e) => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
418 if (embeddedPdbEntry.DataSize != 0)
419 {
420 bool openedEmbeddedPdb = false;
421 pdbReaderProvider = null;
423 if (openedEmbeddedPdb)
424 {
425 return true;
426 }
427 }
428 if (errorToReport != null)
429 {
431 }
432 return false;
433 }
static ? string GetDirectoryName(string? path)
ImmutableArray< DebugDirectoryEntry > ReadDebugDirectory()
void TryOpenEmbeddedPortablePdb(DebugDirectoryEntry embeddedPdbEntry, ref bool openedEmbeddedPdb, ref MetadataReaderProvider provider, ref Exception errorToReport)
bool TryOpenCodeViewPortablePdb(DebugDirectoryEntry codeViewEntry, string peImageDirectory, Func< string, Stream > pdbFileStreamProvider, out MetadataReaderProvider provider, out string pdbPath, ref Exception errorToReport)
static ExceptionDispatchInfo Capture(Exception source)