Makepanda now automatically uses gdb to grab the traceback if a child process segfaulted

This commit is contained in:
rdb 2009-09-24 16:33:03 +00:00
parent 32ceb7e638
commit e4c54ae287

View File

@ -216,6 +216,12 @@ def oscmd(cmd, ignoreError = False):
res = os.spawnl(os.P_WAIT, exe, cmd) res = os.spawnl(os.P_WAIT, exe, cmd)
else: else:
res = os.system(cmd) 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: if res != 0 and not ignoreError:
exit("") exit("")