From e4c54ae287daa5f30d8ba5ff82f7143781fe3a9a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Sep 2009 16:33:03 +0000 Subject: [PATCH] Makepanda now automatically uses gdb to grab the traceback if a child process segfaulted --- makepanda/makepandacore.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 05c3ad47bc..6e8e4fdee4 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -216,6 +216,12 @@ def oscmd(cmd, ignoreError = False): res = os.spawnl(os.P_WAIT, exe, cmd) else: res = os.system(cmd) + if (res == 11): + if (LocateBinary("gdb") and GetVerbose()): + print GetColor("red") + "Received SIGSEGV, getting traceback..." + GetColor() + os.system("gdb -batch -ex 'handle SIG33 pass nostop noprint' -ex 'set pagination 0' -ex 'run' -ex 'bt full' -ex 'info registers' -ex 'thread apply all backtrace' -ex 'quit' --args %s < /dev/null" % cmd) + else: + print GetColor("red") + "Received SIGSEGV" + GetColor() if res != 0 and not ignoreError: exit("")