Exemple #1
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->image = image;
	mono_image_addref (image);

	/* Try a ppdb file first */
	handle->ppdb = mono_ppdb_load_file (handle->image, raw_contents, size);

	if (!handle->ppdb)
		handle->symfile = mono_debug_open_mono_symbols (handle, raw_contents, size, FALSE);

	g_hash_table_insert (mono_debug_handles, image, handle);

	mono_debugger_unlock ();

	return handle;
}
Exemple #2
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;
}