diff --git a/meson.build b/meson.build index e1b74508057fcbbf0361d40ec57495d610886fb0..6c155a9bf4fdbbd7bf35ebee6d53b78699a9ba4b 100644 --- a/meson.build +++ b/meson.build @@ -1951,7 +1951,8 @@ subdir('app-tools') # tool. gimp_run_env=environment() -gimp_run_env.set('GIMP_GLOBAL_BUILD_ROOT', meson.global_build_root()) +gimp_run_env.set('GIMP_GLOBAL_BUILD_ROOT', meson.global_build_root()) +gimp_run_env.set('GIMP_GLOBAL_SOURCE_ROOT', meson.global_source_root()) if meson.can_run_host_binaries() and have_gobject_introspection if enable_console_bin diff --git a/tools/debug-in-build-gimp.py b/tools/debug-in-build-gimp.py new file mode 100644 index 0000000000000000000000000000000000000000..7225a7c4e4e10ae0bb853a7c1ba6611f01aa4bb5 --- /dev/null +++ b/tools/debug-in-build-gimp.py @@ -0,0 +1,8 @@ +def my_signal_handler (event): + if (isinstance(event, gdb.SignalEvent)): + gdb.write("Eeeeeeeeeeeek: in-build GIMP crashed!\n") + gdb.execute('info threads') + gdb.execute("thread apply all backtrace full") + +gdb.events.stop.connect(my_signal_handler) +gdb.execute("run") diff --git a/tools/in-build-gimp.sh b/tools/in-build-gimp.sh index b1254e7e980148a24d6e61db62bc998d7b4d9dbe..913fd19c80f05aa0c640b2ffcfde25b014043c20 100755 --- a/tools/in-build-gimp.sh +++ b/tools/in-build-gimp.sh @@ -24,7 +24,13 @@ if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then unset IFS fi -cat /dev/stdin | $GIMP_SELF_IN_BUILD "$@" +if command -v gdb; then + echo RUNNING: cat /dev/stdin "|" gdb --batch -x "$GIMP_GLOBAL_SOURCE_ROOT/tools/debug-in-build-gimp.py" --args $GIMP_SELF_IN_BUILD "$@" + cat /dev/stdin | gdb --return-child-result --batch -x "$GIMP_GLOBAL_SOURCE_ROOT/tools/debug-in-build-gimp.py" --args $GIMP_SELF_IN_BUILD "$@" +else + echo RUNNING: cat /dev/stdin "|" $GIMP_SELF_IN_BUILD "$@" + cat /dev/stdin | $GIMP_SELF_IN_BUILD "$@" +fi if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then export IFS=":"