Add debug-qt target for interactive gdb-wrapped crash capture
ober
3cba97471cbcef30cd6c1eeb113c67b5b1b62ac6
--- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ export CHEZ_DIR stress-edit stress-edit-static stress-file stress-file-static \ stress-chaos stress-chaos-static check-generated test-command-registry \ scenario-test scenario-burn scenario-burn-static \ - test-behavioral + test-behavioral debug-qt all: @echo "Available targets:" @@ -1163,6 +1163,27 @@ stress-run-static: -ex 'info registers' \ --args ./jemacs-qt --repl $(STRESS_PORT) +# Launch jemacs-qt (static binary) interactively under gdb on the real display. +# UI works normally; on segfault/abort, gdb writes a full backtrace to +# /tmp/jemacs-gdb.log and the in-process crash reporter writes the FFI ring +# buffer to ~/.jemacs-crash.log. Use this to demo/reproduce crashes manually. +debug-qt: + @rm -f ~/.jemacs-crash.log /tmp/jemacs-gdb.log + @echo "=== jemacs-qt under gdb ===" + @echo "Logs on crash:" + @echo " ~/.jemacs-crash.log (FFI ring buffer)" + @echo " /tmp/jemacs-gdb.log (native backtrace)" + @echo + gdb -batch \ + -ex 'handle SIGALRM nostop noprint' \ + -ex 'handle SIG34 nostop noprint' \ + -ex 'handle SIGPIPE nostop noprint' \ + -ex run \ + -ex 'bt full' \ + -ex 'thread apply all bt full' \ + -ex 'info registers' \ + --args ./jemacs-qt 2>&1 | tee /tmp/jemacs-gdb.log + # Run the stress test driver against an already-running jemacs-qt REPL stress-test: $(SCHEME) $(LIBDIRS) --script tests/stress-test.ss --port $(STRESS_PORT) --profile $(STRESS_PROFILE)