Skip to content

Instantly share code, notes, and snippets.

@jbevain
Created May 10, 2017 00:26
Show Gist options
  • Save jbevain/b88f4e2594d0425c342951448b101727 to your computer and use it in GitHub Desktop.
Save jbevain/b88f4e2594d0425c342951448b101727 to your computer and use it in GitHub Desktop.
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
index e09132e2798..aa109ebd70d 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
@@ -1786,6 +1786,11 @@ namespace Mono.Debugger.Soft
Send (CommandSet.VM, (int)CmdVM.STOP_BUFFERING);
}
+ internal VersionInfo VM_IsDeferred () {
+ var res = SendReceive (CommandSet.VM, (int)CmdVM.DEFERRED, null);
+ return res.ReadInt () != 0;
+ }
+
/*
* DOMAIN
*/
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
index 9d7c9881ab9..a87c8c34b39 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
@@ -21,6 +21,7 @@ namespace Mono.Debugger.Soft
internal Connection conn;
VersionInfo version;
+ bool? is_deferred;
internal VirtualMachine (ITargetProcess process, Connection conn) : base () {
SetVirtualMachine (this);
@@ -74,6 +75,18 @@ namespace Mono.Debugger.Soft
}
}
+ // Since Protocol version 2.46
+ public bool IsDeferred {
+ get {
+ if (!is_deferred.HasValue) {
+ vm.CheckProtocolVersion (2, 46);
+ is_deferred = vm.conn.VM_IsDeferred ();
+ }
+
+ return is_deferred.Value;
+ }
+ }
+
EventSet current_es;
int current_es_index;
diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c
index c639fa9e756..e7ea7524e01 100644
--- a/mono/mini/debugger-agent.c
+++ b/mono/mini/debugger-agent.c
@@ -273,7 +273,7 @@ typedef struct {
#define HEADER_LENGTH 11
#define MAJOR_VERSION 2
-#define MINOR_VERSION 45
+#define MINOR_VERSION 46
typedef enum {
CMD_SET_VM = 1,
@@ -411,7 +411,8 @@ typedef enum {
CMD_VM_GET_TYPES = 12,
CMD_VM_INVOKE_METHODS = 13,
CMD_VM_START_BUFFERING = 14,
- CMD_VM_STOP_BUFFERING = 15
+ CMD_VM_STOP_BUFFERING = 15,
+ CMD_VM_DEFERRED = 16,
} CmdVM;
typedef enum {
@@ -7670,6 +7671,9 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
case CMD_VM_STOP_BUFFERING:
/* Handled in the main loop */
break;
+ case CMD_VM_DEFERRED:
+ buffer_add_int (buf, agent_config.defer);
+ break;
default:
return ERR_NOT_IMPLEMENTED;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment