From: monojenkins Date: Wed, 26 Feb 2020 18:34:59 +0000 (-0500) Subject: [wasm][debugger] Fixes to get async method locals (#32807) X-Git-Tag: submit/tizen/20210909.063632~9480 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70ab36ac024e97e4877eb04ead81e09151924bb4;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [wasm][debugger] Fixes to get async method locals (#32807) .. and cleans up tests. Co-authored-by: Ankit Jain --- diff --git a/src/mono/mono/mini/mini-wasm-debugger.c b/src/mono/mono/mini/mini-wasm-debugger.c index 43dc402..a61f1f1 100644 --- a/src/mono/mono/mini/mini-wasm-debugger.c +++ b/src/mono/mono/mini/mini-wasm-debugger.c @@ -707,7 +707,15 @@ describe_object_properties (guint64 objectId, gboolean isAsyncLocalThis) while (obj && (f = mono_class_get_fields_internal (obj->vtable->klass, &iter))) { DEBUG_PRINTF (2, "mono_class_get_fields_internal - %s - %x\n", f->name, f->type->type); - if (isAsyncLocalThis && (f->name[0] != '<' || (f->name[0] == '<' && f->name[1] == '>'))) { + if (isAsyncLocalThis && f->name[0] == '<' && f->name[1] == '>') { + if (g_str_has_suffix (f->name, "__this")) { + char *class_name = mono_class_full_name (obj->vtable->klass); + mono_wasm_add_properties_var ("this"); + gpointer field_value = (guint8*)obj + f->offset; + + describe_value (f->type, field_value); + } + continue; } if (f->type->attrs & FIELD_ATTRIBUTE_STATIC) @@ -775,14 +783,17 @@ describe_async_method_locals (InterpFrame *frame, MonoMethod *method) if (mono_debug_lookup_method_async_debug_info (method)) { addr = mini_get_interp_callbacks ()->frame_get_this (frame); MonoObject *obj = *(MonoObject**)addr; - describe_object_properties(get_object_id(obj), TRUE); + describe_object_properties(get_object_id(obj), TRUE); } } static void -describe_this (InterpFrame *frame, MonoMethod *method) +describe_non_async_this (InterpFrame *frame, MonoMethod *method) { gpointer addr = NULL; + if (mono_debug_lookup_method_async_debug_info (method)) + return; + if (mono_method_signature_internal (method)->hasthis) { addr = mini_get_interp_callbacks ()->frame_get_this (frame); MonoObject *obj = *(MonoObject**)addr; @@ -849,7 +860,7 @@ describe_variables_on_frame (MonoStackFrameInfo *info, MonoContext *ctx, gpointe } describe_async_method_locals (frame, method); - describe_this (frame, method); + describe_non_async_this (frame, method); return TRUE; }