Ejemplo n.º 1
0
/*
 * Initialize debugging support.
 *
 * This method must be called after loading corlib,
 * but before opening the application's main assembly because we need to set some
 * callbacks here.
 */
void
mono_debug_init (MonoDebugFormat format)
{
    g_assert (!mono_debug_initialized);

    if (_mono_debug_using_mono_debugger)
        format = MONO_DEBUG_FORMAT_DEBUGGER;

    mono_debug_initialized = TRUE;
    mono_debug_format = format;

    mono_debugger_initialize (_mono_debug_using_mono_debugger);

    mono_debugger_lock ();

    mono_symbol_table = g_new0 (MonoSymbolTable, 1);
    mono_symbol_table->magic = MONO_DEBUGGER_MAGIC;
    mono_symbol_table->version = MONO_DEBUGGER_MAJOR_VERSION;
    mono_symbol_table->total_size = sizeof (MonoSymbolTable);

    mono_debug_handles = g_hash_table_new_full
                         (NULL, NULL, NULL, (GDestroyNotify) free_debug_handle);

    data_table_hash = g_hash_table_new_full (
                          NULL, NULL, NULL, (GDestroyNotify) free_data_table);

    mono_debugger_class_init_func = mono_debug_add_type;
    mono_debugger_class_loaded_methods_func = mono_debugger_class_initialized;
    mono_install_assembly_load_hook (mono_debug_add_assembly, NULL);

    mono_symbol_table->global_data_table = create_data_table (NULL);

    mono_debugger_unlock ();
}
Ejemplo n.º 2
0
/**
 * mono_debug_domain_create:
 */
void
mono_debug_domain_create (MonoDomain *domain)
{
	if (!mono_debug_initialized)
		return;

	mono_debugger_lock ();

	create_data_table (domain);

	mono_debugger_unlock ();
}
Ejemplo n.º 3
0
void
mono_debug_domain_create (MonoDomain *domain)
{
	MonoDebugDataTable *table;

	if (!mono_debug_initialized)
		return;

	mono_debugger_lock ();

	table = create_data_table (domain);

	mono_debugger_unlock ();
}
Ejemplo n.º 4
0
void
mono_debug_domain_create (MonoDomain *domain)
{
	MonoDebugDataTable *table;

	if (!mono_debug_initialized)
		return;

	mono_debugger_lock ();

	table = create_data_table (domain);

	mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_CREATE, (guint64) (gsize) table,
			     mono_domain_get_id (domain));

	mono_debugger_unlock ();
}
Ejemplo n.º 5
0
static MonoDebugHandle *
mono_debug_open_image (MonoImage *image, const guint8 *raw_contents, int size)
{
	MonoDebugHandle *handle;

	if (mono_image_is_dynamic (image))
		return NULL;

	mono_debugger_lock ();

	handle = _mono_debug_get_image (image);
	if (handle != NULL) {
		mono_debugger_unlock ();
		return handle;
	}

	handle = g_new0 (MonoDebugHandle, 1);
	handle->index = ++next_symbol_file_id;

	handle->image = image;
	mono_image_addref (image);
	handle->image_file = g_strdup (mono_image_get_filename (image));

	handle->type_table = create_data_table (NULL);

	handle->symfile = mono_debug_open_mono_symbols (
		handle, raw_contents, size, _mono_debug_using_mono_debugger);

	mono_debug_list_add (&mono_symbol_table->symbol_files, handle);

	g_hash_table_insert (mono_debug_handles, image, handle);

	if (mono_symbol_table->corlib)
		mono_debugger_event (MONO_DEBUGGER_EVENT_LOAD_MODULE,
				     (guint64) (gsize) handle, 0);

	mono_debugger_unlock ();

	return handle;
}