diff options
author | Jb Evain <jbevain@gmail.com> | 2013-04-16 20:26:04 +0400 |
---|---|---|
committer | Jb Evain <jbevain@gmail.com> | 2013-04-16 20:26:54 +0400 |
commit | cd45fe4961d08580dcaacabdda406b213b07da3a (patch) | |
tree | a6ca1c8b9a27a58bdcd0c2032803e2315149bb47 /symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs | |
parent | 05ba2ce9ff0279f75a51e618e600c6349b0464ce (diff) |
Check that the mdb guid matches the module guid when reading the symbol file
Diffstat (limited to 'symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs')
-rw-r--r-- | symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs index 2db0419..759f38a 100644 --- a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs +++ b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs @@ -40,7 +40,7 @@ namespace Mono.Cecil.Mdb { public ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName) { - return new MdbReader (MonoSymbolFile.ReadSymbolFile (module, fileName)); + return new MdbReader (module, MonoSymbolFile.ReadSymbolFile (module, fileName)); } public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream) @@ -51,18 +51,20 @@ namespace Mono.Cecil.Mdb { public class MdbReader : ISymbolReader { + readonly ModuleDefinition module; readonly MonoSymbolFile symbol_file; readonly Dictionary<string, Document> documents; - public MdbReader (MonoSymbolFile symFile) + public MdbReader (ModuleDefinition module, MonoSymbolFile symFile) { - symbol_file = symFile; - documents = new Dictionary<string, Document> (); + this.module = module; + this.symbol_file = symFile; + this.documents = new Dictionary<string, Document> (); } public bool ProcessDebugHeader (ImageDebugDirectory directory, byte [] header) { - return true; + return symbol_file.Guid == module.Mvid; } public void Read (MethodBody body, InstructionMapper mapper) |