Browse Source

Metadata Explorer: Display blob contents of custom debug information in tooltip.

pull/1967/head
Siegfried Pammer 5 years ago
parent
commit
54a742f3f5
  1. 12
      ICSharpCode.Decompiler/Metadata/MetadataExtensions.cs
  2. 4
      ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs

12
ICSharpCode.Decompiler/Metadata/MetadataExtensions.cs

@ -101,6 +101,18 @@ namespace ICSharpCode.Decompiler.Metadata @@ -101,6 +101,18 @@ namespace ICSharpCode.Decompiler.Metadata
return sb.ToString();
}
public static string ToHexString(this BlobReader reader)
{
StringBuilder sb = new StringBuilder(reader.Length * 3);
for (int i = 0; i < reader.Length; i++) {
if (i == 0)
sb.AppendFormat("{0:X2}", reader.ReadByte());
else
sb.AppendFormat("-{0:X2}", reader.ReadByte());
}
return sb.ToString();
}
public static IEnumerable<TypeDefinitionHandle> GetTopLevelTypeDefinitions(this MetadataReader reader)
{
foreach (var handle in reader.TypeDefinitions) {

4
ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs

@ -138,7 +138,9 @@ namespace ICSharpCode.ILSpy.Metadata @@ -138,7 +138,9 @@ namespace ICSharpCode.ILSpy.Metadata
public string ValueTooltip {
get {
return null;
if (debugInfo.Value.IsNil)
return "<nil>";
return metadata.GetBlobReader(debugInfo.Value).ToHexString();
}
}

Loading…
Cancel
Save