Skip to content

Commit

Permalink
**** Backport of r130659 ****
Browse files Browse the repository at this point in the history
2009-03-31  Martin Baulig  <martin@ximian.com>

	* mono-debug-debugger.h (MonoDebuggerEvent): Add
	`MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
	`MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
	(mono_debugger_event_create_appdomain): New function.
	(mono_debugger_event_unload_appdomain): New function.

	* appdomain.c (mono_domain_create_appdomain_internal): Call
	mono_debugger_event_create_appdomain().

svn path=/branches/mono-2-4/mono/; revision=132892
  • Loading branch information
Martin Baulig committed Apr 28, 2009
1 parent 77754c9 commit 29035ca
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mono/metadata/ChangeLog
Expand Up @@ -8,6 +8,19 @@
* cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.

2009-03-31 Martin Baulig <martin@ximian.com>

Backport of r130659.

* mono-debug-debugger.h (MonoDebuggerEvent): Add
`MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
`MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
(mono_debugger_event_create_appdomain): New function.
(mono_debugger_event_unload_appdomain): New function.

* appdomain.c (mono_domain_create_appdomain_internal): Call
mono_debugger_event_create_appdomain().

2009-03-31 Martin Baulig <martin@ximian.com>

Backport of r130658.
Expand Down
8 changes: 8 additions & 0 deletions mono/metadata/appdomain.c
Expand Up @@ -41,6 +41,7 @@
#include <mono/metadata/monitor.h>
#include <mono/metadata/threadpool.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/mono-debug-debugger.h>
#include <mono/metadata/attach.h>
#include <mono/metadata/file-io.h>
#include <mono/metadata/console-io.h>
Expand Down Expand Up @@ -111,6 +112,9 @@ add_assemblies_to_domain (MonoDomain *domain, MonoAssembly *ass, GHashTable *has
static MonoAppDomain *
mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetup *setup);

static char *
get_shadow_assembly_location_base (MonoDomain *domain);

static MonoLoadFunc load_function = NULL;

void
Expand Down Expand Up @@ -414,6 +418,8 @@ mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetup *

add_assemblies_to_domain (data, mono_defaults.corlib->assembly, NULL);

mono_debugger_event_create_appdomain (data, get_shadow_assembly_location_base (data));

return ad;
}

Expand Down Expand Up @@ -2032,6 +2038,8 @@ mono_domain_unload (MonoDomain *domain)
}
}

mono_debugger_event_unload_appdomain (domain);

mono_domain_set (domain, FALSE);
/* Notify OnDomainUnload listeners */
method = mono_class_get_method_from_name (domain->domain->mbr.obj.vtable->klass, "DoDomainUnload", -1);
Expand Down
31 changes: 31 additions & 0 deletions mono/metadata/mono-debug-debugger.c
Expand Up @@ -11,6 +11,7 @@
#include <mono/metadata/gc-internal.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/domain-internals.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/mono-debug-debugger.h>
Expand Down Expand Up @@ -39,6 +40,14 @@ typedef struct {
gchar *name;
} ClassInitCallback;

typedef struct {
guint32 id;
guint32 shadow_path_len;
gchar *shadow_path;
MonoDomain *domain;
MonoAppDomainSetup *setup;
} AppDomainSetupInfo;

static GPtrArray *class_init_callbacks = NULL;

static int initialized = 0;
Expand Down Expand Up @@ -78,6 +87,28 @@ mono_debugger_event (MonoDebuggerEvent event, guint64 data, guint64 arg)
(* mono_debugger_event_handler) (event, data, arg);
}

void
mono_debugger_event_create_appdomain (MonoDomain *domain, gchar *shadow_path)
{
AppDomainSetupInfo info;

info.id = mono_domain_get_id (domain);
info.shadow_path_len = shadow_path ? strlen (shadow_path) : 0;
info.shadow_path = shadow_path;

info.domain = domain;
info.setup = domain->setup;

mono_debugger_event (MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN, (guint64) (gsize) &info, 0);
}

void
mono_debugger_event_unload_appdomain (MonoDomain *domain)
{
mono_debugger_event (MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN,
(guint64) (gsize) domain, (guint64) mono_domain_get_id (domain));
}

void
mono_debugger_cleanup (void)
{
Expand Down
8 changes: 8 additions & 0 deletions mono/metadata/mono-debug-debugger.h
Expand Up @@ -37,6 +37,8 @@ typedef enum {
MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD,
MONO_DEBUGGER_EVENT_CLASS_INITIALIZED,
MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST,
MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN,
MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN,

/* Extended per-thread notifications */
MONO_DEBUGGER_EVENT_TRAMPOLINE = 256,
Expand Down Expand Up @@ -65,6 +67,12 @@ mono_debugger_class_initialized (MonoClass *klass);
void
mono_debugger_check_interruption (void);

void
mono_debugger_event_create_appdomain (MonoDomain *domain, gchar *shadow_path);

void
mono_debugger_event_unload_appdomain (MonoDomain *domain);

MonoDebugMethodAddressList *
mono_debugger_insert_method_breakpoint (MonoMethod *method, guint64 idx);

Expand Down

0 comments on commit 29035ca

Please sign in to comment.