diff -r cc97346cd515 wutils.py --- a/wutils.py Thu Mar 25 13:28:23 2010 +0000 +++ b/wutils.py Fri Apr 23 09:20:11 2010 +0530 @@ -121,7 +121,7 @@ return proc_env -def run_argv(argv, env, os_env=None, cwd=None, force_no_valgrind=False): +def run_argv(program_string, argv, env, os_env=None, cwd=None, force_no_valgrind=False): proc_env = get_proc_env(os_env) if Options.options.valgrind and not force_no_valgrind: if Options.options.command_template: @@ -149,7 +149,10 @@ 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)) + if retval == -11: + raise Utils.WafError('Your program crashed with exit code -11 (Segmentation fault). Run it under a debugger to get more information. For example, with gdb, type:\n./waf --command-template="gdb %s" --run "%s"' % ("%s", program_string)) + else: + raise Utils.WafError("Command %s exited with code %i" % (argv, retval)) return retval def get_run_program(program_string, command_template=None): @@ -210,7 +213,7 @@ cwd = Options.options.cwd_launch else: cwd = Options.cwd_launch - return run_argv(execvec, env, cwd=cwd) + return run_argv(program_string, execvec, env, cwd=cwd) @@ -221,6 +224,6 @@ cwd = Options.options.cwd_launch else: cwd = Options.cwd_launch - return run_argv([env['PYTHON']] + execvec, env, cwd=cwd) + return run_argv(program_string, [env['PYTHON']] + execvec, env, cwd=cwd)