1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-05 21:02:42 +02:00

app: Make possible to append _NT_SYMBOL_PATH

This commit is contained in:
Bruno Lopes
2025-09-09 07:51:42 -03:00
parent 8a5825b66f
commit 9026d18039
2 changed files with 37 additions and 6 deletions

View File

@@ -53,7 +53,9 @@ void
gimp_init_signal_handlers (gchar **backtrace_file)
{
time_t t;
#ifdef G_OS_WIN32
#if defined(G_OS_WIN32) && defined(ENABLE_RELOCATABLE_RESOURCES)
gchar *bin_dir;
size_t codeview_path_len;
gchar *codeview_path;
#endif
gchar *filename;
@@ -63,11 +65,23 @@ gimp_init_signal_handlers (gchar **backtrace_file)
#endif
#ifdef G_OS_WIN32
#ifdef ENABLE_RELOCATABLE_RESOURCES
/* FIXME: https://github.com/jrfonseca/drmingw/issues/91 */
codeview_path = g_build_filename (gimp_installation_directory (),
"bin", NULL);
bin_dir = g_build_filename (gimp_installation_directory (), "bin", NULL);
codeview_path_len = strlen (g_getenv ("_NT_SYMBOL_PATH") ? g_getenv ("_NT_SYMBOL_PATH") : "") + strlen (bin_dir) + 2;
codeview_path = g_try_malloc (codeview_path_len);
if (codeview_path == NULL)
{
g_warning ("Failed to allocate memory");
}
if (g_getenv ("_NT_SYMBOL_PATH"))
g_snprintf (codeview_path, codeview_path_len, "%s;%s", bin_dir, g_getenv ("_NT_SYMBOL_PATH"));
else
g_snprintf (codeview_path, codeview_path_len, "%s", bin_dir);
g_setenv ("_NT_SYMBOL_PATH", codeview_path, TRUE);
g_free (codeview_path);
g_free (bin_dir);
#endif
/* This has to be the non-roaming directory (i.e., the local
directory) as backtraces correspond to the binaries on this

View File

@@ -227,16 +227,33 @@ gimp_main (GType plug_in_type,
/* Use Dr. Mingw (dumps backtrace on crash) if it is available. */
{
time_t t;
#ifdef ENABLE_RELOCATABLE_RESOURCES
gchar *plugin_dir;
size_t codeview_path_len;
gchar *codeview_path;
#endif
gchar *filename;
gchar *dir;
wchar_t *plug_in_backtrace_path_utf16;
/* FIXME: https://github.com/jrfonseca/drmingw/issues/91 */
codeview_path = g_build_filename (gimp_installation_directory (),
"bin", NULL);
#ifdef ENABLE_RELOCATABLE_RESOURCES
/* FIXME: https://github.com/jrfonseca/drmingw/issues/91
* FIXME: This needs to take into account the plugin path
plugin_dir = ???
codeview_path_len = strlen (g_getenv ("_NT_SYMBOL_PATH") ? g_getenv ("_NT_SYMBOL_PATH") : "") + strlen (plugin_dir) + 2;
codeview_path = g_try_malloc (codeview_path_len);
if (codeview_path == NULL)
{
g_warning ("Failed to allocate memory");
}
if (g_getenv ("_NT_SYMBOL_PATH"))
g_snprintf (codeview_path, codeview_path_len, "%s;%s", plugin_dir, g_getenv ("_NT_SYMBOL_PATH"));
else
g_snprintf (codeview_path, codeview_path_len, "%s", plugin_dir);
g_setenv ("_NT_SYMBOL_PATH", codeview_path, TRUE);
g_free (codeview_path);
g_free (plugin_dir);*/
#endif
/* This has to be the non-roaming directory (i.e., the local
* directory) as backtraces correspond to the binaries on this