Example #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 ();
}
Example #2
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 (format == MONO_DEBUG_FORMAT_DEBUGGER)
		g_error ("The mdb debugger is no longer supported.");

	mono_debug_initialized = TRUE;
	mono_debug_format = format;

	mono_debugger_initialize ();

	mono_debugger_lock ();

	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_install_assembly_load_hook (mono_debug_add_assembly, NULL);

	mono_debugger_unlock ();
}