PATCH: Fix default_binutils_run to check exit status

H. J. Lu hjl@lucon.org
Thu Apr 6 21:50:00 GMT 2006


default_binutils_run doesn't check exit status. If a program
segfaults and doesn't generate any output, default_binutils_run
think it is successful. This patch checks exit status.


H.J.
----
2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>

	* lib/utils-lib.exp (default_binutils_run): Check exit status.

--- binutils/testsuite/lib/utils-lib.exp.status	2005-05-08 07:17:41.000000000 -0700
+++ binutils/testsuite/lib/utils-lib.exp	2006-04-06 12:59:45.000000000 -0700
@@ -73,6 +73,12 @@ proc default_binutils_run { prog progarg
     if {![string match "" $exec_output]} then {
 	send_log "$exec_output\n"
 	verbose "$exec_output"
+    } else {
+	if { [lindex $state 0] != 0 } {
+	    set exec_output "$prog exited with status [lindex $state 0]"
+	    send_log "$exec_output\n"
+	    verbose "$exec_output"
+	}
     }
     return $exec_output
 }



More information about the Binutils mailing list