Skip to content

Commit 504d255

Browse files
committed
5.1.8: "Fix" mangled type names (e.g. for source-generators)
1 parent 1fcdfeb commit 504d255

File tree

10 files changed

+44
-28
lines changed

10 files changed

+44
-28
lines changed

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 5.1.8
2+
3+
* Workaround for mangled type names (e.g. source-generators)
4+
* NativeAOT no longer use hard-coded paths to runtime repo
5+
* Hot-key now tries to open Disasmo UI if it's not open
6+
17
# 5.1.7
28

39
* Fixes for NativeAOT (to use Checked rather than Release config)

src/Vsix/DisasmoPackage.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static async Task<Version> GetLatestVersionOnline()
8686
public Version GetCurrentVersion()
8787
{
8888
//TODO: fix
89-
return new Version(5, 1, 7);
89+
return new Version(5, 1, 8);
9090

9191
//try
9292
//{
@@ -164,9 +164,10 @@ public bool ExecuteCommand(DisasmoCommandArgs args, CommandExecutionContext cont
164164
await DisasmoPackage.Current.JoinableTaskFactory.SwitchToMainThreadAsync(default);
165165
var doc = IdeUtils.DTE().ActiveDocument;
166166
var symbol = await DisasmMethodOrClassAction.GetSymbolStatic(document, pos, default, true);
167-
var window = await IdeUtils.ShowWindowAsync<DisasmWindow>(false, default);
168-
doc.Activate();
167+
var window = await IdeUtils.ShowWindowAsync<DisasmWindow>(true, default);
169168
window?.ViewModel?.RunOperationAsync(symbol);
169+
await Task.Delay(300);
170+
doc.Activate();
170171
}
171172
catch
172173
{

src/Vsix/Properties/Settings.Designer.cs

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Vsix/Properties/Settings.settings

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<Setting Name="ShowAsmComments_V9" Type="System.Boolean" Scope="User">
1212
<Value Profile="(Default)">False</Value>
1313
</Setting>
14-
<Setting Name="CustomEnvVars3_V12" Type="System.String" Scope="User">
15-
<Value Profile="(Default)">DOTNET_TC_QuickJitForLoops=1;;DOTNET_JitDiffableDasm=0;;DOTNET_ReadyToRun=1;;</Value>
14+
<Setting Name="CustomEnvVars3_V13" Type="System.String" Scope="User">
15+
<Value Profile="(Default)">DOTNET_JitDiffableDasm=0;;DOTNET_ReadyToRun=1;;</Value>
1616
</Setting>
1717
<Setting Name="UseDotnetBuildForReload_V9" Type="System.Boolean" Scope="User">
1818
<Value Profile="(Default)">True</Value>
@@ -50,8 +50,8 @@
5050
<Setting Name="CrossgenArgs_V4" Type="System.String" Scope="User">
5151
<Value Profile="(Default)">--targetos windows --targetarch x64 --inputbubble --instruction-set skylake --compilebubblegenerics --parallelism 1 --Ot </Value>
5252
</Setting>
53-
<Setting Name="IlcArgs_V2" Type="System.String" Scope="User">
54-
<Value Profile="(Default)">-o:nativeaotbin;;-r:C:\prj\runtime\artifacts\bin\coreclr\windows.x64.Checked\aotsdk\*.dll;;-r:C:\prj\runtime\artifacts\bin\microsoft.netcore.app.runtime.win-x64\Release\runtimes\win-x64\lib\net7.0\*.dll;;-g;;--Ot;;--initassembly:System.Private.CoreLib;;--initassembly:System.Private.StackTraceMetadata;;--initassembly:System.Private.TypeLoader;;--initassembly:System.Private.Reflection.Execution;;--directpinvokelist:C:\prj\runtime\artifacts\bin\coreclr\windows.x64.Checked\build\WindowsAPIs.txt;;--directpinvoke:System.Globalization.Native;;--stacktracedata;;--scanreflection;;--feature:System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=false;;--feature:System.Resources.ResourceManager.AllowCustomResourceTypes=false;;--feature:System.Linq.Expressions.CanCompileToIL=false;;--feature:System.Linq.Expressions.CanEmitObjectArrayDelegate=false;;--feature:System.Linq.Expressions.CanCreateArbitraryDelegates=false</Value>
53+
<Setting Name="IlcArgs_V3" Type="System.String" Scope="User">
54+
<Value Profile="(Default)">-o:nativeaotbin;;-r:%DOTNET_REPO%\artifacts\bin\coreclr\windows.x64.Checked\aotsdk\*.dll;;-r:%DOTNET_REPO%\artifacts\bin\microsoft.netcore.app.runtime.win-x64\Release\runtimes\win-x64\lib\net7.0\*.dll;;-g;;--Ot;;--initassembly:System.Private.CoreLib;;--initassembly:System.Private.StackTraceMetadata;;--initassembly:System.Private.TypeLoader;;--initassembly:System.Private.Reflection.Execution;;--directpinvokelist:%DOTNET_REPO%\artifacts\bin\coreclr\windows.x64.Checked\build\WindowsAPIs.txt;;--directpinvoke:System.Globalization.Native;;--stacktracedata;;--scanreflection;;--feature:System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=false;;--feature:System.Resources.ResourceManager.AllowCustomResourceTypes=false;;--feature:System.Linq.Expressions.CanCompileToIL=false;;--feature:System.Linq.Expressions.CanEmitObjectArrayDelegate=false;;--feature:System.Linq.Expressions.CanCreateArbitraryDelegates=false</Value>
5555
</Setting>
5656
</Settings>
5757
</SettingsFile>

src/Vsix/Resources/DisasmoLoader3.cs_template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public class DisasmoLoader
2121
string typeName = args[1];
2222
string methodName = args[2];
2323

24+
// Another ugly workaround for mangled names till I figure out a proper solution
25+
if (typeName.Contains('_') && typeName.Contains('.'))
26+
typeName = typeName.Substring(typeName.LastIndexOf('.') + 1);
27+
2428
var alc = new AssemblyLoadContext(null);
2529
Assembly asm = alc.LoadFromAssemblyPath(Path.Combine(Environment.CurrentDirectory, assemblyName));
2630
foreach (Type type in asm.GetTypes())

src/Vsix/ViewModels/MainViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ public void ThrowIfCanceled()
111111
try { UserCts?.Cancel(); } catch { }
112112
});
113113

114+
public string DefaultHotKey => DisasmoPackage.HotKey;
115+
114116
public bool Success
115117
{
116118
get => _success;
@@ -360,7 +362,7 @@ public async Task RunFinalExe()
360362
envVars["DOTNET_ReadyToRun"] = "1";
361363
envVars["DOTNET_TC_QuickJitForLoops"] = "1";
362364
envVars["DOTNET_TieredCompilation"] = "1";
363-
command += SettingsVm.IlcArgs.Replace("%DOTNET_REPO%", SettingsVm.PathToLocalCoreClr).Replace("\r\n", " ").Replace("\n", " ");
365+
command += SettingsVm.IlcArgs.Replace("%DOTNET_REPO%", SettingsVm.PathToLocalCoreClr.TrimEnd('\\', '/')).Replace("\r\n", " ").Replace("\n", " ");
364366

365367
if (SettingsVm.UseDotnetPublishForReload)
366368
{
@@ -705,7 +707,7 @@ public async void RunOperationAsync(ISymbol symbol)
705707

706708
LoadingStatus = $"dotnet build -c Release -o ...";
707709

708-
string dotnetBuildArgs = $"build -c Release -o {DisasmoOutDir} /p:WarningLevel=0 /p:TreatWarningsAsErrors=false";
710+
string dotnetBuildArgs = $"build -c Release -o {DisasmoOutDir} --no-self-contained /p:WarningLevel=0 /p:TreatWarningsAsErrors=false";
709711

710712
if (SettingsVm.UseNoRestoreFlag)
711713
dotnetBuildArgs += " --no-restore --no-dependencies --nologo";

src/Vsix/ViewModels/SettingsViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public SettingsViewModel()
4141
{
4242
PathToLocalCoreClr = Settings.Default.PathToCoreCLR_V9;
4343
ShowAsmComments = Settings.Default.ShowAsmComments_V9;
44-
CustomEnvVars = Settings.Default.CustomEnvVars3_V12.Replace(";;", Environment.NewLine);
44+
CustomEnvVars = Settings.Default.CustomEnvVars3_V13.Replace(";;", Environment.NewLine);
4545
Crossgen2Args = Settings.Default.CrossgenArgs_V4;
46-
IlcArgs = Settings.Default.IlcArgs_V2.Replace(";;", Environment.NewLine);
46+
IlcArgs = Settings.Default.IlcArgs_V3.Replace(";;", Environment.NewLine);
4747
JitDumpInsteadOfDisasm = Settings.Default.JitDumpInsteadOfDisasm_V9;
4848
UseDotnetBuildForReload = Settings.Default.UseDotnetBuildForReload_V9;
4949
RunAppMode = Settings.Default.RunAppMode_V9;
@@ -347,7 +347,7 @@ public string CustomEnvVars
347347
set
348348
{
349349
Set(ref _customEnvVars, value);
350-
Settings.Default.CustomEnvVars3_V12 = value;
350+
Settings.Default.CustomEnvVars3_V13 = value;
351351
Settings.Default.Save();
352352
}
353353
}
@@ -369,7 +369,7 @@ public string IlcArgs
369369
set
370370
{
371371
Set(ref _ilcArgs, value);
372-
Settings.Default.IlcArgs_V2 = value;
372+
Settings.Default.IlcArgs_V3 = value;
373373
Settings.Default.Save();
374374
}
375375
}

src/Vsix/Views/DisasmWindowControl.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
<TextBlock Margin="8,-2,0,4" Visibility="{Binding SettingsVm.UseCustomRuntime, Converter={StaticResource InversedBooleanToVisibility}}"
7070
Text="(Non-locally built dotnet has to be .NET 7.0 RC1 or newer)" Foreground="Gray" FontSize="10" />
7171
<TextBlock Margin="8,-2,0,4"
72-
Text="NEW! Open 'Tools/Options/Keyboard' in VS, find 'Disasmo' command and assign a hot-key for faster iterations!" Foreground="Blue" FontSize="10" />
72+
Foreground="Blue" FontSize="10" >
73+
<Run Text="NEW! Open 'Tools/Options/Keyboard' in VS, find 'Disasmo' command and assign a hot-key for faster iterations! Current one is"/>
74+
<Run Text="{Binding DefaultHotKey, Mode=OneWay}"/>
75+
</TextBlock>
7376
</StackPanel>
7477

7578
<TabControl x:Name="TabControl" Grid.Row="2" SelectionChanged="TabControl_OnSelectionChanged">

src/Vsix/app.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<setting name="ShowAsmComments_V9" serializeAs="String">
1717
<value>False</value>
1818
</setting>
19-
<setting name="CustomEnvVars3_V12" serializeAs="String">
20-
<value>DOTNET_TC_QuickJitForLoops=1;;DOTNET_JitDiffableDasm=0;;DOTNET_ReadyToRun=1;;</value>
19+
<setting name="CustomEnvVars3_V13" serializeAs="String">
20+
<value>DOTNET_JitDiffableDasm=0;;DOTNET_ReadyToRun=1;;</value>
2121
</setting>
2222
<setting name="UseDotnetBuildForReload_V9" serializeAs="String">
2323
<value>True</value>
@@ -55,8 +55,8 @@
5555
<setting name="CrossgenArgs_V4" serializeAs="String">
5656
<value>--targetos windows --targetarch x64 --inputbubble --instruction-set skylake --compilebubblegenerics --parallelism 1 --Ot </value>
5757
</setting>
58-
<setting name="IlcArgs_V2" serializeAs="String">
59-
<value>-o:nativeaotbin;;-r:C:\prj\runtime\artifacts\bin\coreclr\windows.x64.Checked\aotsdk\*.dll;;-r:C:\prj\runtime\artifacts\bin\microsoft.netcore.app.runtime.win-x64\Release\runtimes\win-x64\lib\net7.0\*.dll;;-g;;--Ot;;--initassembly:System.Private.CoreLib;;--initassembly:System.Private.StackTraceMetadata;;--initassembly:System.Private.TypeLoader;;--initassembly:System.Private.Reflection.Execution;;--directpinvokelist:C:\prj\runtime\artifacts\bin\coreclr\windows.x64.Checked\build\WindowsAPIs.txt;;--directpinvoke:System.Globalization.Native;;--stacktracedata;;--scanreflection;;--feature:System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=false;;--feature:System.Resources.ResourceManager.AllowCustomResourceTypes=false;;--feature:System.Linq.Expressions.CanCompileToIL=false;;--feature:System.Linq.Expressions.CanEmitObjectArrayDelegate=false;;--feature:System.Linq.Expressions.CanCreateArbitraryDelegates=false</value>
58+
<setting name="IlcArgs_V3" serializeAs="String">
59+
<value>-o:nativeaotbin;;-r:%DOTNET_REPO%\artifacts\bin\coreclr\windows.x64.Checked\aotsdk\*.dll;;-r:%DOTNET_REPO%\artifacts\bin\microsoft.netcore.app.runtime.win-x64\Release\runtimes\win-x64\lib\net7.0\*.dll;;-g;;--Ot;;--initassembly:System.Private.CoreLib;;--initassembly:System.Private.StackTraceMetadata;;--initassembly:System.Private.TypeLoader;;--initassembly:System.Private.Reflection.Execution;;--directpinvokelist:%DOTNET_REPO%\artifacts\bin\coreclr\windows.x64.Checked\build\WindowsAPIs.txt;;--directpinvoke:System.Globalization.Native;;--stacktracedata;;--scanreflection;;--feature:System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=false;;--feature:System.Resources.ResourceManager.AllowCustomResourceTypes=false;;--feature:System.Linq.Expressions.CanCompileToIL=false;;--feature:System.Linq.Expressions.CanEmitObjectArrayDelegate=false;;--feature:System.Linq.Expressions.CanCreateArbitraryDelegates=false</value>
6060
</setting>
6161
</Disasmo.Properties.Settings>
6262
</userSettings>

src/Vsix/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="Disasmo.39513ef5-c3ee-4547-b7be-f29c752b591d" Version="5.1.7" Language="en-US" Publisher="Egor Bogatov" />
4+
<Identity Id="Disasmo.39513ef5-c3ee-4547-b7be-f29c752b591d" Version="5.1.8" Language="en-US" Publisher="Egor Bogatov" />
55
<DisplayName>Disasmo</DisplayName>
66
<Description xml:space="preserve" >VS2022 Add-in. Click on any method to see what ASM JIT will generate for it. </Description>
77
<MoreInfo>https://github.com/EgorBo/disasmo</MoreInfo>

0 commit comments

Comments
 (0)