Skip to content

Commit

Permalink
[macos] Fix pdb mismatch when saving assemblies processed by mmp (#2901)
Browse files Browse the repository at this point in the history
- https://bugzilla.xamarin.com/show_bug.cgi?id=60277
- Teach mmp and mtouch resolver to always ask for symbol reading from Cecil
- In most cases we explicitly load symbols (LoadReferencesStep) but when we don't rewritten assemblies don't match their pdb and we break debugging.
  • Loading branch information
chamons committed Oct 23, 2017
1 parent bbccd44 commit 91ded43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/mmp/resolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using System.Security.Cryptography;

using Mono.Cecil;
using Mono.Cecil.Cil;

namespace Xamarin.Bundler {
public partial class MonoMacResolver : IAssemblyResolver {
Expand Down Expand Up @@ -72,7 +73,9 @@ public AssemblyDefinition AddAssembly (string fileName)
assembly = AssemblyDefinition.ReadAssembly (fileName, new ReaderParameters
{
AssemblyResolver = this,
InMemory = new FileInfo (fileName).Length < 1024 * 1024 * 100 // 100 MB
InMemory = new FileInfo (fileName).Length < 1024 * 1024 * 100, // 100 MB
ReadSymbols = true,
SymbolReaderProvider = new DefaultSymbolReaderProvider (throwIfNoSymbol: false)
});
cache.Add (name, assembly);
return assembly;
Expand Down
3 changes: 3 additions & 0 deletions tools/mtouch/AssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System.Linq;

using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Tuner;

using Xamarin.Bundler;
Expand Down Expand Up @@ -70,6 +71,8 @@ ReaderParameters CreateParameters (string path)
var parameters = new ReaderParameters ();
parameters.AssemblyResolver = this;
parameters.InMemory = new FileInfo (path).Length < 1024 * 1024 * 100; // 100 MB.
parameters.ReadSymbols = true;
parameters.SymbolReaderProvider = new DefaultSymbolReaderProvider (throwIfNoSymbol: false);
return parameters;
}

Expand Down

0 comments on commit 91ded43

Please sign in to comment.