Skip to content

Commit

Permalink
[sdb] Fix support for async debugging in optimized mode, roslyn gener…
Browse files Browse the repository at this point in the history
…ates valuetype IAsyncStateMethod implementations. Fixes #58728.
  • Loading branch information
vargaz committed Aug 24, 2017
1 parent d4390d6 commit cc995c4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mono/mini/debugger-agent.c
Expand Up @@ -4759,7 +4759,16 @@ get_this (StackFrame *frame)

guint8 * addr = (guint8 *)mono_arch_context_get_int_reg (&frame->ctx, var->index & ~MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS);
addr += (gint32)var->offset;
return *(MonoObject**)addr;

if (frame->method->klass->valuetype) {
MonoError error;
/* Roslyn generates valuetypes in optimize mode */
/* This is ok to do because the caller will not modify the object */
return mono_value_box_checked (frame->domain, frame->method->klass, *(gpointer*)addr, &error);
mono_error_assert_ok (&error);
} else {
return *(MonoObject**)addr;
}
}

//This ID is used to figure out if breakpoint hit on resumeOffset belongs to us or not
Expand Down

0 comments on commit cc995c4

Please sign in to comment.