diff -r 7f80fb520a0a wutils.py --- a/wutils.py Thu Apr 22 14:43:34 2010 -0400 +++ b/wutils.py Fri Apr 23 11:51:34 2010 +0100 @@ -147,7 +147,20 @@ except WindowsError, ex: raise Utils.WafError("Command %s raised exception %s" % (argv, ex)) if retval: - raise Utils.WafError("Command %s exited with code %i" % (argv, retval)) + signame = None + if retval < 0: # signal? + import signal + for name, val in vars(signal).iteritems(): + if len(name) > 3 and name[:3] == 'SIG' and name[3] != '_': + if val == -retval: + signame = name + break + if signame: + raise Utils.WafError("Command %s terminated with signal %s." + " Run it under a debugger to get more information " + "(./waf --run --command-template=\"gdb --args %%s \")." % (argv, signame)) + else: + raise Utils.WafError("Command %s exited with code %i" % (argv, retval)) return retval def get_run_program(program_string, command_template=None):