This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

2009-03-02 Martin Baulig <martin@ximian.com>

	**** Backport of r128465 ****

	* languages/mono/MonoRuntime.cs
	(MonoRuntime.GetGenericClass): Reflect latest runtime changes:
	starting with version 81.0, `MonoGenericInst.type_argv' is a tail
	array and not a pointer anymore.  Check for the runtime version
	and support both versions here.

	* backend/MonoThreadManager.cs
	(MonoDebuggerInfo): Accept runtime major versions 80 and 81.
	(MonoDebuggerInfo.MinorVersion): New public readonly field.
	(MonoDebuggerInfo.MajorVersion): New public readonly field.


svn path=/branches/mono-2-4/debugger/; revision=128886
  • Loading branch information...
Martin Baulig
Martin Baulig committed Mar 9, 2009
1 parent 8b93a33 commit d13e41c4c7490db8ae58dc40565282e1624f0f0c
Showing with 41 additions and 10 deletions.
  1. +15 −0 ChangeLog
  2. +8 −2 backend/MonoThreadManager.cs
  3. +7 −1 languages/mono/MonoRuntime.cs
  4. +11 −7 languages/mono/MonoSymbolFile.cs
View
@@ -1,3 +1,18 @@
+2009-03-02 Martin Baulig <martin@ximian.com>
+
+ **** Backport of r128465 ****
+
+ * languages/mono/MonoRuntime.cs
+ (MonoRuntime.GetGenericClass): Reflect latest runtime changes:
+ starting with version 81.0, `MonoGenericInst.type_argv' is a tail
+ array and not a pointer anymore. Check for the runtime version
+ and support both versions here.
+
+ * backend/MonoThreadManager.cs
+ (MonoDebuggerInfo): Accept runtime major versions 80 and 81.
+ (MonoDebuggerInfo.MinorVersion): New public readonly field.
+ (MonoDebuggerInfo.MajorVersion): New public readonly field.
+
2009-02-25 Martin Baulig <martin@ximian.com>
* backend/arch/X86_Instruction.cs
@@ -400,9 +400,12 @@ internal class MonoDebuggerInfo
{
// These constants must match up with those in mono/mono/metadata/mono-debug.h
public const int MinDynamicVersion = 80;
- public const int MaxDynamicVersion = 80;
+ public const int MaxDynamicVersion = 81;
public const long DynamicMagic = 0x7aff65af4253d427;
+ public readonly int MajorVersion;
+ public readonly int MinorVersion;
+
public readonly int MonoTrampolineNum;
public readonly TargetAddress MonoTrampolineCode;
public readonly TargetAddress NotificationAddress;
@@ -472,7 +475,10 @@ public static MonoDebuggerInfo Create (TargetMemoryAccess memory, TargetAddress
protected MonoDebuggerInfo (TargetMemoryAccess memory, TargetReader reader)
{
- /* skip past magic, version, and total_size */
+ reader.Offset = 8;
+ MajorVersion = reader.ReadInteger ();
+ MinorVersion = reader.ReadInteger ();
+
reader.Offset = 24;
SymbolTableSize = reader.ReadInteger ();
@@ -535,8 +535,14 @@ public MetadataInfo (TargetMemoryAccess memory, TargetAddress address)
reader.ReadAddress ();
TargetAddress cached_class = reader.ReadAddress ();
+ int inst_id = memory.ReadInteger (class_inst);
int inst_data = memory.ReadInteger (class_inst + 4);
- TargetAddress inst_argv = memory.ReadAddress (class_inst + 8);
+
+ TargetAddress inst_argv;
+ if (MonoDebuggerInfo.MajorVersion == 80)
+ inst_argv = memory.ReadAddress (class_inst + 8);
+ else
+ inst_argv = class_inst + 8;
int type_argc = inst_data & 0x3fffff;
@@ -1195,13 +1195,17 @@ void do_read_variables (TargetMemoryAccess memory)
} else
var = address.LocalVariableInfo [sv.Index];
- TargetStructType type = mono.ReadStructType (memory, var.MonoType);
- MonoVariable scope_var = new MonoVariable (
- "$__" + sv.Scope, type, true, type.IsByRef, this, var);
-
- ScopeInfo info = new ScopeInfo (sv.Scope, scope_var, type);
- scopes.Add (sv.Scope, info);
- scope_list.Add (info);
+ try {
+ TargetStructType type = mono.ReadStructType (memory, var.MonoType);
+ MonoVariable scope_var = new MonoVariable (
+ "$__" + sv.Scope, type, true, type.IsByRef, this, var);
+
+ ScopeInfo info = new ScopeInfo (sv.Scope, scope_var, type);
+ scopes.Add (sv.Scope, info);
+ scope_list.Add (info);
+ } catch (Exception ex) {
+ Report.Error ("Cannot read scope variable: {0}\n{1}", var, ex);
+ }
}
foreach (ScopeInfo scope in scope_list) {

0 comments on commit d13e41c

Please sign in to comment.