#define HEADER_LENGTH 11
#define MAJOR_VERSION 2
-#define MINOR_VERSION 42
+#define MINOR_VERSION 43
typedef enum {
CMD_SET_VM = 1,
static gboolean transport_handshake (void);
static void register_transport (DebuggerTransport *trans);
-static guint32 WINAPI debugger_thread (void *arg);
+static gsize WINAPI debugger_thread (void *arg);
static void runtime_initialized (MonoProfiler *prof);
static void
start_debugger_thread (void)
{
- MonoThreadParm tp;
-
- tp.priority = 0;
- tp.stack_size = 0;
- tp.creation_flags = 0;
- debugger_thread_handle = mono_threads_create_thread (debugger_thread, NULL, &tp, NULL);
+ debugger_thread_handle = mono_threads_create_thread (debugger_thread, NULL, 0, NULL);
g_assert (debugger_thread_handle);
}
locals = mono_debug_lookup_locals (method);
if (!locals) {
+ if (CHECK_PROTOCOL_VERSION (2, 43)) {
+ /* Scopes */
+ buffer_add_int (buf, 1);
+ buffer_add_int (buf, 0);
+ buffer_add_int (buf, header->code_size);
+ }
buffer_add_int (buf, header->num_locals);
/* Types */
for (i = 0; i < header->num_locals; ++i) {
buffer_add_int (buf, header->code_size);
}
} else {
+ if (CHECK_PROTOCOL_VERSION (2, 43)) {
+ /* Scopes */
+ buffer_add_int (buf, locals->num_blocks);
+ int last_start = 0;
+ for (i = 0; i < locals->num_blocks; ++i) {
+ buffer_add_int (buf, locals->code_blocks [i].start_offset - last_start);
+ buffer_add_int (buf, locals->code_blocks [i].end_offset - locals->code_blocks [i].start_offset);
+ last_start = locals->code_blocks [i].start_offset;
+ }
+ }
+
num_locals = locals->num_locals;
buffer_add_int (buf, num_locals);
* This thread handles communication with the debugger client using a JDWP
* like protocol.
*/
-static guint32 WINAPI
+static gsize WINAPI
debugger_thread (void *arg)
{
MonoError error;
thread->internal_thread->state |= ThreadState_Background;
thread->internal_thread->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
- mono_set_is_debugger_attached (TRUE);
-
if (agent_config.defer) {
if (!wait_for_attach ()) {
DEBUG_PRINTF (1, "[dbg] Can't attach, aborting debugger thread.\n");
attach_failed = TRUE; // Don't abort process when we can't listen
} else {
+ mono_set_is_debugger_attached (TRUE);
/* Send start event to client */
process_profiler_event (EVENT_KIND_VM_START, mono_thread_get_main ());
}
+ } else {
+ mono_set_is_debugger_attached (TRUE);
}
while (!attach_failed) {