static GetMethodFunc get_method;
static GetLocalTypeFromSignatureFunc local_type_from_sig;
static GetGuidFunc get_guid;
+ static CheckRuntimeVersionFunc check_runtime_version;
delegate Type GetTypeFunc (Assembly assembly, int token);
delegate int GetMethodTokenFunc (Assembly assembly, MethodBase method);
delegate MethodBase GetMethodFunc (Assembly assembly, int token);
delegate Type GetLocalTypeFromSignatureFunc (Assembly assembly, byte[] sig);
delegate Guid GetGuidFunc (Module module);
+ delegate string CheckRuntimeVersionFunc (string filename);
static Delegate create_delegate (Type type, Type delegate_type, string name)
{
get_guid = (GetGuidFunc) create_delegate (
typeof (Module), typeof (GetGuidFunc), "Mono_GetGuid");
+
+ check_runtime_version = (CheckRuntimeVersionFunc) create_delegate (
+ typeof (Assembly), typeof (CheckRuntimeVersionFunc),
+ "MonoDebugger_CheckRuntimeVersion");
}
public static Type GetType (Assembly assembly, int token)
return local_type_from_sig (assembly, sig);
}
+ public static string CheckRuntimeVersion (string filename)
+ {
+ return check_runtime_version (filename);
+ }
+
public static Guid GetGuid (Module module)
{
return get_guid (module);
long offset_table_offset = bw.BaseStream.Position;
ot.Write (bw);
+ //
+ // Sort the methods according to their tokens and update their index.
+ //
+ methods.Sort ();
+ for (int i = 0; i < methods.Count; i++)
+ ((MethodEntry) methods [i]).Index = i + 1;
+
//
// Write data sections.
//
ot.DataSectionSize = (int) bw.BaseStream.Position - ot.DataSectionOffset;
//
- // Write out the method index
+ // Write the method index table.
//
ot.MethodTableOffset = (int) bw.BaseStream.Position;
for (int i = 0; i < methods.Count; i++) {