Browse Source

Add Show GC Info checkbox

pull/3076/head
unknown 2 years ago
parent
commit
c39a1f7fcc
  1. 11
      ILSpy.ReadyToRun/Properties/Resources.Designer.cs
  2. 3
      ILSpy.ReadyToRun/Properties/Resources.resx
  3. 3
      ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx
  4. 2
      ILSpy.ReadyToRun/ReadyToRunDisassembler.cs
  5. 3
      ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml
  6. 15
      ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs
  7. 22
      ILSpy.ReadyToRun/ReadyToRunOptions.cs

11
ILSpy.ReadyToRun/Properties/Resources.Designer.cs generated

@ -95,5 +95,14 @@ namespace ILSpy.ReadyToRun.Properties { @@ -95,5 +95,14 @@ namespace ILSpy.ReadyToRun.Properties {
return ResourceManager.GetString("ShowUnwindInfo", resourceCulture);
}
}
}
/// <summary>
/// Looks up a localized string similar to Show GC Info.
/// </summary>
public static string ShowGCInfo {
get {
return ResourceManager.GetString("ShowGCInfo", resourceCulture);
}
}
}
}

3
ILSpy.ReadyToRun/Properties/Resources.resx

@ -129,4 +129,7 @@ @@ -129,4 +129,7 @@
<data name="ShowUnwindInfo" xml:space="preserve">
<value>Show Unwind Info</value>
</data>
<data name="ShowGCInfo" xml:space="preserve">
<value>Show GC Info</value>
</data>
</root>

3
ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx

@ -129,4 +129,7 @@ @@ -129,4 +129,7 @@
<data name="ShowUnwindInfo" xml:space="preserve">
<value>显示展开信息</value>
</data>
<data name="ShowGCInfo" xml:space="preserve">
<value>?</value>
</data>
</root>

2
ILSpy.ReadyToRun/ReadyToRunDisassembler.cs

@ -50,7 +50,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun @@ -50,7 +50,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun
ReadyToRunMethod readyToRunMethod = runtimeFunction.Method;
WriteCommentLine(readyToRunMethod.SignatureString);
if (readyToRunMethod.GcInfo != null)
if (ReadyToRunOptions.GetIsShowGCInfo(null) && readyToRunMethod.GcInfo != null)
{
string[] lines = readyToRunMethod.GcInfo.ToString().Split(Environment.NewLine);
WriteCommentLine("GC info:");

3
ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Margin="3" Text="{x:Static properties:Resources.DisassemblyFormat}" />
<ComboBox Grid.Column="1" Margin="3" ItemsSource="{Binding DisassemblyFormats}" SelectedItem="{Binding DisassemblyFormat}" />
@ -18,5 +19,7 @@ @@ -18,5 +19,7 @@
<CheckBox Grid.Row="1" Grid.Column="1" Margin="3" IsChecked="{Binding IsShowUnwindInfo}" />
<TextBlock Grid.Row="2" Margin="3" Text="{x:Static properties:Resources.ShowDebugInfo}"/>
<CheckBox Grid.Row="2" Grid.Column="1" Margin="3" IsChecked="{Binding IsShowDebugInfo}" />
<TextBlock Grid.Row="3" Margin="3" Text="{x:Static properties:Resources.ShowGCInfo}"/>
<CheckBox Grid.Row="3" Grid.Column="1" Margin="3" IsChecked="{Binding IsShowGCInfo}" />
</Grid>
</UserControl>

15
ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs

@ -39,6 +39,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun @@ -39,6 +39,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun
s.DisassemblyFormat = ReadyToRunOptions.GetDisassemblyFormat(settings);
s.IsShowUnwindInfo = ReadyToRunOptions.GetIsShowUnwindInfo(settings);
s.IsShowDebugInfo = ReadyToRunOptions.GetIsShowDebugInfo(settings);
s.IsShowGCInfo = ReadyToRunOptions.GetIsShowGCInfo(settings);
this.DataContext = s;
}
@ -51,7 +52,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun @@ -51,7 +52,7 @@ namespace ICSharpCode.ILSpy.ReadyToRun
public void Save(XElement root)
{
Options s = (Options)this.DataContext;
ReadyToRunOptions.SetDisassemblyOptions(root, s.DisassemblyFormat, s.IsShowUnwindInfo, s.IsShowDebugInfo);
ReadyToRunOptions.SetDisassemblyOptions(root, s.DisassemblyFormat, s.IsShowUnwindInfo, s.IsShowDebugInfo, s.IsShowGCInfo);
}
}
@ -86,6 +87,18 @@ namespace ICSharpCode.ILSpy.ReadyToRun @@ -86,6 +87,18 @@ namespace ICSharpCode.ILSpy.ReadyToRun
}
}
private bool isShowGCInfo;
public bool IsShowGCInfo {
get {
return isShowGCInfo;
}
set {
isShowGCInfo = value;
OnPropertyChanged(nameof(IsShowGCInfo));
}
}
private string disassemblyFormat;
public string DisassemblyFormat {

22
ILSpy.ReadyToRun/ReadyToRunOptions.cs

@ -87,12 +87,32 @@ namespace ICSharpCode.ILSpy.ReadyToRun @@ -87,12 +87,32 @@ namespace ICSharpCode.ILSpy.ReadyToRun
}
}
public static void SetDisassemblyOptions(XElement root, string disassemblyFormat, bool isShowUnwindInfo, bool isShowDebugInfo)
public static bool GetIsShowGCInfo(ILSpySettings settings)
{
if (settings == null)
{
settings = ILSpySettings.Load();
}
XElement e = settings[ns + "ReadyToRunOptions"];
XAttribute a = e.Attribute("IsShowGCInfo");
if (a == null)
{
return false;
}
else
{
return (bool)a;
}
}
public static void SetDisassemblyOptions(XElement root, string disassemblyFormat, bool isShowUnwindInfo, bool isShowDebugInfo, bool isShowGCInfo)
{
XElement section = new XElement(ns + "ReadyToRunOptions");
section.SetAttributeValue("DisassemblyFormat", disassemblyFormat);
section.SetAttributeValue("IsShowUnwindInfo", isShowUnwindInfo);
section.SetAttributeValue("IsShowDebugInfo", isShowDebugInfo);
section.SetAttributeValue("IsShowGCInfo", isShowGCInfo);
XElement existingElement = root.Element(ns + "ReadyToRunOptions");
if (existingElement != null)
{

Loading…
Cancel
Save