+2008-04-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Mono.Cecil.Mdb/MdbReader.cs: Update wrt interface change (i.e.
+ Read now provide a Dictionary to reuse the existing Hashtable
+ between offsets and instructions).
+
2008-04-08 Sebastien Pouliot <sebastien@ximian.com>
* Mono.Cecil.Mdb/MdbReader.cs:
m_scopes = new Hashtable ();
}
- Hashtable GetInstructions (MethodBody body)
- {
- Hashtable instructions = new Hashtable (body.Instructions.Count);
- foreach (Instruction i in body.Instructions)
- instructions.Add (i.Offset, i);
-
- return instructions;
- }
-
- Instruction GetInstruction (MethodBody body, Hashtable instructions, int offset)
+ Instruction GetInstruction (MethodBody body, IDictionary instructions, int offset)
{
Instruction instr = (Instruction) instructions [offset];
if (instr != null)
return body.Instructions.Outside;
}
- public void Read (MethodBody body)
+ public void Read (MethodBody body, IDictionary instructions)
{
MethodEntry entry = m_symFile.GetMethodByToken ((int) body.Method.MetadataToken.ToUInt ());
if (entry == null)
return;
- Hashtable instructions = GetInstructions(body);
ReadScopes (entry, body, instructions);
ReadLineNumbers (entry, instructions);
ReadLocalVariables (entry, body);
}
}
- void ReadLineNumbers (MethodEntry entry, Hashtable instructions)
+ void ReadLineNumbers (MethodEntry entry, IDictionary instructions)
{
foreach (LineNumberEntry line in entry.LineNumbers) {
Instruction instr = instructions [line.Offset] as Instruction;
return doc;
}
- void ReadScopes (MethodEntry entry, MethodBody body, Hashtable instructions)
+ void ReadScopes (MethodEntry entry, MethodBody body, IDictionary instructions)
{
foreach (LexicalBlockEntry scope in entry.LexicalBlocks) {
Scope s = new Scope ();