Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Set and honor default suspend policies for different event types.

Throw the correct exception on ERR_UNLOADED.
  • Loading branch information...
commit 913695f6d160eaa910b29a861018fe4c3e3c5ace 1 parent d0d8eea
@Tak Tak authored
View
24 main/contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
@@ -17,6 +17,26 @@ public class VirtualMachine : Mirror
AppDomainMirror root_domain;
Dictionary<int, EventRequest> requests;
ITargetProcess process;
+ public static readonly Dictionary<EventType,SuspendPolicy> EventPolicies = new Dictionary<EventType,SuspendPolicy> () {
+ { EventType.AppDomainCreate, SuspendPolicy.All },
+ { EventType.AppDomainUnload, SuspendPolicy.All },
+ { EventType.AssemblyLoad, SuspendPolicy.All },
+ { EventType.AssemblyUnload, SuspendPolicy.All },
+ { EventType.Breakpoint, SuspendPolicy.All },
+ { EventType.Exception, SuspendPolicy.All },
+ { EventType.KeepAlive, SuspendPolicy.None },
+ { EventType.MethodEntry, SuspendPolicy.None },
@bamboo
bamboo added a note

I vaguely remember having to resume the vm after a MethodEntry event... Is it really SuspendPolicy.None?

@Tak Owner
Tak added a note

This is setting the suspend policies we want the runtime to observe for these events.

@bamboo
bamboo added a note

I see. I was wondering if this would be a change of behavior for EventType.MethodEntry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ { EventType.MethodExit, SuspendPolicy.None },
+ { EventType.Step, SuspendPolicy.All },
+ { EventType.ThreadDeath, SuspendPolicy.None },
+ { EventType.ThreadStart, SuspendPolicy.None },
+ { EventType.TypeLoad, SuspendPolicy.All },
+ { EventType.UserBreak, SuspendPolicy.All },
+ { EventType.UserLog, SuspendPolicy.None },
+ { EventType.VMDeath, SuspendPolicy.None },
+ { EventType.VMDisconnect, SuspendPolicy.None },
+ { EventType.VMStart, SuspendPolicy.None },
+ };
internal Connection conn;
@@ -219,7 +239,7 @@ public void SetSocketTimeouts (int send_timeout, int receive_timeout, int keepal
foreach (EventType etype in events) {
if (etype == EventType.Breakpoint)
throw new ArgumentException ("Breakpoint events cannot be requested using EnableEvents", "events");
- conn.EnableEvent (etype, SuspendPolicy.All, null);
+ conn.EnableEvent (etype, EventPolicies[etype], null);
}
}
@@ -286,6 +306,8 @@ public void SetSocketTimeouts (int send_timeout, int receive_timeout, int keepal
throw new AbsentInformationException ();
case ErrorCode.NO_SEQ_POINT_AT_IL_OFFSET:
throw new ArgumentException ("Cannot set breakpoint on the specified IL offset.");
+ case ErrorCode.ERR_UNLOADED:
+ throw new AppDomainUnloadedException ("The requested item has been unloaded.");
default:
throw new CommandException (args.ErrorCode);
}
Please sign in to comment.
Something went wrong with that request. Please try again.