Skip to content

Commit

Permalink
PDB rewriting, take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Hodgson committed Dec 14, 2018
1 parent 08936ec commit 998700b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Pidgin.DllRewriter/Program.cs
Expand Up @@ -14,14 +14,14 @@ static void Main(string[] args)
{
var netcoreapp = args[0].StartsWith("netcoreapp");

var module = ModuleDefinition.ReadModule(args[1], new ReaderParameters { ReadSymbols = true });
var module = ModuleDefinition.ReadModule(args[1], new ReaderParameters { ReadSymbols = true, InMemory = true });

var unsafeType = module.Types.Single(t => t.Name == "Unsafe");

RewriteAsPointerMethod(unsafeType);
RewriteAsRefMethod(netcoreapp, unsafeType, module.TypeSystem);

module.Write(args[2], new WriterParameters { WriteSymbols = true });
module.Write(args[1], new WriterParameters { WriteSymbols = true });
}

// https://github.com/dotnet/corefx/blob/7942e7c3ed03cf7f19dffe539e23b84b4a85ad5a/src/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.il#L145
Expand Down
4 changes: 1 addition & 3 deletions Pidgin/Pidgin.csproj
Expand Up @@ -34,9 +34,7 @@
</ItemGroup>

<Target Name="RewriteDll" AfterTargets="AfterBuild">
<Exec Command="dotnet run --project &quot;$(MSBuildProjectDirectory)/../Pidgin.DllRewriter&quot; &quot;$(TargetFramework)&quot; &quot;$(MSBuildProjectDirectory)/$(OutputPath)Pidgin.dll&quot; &quot;$(MSBuildProjectDirectory)/$(OutputPath)Pidgin_Rewritten.dll&quot;" />
<Copy SourceFiles="$(OutputPath)Pidgin_Rewritten.dll;$(OutputPath)Pidgin_Rewritten.pdb" DestinationFiles="$(OutputPath)Pidgin.dll;$(OutputPath)Pidgin.pdb" />
<Delete Files="$(OutputPath)Pidgin_Rewritten.dll;$(OutputPath)Pidgin_Rewritten.pdb" />
<Exec Command="dotnet run --project &quot;$(MSBuildProjectDirectory)/../Pidgin.DllRewriter&quot; &quot;$(TargetFramework)&quot; &quot;$(MSBuildProjectDirectory)/$(OutputPath)Pidgin.dll&quot;" />
</Target>

</Project>

0 comments on commit 998700b

Please sign in to comment.