* config/sim.exp (gdb_target_sim): Just return with -1 when setting
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 25 Apr 2007 11:38:45 +0000 (11:38 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 25 Apr 2007 11:38:45 +0000 (11:38 +0000)
target sim fails.  Return 0 otherwise.
(gdb_load): Return prematurely if gdb_target_sim fails.

gdb/testsuite/ChangeLog
gdb/testsuite/config/sim.exp

index f6990f067862901ea03791177254e081efce1641..57c7041176699224625f731d53483c6d06171034 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-25  Corinna Vinschen <vinschen@redhat.com>
+
+       * config/sim.exp (gdb_target_sim): Just return with -1 when setting
+       target sim fails.  Return 0 otherwise.
+       (gdb_load): Return prematurely if gdb_target_sim fails.
+
 2007-04-16  Denis Pilat  <denis.pilat@st.com>
 
        * gdb.base/setshow.exp: Reset height after having set it to 100.
index 9b6a226e044ad0fe0d24bb0c92e643614d19e4e3..83c96e0a7e82cb5d09df77dd7adbf0e7870412de 100644 (file)
@@ -23,7 +23,6 @@ load_lib gdb.exp
 #
 proc gdb_target_sim { } {
     global gdb_prompt
-    global exit_status
     
     set target_sim_options "[board_info target gdb,target_sim_options]";
 
@@ -37,11 +36,12 @@ proc gdb_target_sim { } {
        timeout { 
            perror "Couldn't set target for simulator."
            cleanup
-           exit $exit_status
+           return -1
        }
     }
     set timeout 10
     verbose "Timeout is now $timeout seconds" 2
+    return 0
 }
 
 #
@@ -59,7 +59,7 @@ proc gdb_load { arg } {
        if [gdb_file_cmd $arg] then { return -1 }
     }
 
-    gdb_target_sim
+    if [gdb_target_sim] then { return -1 }
 
     send_gdb "load\n"
     set timeout 2400