diff --git a/tools/common/Application.cs b/tools/common/Application.cs index f6c2217212c2..28b4d92fc8cd 100644 --- a/tools/common/Application.cs +++ b/tools/common/Application.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using Mono.Cecil; -using Mono.Cecil.Mdb; +using Mono.Cecil.Cil; using Xamarin.Utils; @@ -153,7 +153,7 @@ public static void SaveAssembly (AssemblyDefinition assembly, string destination var main = assembly.MainModule; bool symbols = main.HasSymbols; if (symbols) { - var provider = new MdbReaderProvider (); + var provider = new DefaultSymbolReaderProvider (); main.ReadSymbols (provider.GetSymbolReader (main, main.FileName)); } @@ -166,6 +166,9 @@ public static void SaveAssembly (AssemblyDefinition assembly, string destination string dest_mdb = destination + ".mdb"; if (File.Exists (dest_mdb)) File.Delete (dest_mdb); + string dest_pdb = Path.ChangeExtension (destination, ".pdb"); + if (File.Exists (dest_pdb)) + File.Delete (dest_pdb); } } diff --git a/tools/common/Assembly.cs b/tools/common/Assembly.cs index e46546d4fee3..aaebeb793090 100644 --- a/tools/common/Assembly.cs +++ b/tools/common/Assembly.cs @@ -87,7 +87,8 @@ public void LoadSymbols () symbols_loaded = false; try { - if (File.Exists (FullPath + ".mdb")) { + var pdb = Path.ChangeExtension (FullPath, ".pdb"); + if (File.Exists (pdb) || File.Exists (FullPath + ".mdb")) { AssemblyDefinition.MainModule.ReadSymbols (); symbols_loaded = true; } diff --git a/tools/mmp/Tuning.cs b/tools/mmp/Tuning.cs index be3412d8850d..085afca857d9 100644 --- a/tools/mmp/Tuning.cs +++ b/tools/mmp/Tuning.cs @@ -15,7 +15,7 @@ using Xamarin.Utils; using Mono.Cecil; -using Mono.Cecil.Mdb; +using Mono.Cecil.Cil; namespace MonoMac.Tuner { @@ -116,8 +116,8 @@ static LinkContext CreateLinkContext (LinkerOptions options, Pipeline pipeline) context.CoreAction = AssemblyAction.Link; context.LinkSymbols = options.LinkSymbols; if (options.LinkSymbols) { - context.SymbolReaderProvider = new MdbReaderProvider (); - context.SymbolWriterProvider = new MdbWriterProvider (); + context.SymbolReaderProvider = new DefaultSymbolReaderProvider (); + context.SymbolWriterProvider = new DefaultSymbolWriterProvider (); } context.OutputDirectory = options.OutputDirectory; return context; diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index 842fe95d287b..be1a0c0f83cb 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -1744,7 +1744,6 @@ static void CopyFileAndRemoveReadOnly (string src, string dest) { static void CopyAssemblies () { foreach (string asm in resolved_assemblies) { - var mdbfile = string.Format ("{0}.mdb", asm); var configfile = string.Format ("{0}.config", asm); string filename = Path.GetFileName (asm); @@ -1754,8 +1753,14 @@ static void CopyAssemblies () { if (verbose > 0) Console.WriteLine ("Added assembly {0}", asm); - if (App.EnableDebug && File.Exists (mdbfile)) - File.Copy (mdbfile, Path.Combine (mmp_dir, Path.GetFileName (mdbfile)), true); + if (App.EnableDebug) { + var mdbfile = asm + ".mdb"; + if (File.Exists (mdbfile)) + File.Copy (mdbfile, Path.Combine (mmp_dir, Path.GetFileName (mdbfile)), true); + var pdbfile = Path.ChangeExtension (asm, ".pdb"); + if (File.Exists (pdbfile)) + File.Copy (pdbfile, Path.Combine (mmp_dir, Path.GetFileName (pdbfile)), true); + } if (File.Exists (configfile)) File.Copy (configfile, Path.Combine (mmp_dir, Path.GetFileName (configfile)), true); }