Example #1
0
static gboolean
load_profiler_from_directory (const char *directory, const char *libname, const char *desc)
{
	MonoDl *pmodule = NULL;
	char* path;
	char *err;
	void *iter;

	iter = NULL;
	err = NULL;
	while ((path = mono_dl_build_path (directory, libname, &iter))) {
		pmodule = mono_dl_open (path, MONO_DL_LAZY, &err);
		g_free (path);
		g_free (err);
		if (pmodule)
			return load_profiler (pmodule, desc, INITIALIZER_NAME);
	}
		
	return FALSE;
}
Example #2
0
// TODO: Much of the library loading code here is custom. It would be better to merge this with mono-dl
static gboolean
load_profiler_from_directory (const char *directory, const char *libname, const char *desc)
{
	MonoDl *pmodule = NULL;
	char* path;
	char *err;
	void *iter;

	mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler %s from %s (desc %s)", libname, directory, desc);

	iter = NULL;
	err = NULL;
	while ((path = mono_dl_build_path (directory, libname, &iter))) {
		pmodule = mono_dl_open (path, MONO_DL_EAGER, &err);
		mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "Attempting to load profiler: %s, %ssuccessful, err: %s", path, pmodule?"":"not ", err);
		g_free (path);
		g_free (err);
		if (pmodule)
			return load_profiler (pmodule, desc, INITIALIZER_NAME);
	}
		
	return FALSE;
}