Browse Source

Fix #3255: Ignore exceptions while decoding sequence point blobs.

pull/3265/head
Siegfried Pammer 9 months ago
parent
commit
930a4a20d1
  1. 47
      ICSharpCode.ILSpyX/PdbProvider/PortableDebugInfoProvider.cs

47
ICSharpCode.ILSpyX/PdbProvider/PortableDebugInfoProvider.cs

@ -98,31 +98,38 @@ namespace ICSharpCode.ILSpyX.PdbProvider @@ -98,31 +98,38 @@ namespace ICSharpCode.ILSpyX.PdbProvider
var debugInfo = metadata.GetMethodDebugInformation(method);
var sequencePoints = new List<Decompiler.DebugInfo.SequencePoint>();
foreach (var point in debugInfo.GetSequencePoints())
try
{
string documentFileName;
if (!point.Document.IsNil)
{
var document = metadata.GetDocument(point.Document);
documentFileName = metadata.GetString(document.Name);
}
else
foreach (var point in debugInfo.GetSequencePoints())
{
documentFileName = "";
string documentFileName;
if (!point.Document.IsNil)
{
var document = metadata.GetDocument(point.Document);
documentFileName = metadata.GetString(document.Name);
}
else
{
documentFileName = "";
}
sequencePoints.Add(new Decompiler.DebugInfo.SequencePoint() {
Offset = point.Offset,
StartLine = point.StartLine,
StartColumn = point.StartColumn,
EndLine = point.EndLine,
EndColumn = point.EndColumn,
DocumentUrl = documentFileName
});
}
sequencePoints.Add(new Decompiler.DebugInfo.SequencePoint() {
Offset = point.Offset,
StartLine = point.StartLine,
StartColumn = point.StartColumn,
EndLine = point.EndLine,
EndColumn = point.EndColumn,
DocumentUrl = documentFileName
});
return sequencePoints;
}
catch (BadImageFormatException)
{
return EmptyList<Decompiler.DebugInfo.SequencePoint>.Instance;
}
return sequencePoints;
}
public IList<Variable> GetVariables(MethodDefinitionHandle method)

Loading…
Cancel
Save