Skip to content

Commit

Permalink
Merge pull request #823 from Unity-Technologies/il2cpp-debugger-vs-fo…
Browse files Browse the repository at this point in the history
…r-mac-fixes

Fixes for il2cpp debugger running with Visual Studio for Mac:
  • Loading branch information
brianradunity authored Jan 29, 2018
2 parents 0541fdf + 95ab5eb commit 454c8f0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
17 changes: 12 additions & 5 deletions mono/mini/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -9418,14 +9418,17 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
case CMD_ASSEMBLY_GET_NAME: {
gchar *name;
MonoAssembly *mass = ass;
#ifdef RUNTIME_IL2CPP
name = il2cpp_assembly_get_full_name(mass);
#else
name = g_strdup_printf (
"%s, Version=%d.%d.%d.%d, Culture=%s, PublicKeyToken=%s%s",
mass->aname.name,
mass->aname.major, mass->aname.minor, mass->aname.build, mass->aname.revision,
mass->aname.culture && *mass->aname.culture ? mass->aname.culture : "neutral",
mass->aname.public_key_token[0] ? (char *)mass->aname.public_key_token : "null",
(mass->aname.flags & ASSEMBLYREF_RETARGETABLE_FLAG) ? ", Retargetable=Yes" : "");

#endif
buffer_add_string (buf, name);
g_free (name);
break;
Expand Down Expand Up @@ -9775,7 +9778,8 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
return err;
break;
#else
return ERR_NOT_IMPLEMENTED;
buffer_add_int (buf, 0);
return ERR_NONE;
#endif //RUNTIME_IL2CPP
}
case CMD_TYPE_GET_FIELD_CATTRS: {
Expand All @@ -9802,7 +9806,8 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
return err;
break;
#else
return ERR_NOT_IMPLEMENTED;
buffer_add_int (buf, 0);
return ERR_NONE;
#endif //RUNTIME_IL2CPP
}
case CMD_TYPE_GET_PROPERTY_CATTRS: {
Expand All @@ -9829,7 +9834,8 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
return err;
break;
#else
return ERR_NOT_IMPLEMENTED;
buffer_add_int (buf, 0);
return ERR_NONE;
#endif //RUNTIME_IL2CPP
}
case CMD_TYPE_GET_VALUES:
Expand Down Expand Up @@ -10707,7 +10713,8 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
return err;
break;
#else
return ERR_NOT_IMPLEMENTED;
buffer_add_int (buf, 0);
return ERR_NONE;
#endif //RUNTIME_IL2CPP
}
case CMD_METHOD_MAKE_GENERIC_METHOD: {
Expand Down
1 change: 1 addition & 0 deletions mono/mini/il2cpp-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,6 @@ MonoClass* il2cpp_generic_class_get_container_class(MonoGenericClass *gclass);
void il2cpp_mono_thread_detach(MonoThread* thread);
MonoClass* il2cpp_mono_get_string_class (void);
Il2CppSequencePoint* il2cpp_get_sequence_point(int id);
char* il2cpp_assembly_get_full_name(MonoAssembly *assembly);

#endif // RUNTIME_IL2CPP
7 changes: 7 additions & 0 deletions mono/mini/il2cpp-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,5 +1490,12 @@ Il2CppSequencePoint* il2cpp_get_sequence_point(int id)
return NULL;
#endif
}

char* il2cpp_assembly_get_full_name(MonoAssembly *assembly)
{
std::string s = il2cpp::vm::AssemblyName::AssemblyNameToString(assembly->aname);
return g_strdup(s.c_str());
}

}
#endif // RUNTIME_IL2CPP

0 comments on commit 454c8f0

Please sign in to comment.