Skip to content

Commit

Permalink
Check that the mdb guid matches the module guid when reading the symb…
Browse files Browse the repository at this point in the history
…ol file
  • Loading branch information
jbevain committed Apr 16, 2013
1 parent 05ba2ce commit cd45fe4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
Expand Up @@ -40,7 +40,7 @@ public class MdbReaderProvider : ISymbolReaderProvider {

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)
Expand All @@ -51,18 +51,20 @@ public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStre

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)
Expand Down

0 comments on commit cd45fe4

Please sign in to comment.