From 898944b4a3e9f191110eb0c9495f2889fd1b0640 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 27 Feb 2020 04:08:14 -0500 Subject: [PATCH] [wasm][debugger] Show the typename for valuetypes (#32874) - no details of the valuetype are accessible Fixes mono/mono#18232 Co-authored-by: Ankit Jain --- src/mono/mono/mini/mini-wasm-debugger.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/mini-wasm-debugger.c b/src/mono/mono/mini/mini-wasm-debugger.c index a61f1f13692..3e1715c6122 100644 --- a/src/mono/mono/mini/mini-wasm-debugger.c +++ b/src/mono/mono/mini/mini-wasm-debugger.c @@ -655,18 +655,20 @@ static gboolean describe_value(MonoType * type, gpointer addr) case MONO_TYPE_SZARRAY: case MONO_TYPE_ARRAY: case MONO_TYPE_OBJECT: + case MONO_TYPE_VALUETYPE: case MONO_TYPE_CLASS: { MonoObject *obj = *(MonoObject**)addr; MonoClass *klass = type->data.klass; char *class_name = mono_type_full_name (type); + int obj_id = type->type == MONO_TYPE_VALUETYPE ? 0 : get_object_id (obj); if (type->type == MONO_TYPE_SZARRAY || type->type == MONO_TYPE_ARRAY) { - mono_wasm_add_array_var (class_name, get_object_id (obj)); + mono_wasm_add_array_var (class_name, obj_id); } else if (m_class_is_delegate (klass)) { - mono_wasm_add_func_var (class_name, get_object_id (obj)); + mono_wasm_add_func_var (class_name, obj_id); } else { - mono_wasm_add_obj_var (class_name, get_object_id (obj)); + mono_wasm_add_obj_var (class_name, obj_id); } g_free (class_name); break; -- 2.34.1