提交 107cae74 编写于 作者: L Lukasz Paczkowski 提交者: Lukasz

Revert "[soft-debugger-agent] Fix issue with incorrect type id being sent to...

Revert "[soft-debugger-agent] Fix issue with incorrect type id being sent to the client on assembly unload."

This reverts commit 732d6530.
上级 320ffe5d
......@@ -590,8 +590,6 @@ static gboolean protocol_version_set;
/* A hash table containing all active domains */
static GHashTable *domains;
static MonoDomain* unload_domain = NULL;
static void transport_connect (const char *host, int port);
static guint32 WINAPI debugger_thread (void *arg);
......@@ -606,9 +604,7 @@ static void thread_end (MonoProfiler *prof, gsize tid);
static void appdomain_load (MonoProfiler *prof, MonoDomain *domain, int result);
static void appdomain_unload_start (MonoProfiler *prof, MonoDomain *domain);
static void appdomain_unload_end (MonoProfiler *prof, MonoDomain *domain);
static void appdomain_unload (MonoProfiler *prof, MonoDomain *domain);
static void emit_appdomain_load (gpointer key, gpointer value, gpointer user_data);
......@@ -821,7 +817,7 @@ mono_debugger_agent_init (void)
mono_profiler_install ((MonoProfiler*)&debugger_profiler, runtime_shutdown);
mono_profiler_set_events (MONO_PROFILE_APPDOMAIN_EVENTS | MONO_PROFILE_THREADS | MONO_PROFILE_ASSEMBLY_EVENTS | MONO_PROFILE_JIT_COMPILATION | MONO_PROFILE_METHOD_EVENTS);
mono_profiler_install_runtime_initialized (runtime_initialized);
mono_profiler_install_appdomain (NULL, appdomain_load, appdomain_unload_start, appdomain_unload_end);
mono_profiler_install_appdomain (NULL, appdomain_load, NULL, appdomain_unload);
mono_profiler_install_thread (thread_startup, thread_end);
mono_profiler_install_assembly (NULL, assembly_load, assembly_unload, NULL);
mono_profiler_install_jit_end (jit_end);
......@@ -2932,17 +2928,6 @@ event_to_string (EventKind event)
}
}
static MonoDomain* get_assembly_unload_domain(MonoAssembly *assembly)
{
if(!unload_domain)
return NULL;
if(g_slist_find(unload_domain->domain_assemblies, assembly))
return unload_domain;
return NULL;
}
/*
* process_event:
*
......@@ -2956,7 +2941,6 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx
{
Buffer buf;
GSList *l;
MonoDomain* assemblyDomain;
MonoDomain *domain = mono_domain_get ();
MonoThread *thread = NULL,
*main_thread = mono_thread_get_main ();
......@@ -3025,17 +3009,8 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx
buffer_add_methodid (&buf, domain, arg);
break;
case EVENT_KIND_ASSEMBLY_LOAD:
buffer_add_assemblyid (&buf, domain, arg);
break;
case EVENT_KIND_ASSEMBLY_UNLOAD:
/* When an assembly is being unloaded it still exists in one domain (domain->domain_assemblies list).
`domain` is set to the current domain and it might not be the domain from which the assembly is
unloaded, so we check whether the assembly exists in the domain currently being unloaded.
This is necesarry in order to send the correct type id for the assembly to the client,
as type ids are stored per domain.
*/
assemblyDomain = get_assembly_unload_domain(arg);
buffer_add_assemblyid (&buf, assemblyDomain ? assemblyDomain : domain, arg);
buffer_add_assemblyid (&buf, domain, arg);
break;
case EVENT_KIND_TYPE_LOAD:
buffer_add_typeid (&buf, domain, arg);
......@@ -3264,24 +3239,13 @@ appdomain_load (MonoProfiler *prof, MonoDomain *domain, int result)
}
static void
appdomain_unload_start (MonoProfiler *prof, MonoDomain *domain)
{
mono_loader_lock ();
unload_domain = domain;
mono_loader_unlock ();
}
static void
appdomain_unload_end (MonoProfiler *prof, MonoDomain *domain)
appdomain_unload (MonoProfiler *prof, MonoDomain *domain)
{
process_profiler_event (EVENT_KIND_APPDOMAIN_UNLOAD, domain);
clear_breakpoints_for_domain (domain);
mono_loader_lock ();
unload_domain = NULL;
/* Invalidate each thread's frame stack */
mono_g_hash_table_foreach (thread_to_tls, invalidate_each_thread, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册