mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Minor bugfix, and also, better output signal handling
This commit is contained in:
parent
1ef4137575
commit
38b35ef153
@ -9,7 +9,7 @@
|
|||||||
##
|
##
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
import sys,os,time,stat,string,re,getopt,cPickle,fnmatch,threading,Queue,signal,shutil,platform,glob,getpass
|
import sys,os,time,stat,string,re,getopt,cPickle,fnmatch,threading,Queue,signal,shutil,platform,glob,getpass,signal
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
|
|
||||||
SUFFIX_INC=[".cxx",".c",".h",".I",".yxx",".lxx",".mm",".rc",".r",".plist",".idl"]
|
SUFFIX_INC=[".cxx",".c",".h",".I",".yxx",".lxx",".mm",".rc",".r",".plist",".idl"]
|
||||||
@ -179,7 +179,7 @@ def exit(msg = ""):
|
|||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
if (threading.currentThread() == MAINTHREAD):
|
if (threading.currentThread() == MAINTHREAD):
|
||||||
SaveDependencyCache()
|
SaveDependencyCache()
|
||||||
MoveAwayConflictingFiles()
|
MoveBackConflictingFiles()
|
||||||
print "Elapsed Time: "+PrettyTime(time.time() - STARTTIME)
|
print "Elapsed Time: "+PrettyTime(time.time() - STARTTIME)
|
||||||
print msg
|
print msg
|
||||||
print GetColor("red") + "Build terminated." + GetColor()
|
print GetColor("red") + "Build terminated." + GetColor()
|
||||||
@ -214,12 +214,19 @@ 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):
|
sig = res & 0x7F
|
||||||
|
if (GetVerbose() and res != 0):
|
||||||
|
print GetColor("red") + "Process exited with exit status %d and signal code %d" % ((res & 0xFF00) >> 8, sig) + GetColor()
|
||||||
|
if (sig == signal.SIGINT):
|
||||||
|
raise KeyboardInterrupt
|
||||||
|
# Don't ask me where the 35584 or 34304 come from...
|
||||||
|
if (sig == signal.SIGSEGV or res == 35584 or res == 34304):
|
||||||
if (LocateBinary("gdb") and GetVerbose()):
|
if (LocateBinary("gdb") and GetVerbose()):
|
||||||
print GetColor("red") + "Received SIGSEGV, retrieving traceback..." + GetColor()
|
print GetColor("red") + "Received SIGSEGV, retrieving 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)
|
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:
|
else:
|
||||||
print GetColor("red") + "Received SIGSEGV" + GetColor()
|
print GetColor("red") + "Received SIGSEGV" + GetColor()
|
||||||
|
exit("")
|
||||||
if res != 0 and not ignoreError:
|
if res != 0 and not ignoreError:
|
||||||
if "interrogate" in cmd.split(" ", 1)[0] and GetVerbose():
|
if "interrogate" in cmd.split(" ", 1)[0] and GetVerbose():
|
||||||
print GetColor("red") + "Interrogate failed, retrieving debug output..." + GetColor()
|
print GetColor("red") + "Interrogate failed, retrieving debug output..." + GetColor()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user