From 71f1c162abbd5862e9de7ee4e484d404950f1064 Mon Sep 17 00:00:00 2001 From: Josh Peterson Date: Mon, 12 Feb 2018 13:31:50 -0500 Subject: [PATCH] Synchronize changes debugger from the IL2CPP repo --- mono/mini/il2cpp-stubs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mono/mini/il2cpp-stubs.cpp b/mono/mini/il2cpp-stubs.cpp index e2a72d2e01e8..3f2696d5b943 100644 --- a/mono/mini/il2cpp-stubs.cpp +++ b/mono/mini/il2cpp-stubs.cpp @@ -763,7 +763,14 @@ void il2cpp_mono_thread_internal_reset_abort(MonoInternalThread* thread) gunichar2* il2cpp_mono_thread_get_name(MonoInternalThread* this_obj, guint32* name_len) { - return NULL; + std::string name = il2cpp::vm::Thread::GetName((Il2CppInternalThread*)this_obj); + + if (name_len != NULL) + *name_len = name.size(); + + if (name.empty()) + return NULL; + return g_utf8_to_utf16(name.c_str(), name.size(), NULL, NULL, NULL); } void il2cpp_mono_thread_set_name_internal(MonoInternalThread* this_obj, MonoString* name, gboolean permanent, gboolean reset, MonoError* error)