aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite/lib/gas-defs.exp
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-03-06 02:08:25 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-03-06 02:08:25 +0000
commit412cc54eb9847848c9cea2e54636cb2e7bd17460 (patch)
tree6178b52d8bcf068af642c8bcac660615933fc1d9 /gas/testsuite/lib/gas-defs.exp
parent5a38199b18b8c49c9efa8cba4597c3811fa10373 (diff)
downloadgdb-412cc54eb9847848c9cea2e54636cb2e7bd17460.zip
gdb-412cc54eb9847848c9cea2e54636cb2e7bd17460.tar.gz
gdb-412cc54eb9847848c9cea2e54636cb2e7bd17460.tar.bz2
2007-03-05 H.J. Lu <hongjiu.lu@intel.com>
PR gas/3918 * lib/gas-defs.exp (gas_started): New variable. Initialized to 0. (gas_start): Set gas_started to 1. (gas_finish): Skip if gas_started is 0. Reset gas_started to 0.
Diffstat (limited to 'gas/testsuite/lib/gas-defs.exp')
-rw-r--r--gas/testsuite/lib/gas-defs.exp17
1 files changed, 15 insertions, 2 deletions
diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp
index 827e22f..3b21719 100644
--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -53,12 +53,21 @@ proc all_ones { args } {
return 1
}
+# ${tool}_finish (gas_finish) will be called by runtest.exp. But
+# gas_finish should only be used with gas_start. We use gas_started
+# to tell gas_finish if gas_start has been called so that runtest.exp
+# can call gas_finish without closing the wrong fd.
+set gas_started 0
+
proc gas_start { prog as_opts } {
global AS
global ASFLAGS
global srcdir
global subdir
global spawn_id
+ global gas_started
+
+ set gas_started 1
verbose -log "Starting $AS $ASFLAGS $as_opts $prog" 2
catch {
@@ -71,9 +80,13 @@ proc gas_start { prog as_opts } {
proc gas_finish { } {
global spawn_id
+ global gas_started
- catch "close"
- catch "wait"
+ if { $gas_started == 1 } {
+ catch "close"
+ catch "wait"
+ set gas_started 0
+ }
}
proc want_no_output { testname } {