Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbevain <jbevain@gmail.com>2010-06-15 18:23:27 +0400
committerjbevain <jbevain@gmail.com>2010-06-15 18:23:27 +0400
commitc085d701957a00ae0d1f91d2065c144589b820a4 (patch)
tree391090fec1aa097e744737ddb72fe719f6243a57 /symbols
parent923d12ae0c26edb75cea09a639d2c9fa3ad2809e (diff)
Revert "check the mdb guid in ProcessHeader"
This reverts commit aecd1950f6f8b62f5bb016005ec46822bb666f27.
Diffstat (limited to 'symbols')
-rw-r--r--symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs12
-rw-r--r--symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs27
2 files changed, 30 insertions, 9 deletions
diff --git a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
index a349855..0198a71 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 (fileName + ".mdb"), module);
+ return new MdbReader (MonoSymbolFile.ReadSymbolFile (module, fileName));
}
public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream)
@@ -52,19 +52,17 @@ namespace Mono.Cecil.Mdb {
public class MdbReader : ISymbolReader {
readonly MonoSymbolFile symbol_file;
- readonly ModuleDefinition module;
readonly Dictionary<string, Document> documents;
- public MdbReader (MonoSymbolFile symbol_file, ModuleDefinition module)
+ public MdbReader (MonoSymbolFile symFile)
{
- this.symbol_file = symbol_file;
- this.module = module;
- this.documents = new Dictionary<string, Document> ();
+ symbol_file = symFile;
+ documents = new Dictionary<string, Document> ();
}
public bool ProcessDebugHeader (ImageDebugDirectory directory, byte [] header)
{
- return symbol_file.Guid == module.Mvid;
+ return true;
}
public void Read (MethodBody body, InstructionMapper mapper)
diff --git a/symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs b/symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs
index 7013811..0d614ca 100644
--- a/symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs
+++ b/symbols/mdb/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs
@@ -431,10 +431,33 @@ namespace Mono.CompilerServices.SymbolWriter
compile_unit_hash = new Hashtable ();
}
+ void CheckGuidMatch (Guid other, string filename, string assembly)
+ {
+ if (other == guid)
+ return;
+
+ throw new MonoSymbolFileException (
+ "Symbol file `{0}' does not match assembly `{1}'",
+ filename, assembly);
+ }
+
#if CECIL
+ protected MonoSymbolFile (string filename, Mono.Cecil.ModuleDefinition module)
+ : this (filename)
+ {
+ CheckGuidMatch (module.Mvid, filename, module.FullyQualifiedName);
+ }
+
public static MonoSymbolFile ReadSymbolFile (Mono.Cecil.ModuleDefinition module)
{
- return ReadSymbolFile (module.FullyQualifiedName);
+ return ReadSymbolFile (module, module.FullyQualifiedName);
+ }
+
+ public static MonoSymbolFile ReadSymbolFile (Mono.Cecil.ModuleDefinition module, string filename)
+ {
+ string name = filename + ".mdb";
+
+ return new MonoSymbolFile (name, module);
}
#else
protected MonoSymbolFile (string filename, Assembly assembly) : this (filename)
@@ -461,7 +484,7 @@ namespace Mono.CompilerServices.SymbolWriter
public static MonoSymbolFile ReadSymbolFile (string mdbFilename)
{
- return new MonoSymbolFile (mdbFilename);
+ return new MonoSymbolFile (mdbFilename, null);
}
public int CompileUnitCount {