2005-11-09 Randolph Chung <tausq@debian.org>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / setshow.exp
index a23d9b7599c40e9b1083b5322135925ea25907df..a406824eebaf58fdf17facc33f6ab2d7779ced4f 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003
+# Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -12,7 +13,7 @@
 # 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 
 # Please email any bugs, comments, and/or additions to this file to:
 # bug-gdb@prep.ai.mit.edu
@@ -27,11 +28,10 @@ set prms_id 0
 set bug_id 0
 
 set testfile "setshow"
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile ${srcfile} ${binfile} executable {debug}] != "" } {
-    perror "Couldn't compile ${srcfile}"
-    return -1
+if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
+     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
 # Start with a fresh gdb
@@ -41,6 +41,11 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
+# make sure $pc is sane, in case we're talking to a board.
+if { ![runto_main] } {
+    gdb_suppress_tests;
+}
+
 #
 # Test gdb set and show commands.
 # Add tests here for show and set that don't fit neatly elsewhere.
@@ -92,9 +97,15 @@ gdb_test "info line 1" "Line 1 of .* is at address .* but contains no code.*"  "
 #test set args
 gdb_test "set args foo bar blup baz bubble" "" "set args" 
 #test show args
-gdb_test "show args" "Arguments to give program being debugged when it is started is \"foo bar blup baz bubble\"..*" "show args" 
-#test passing args
-gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args" 
+gdb_test "show args" "Argument list to give program being debugged when it is started is \"foo bar blup baz bubble\"..*" "show args"
+
+# Don't test if we can't pass args or if we're using a stub.
+if { ![target_info exists use_gdb_stub] && ![target_info exists noargs] } {
+    #test passing args
+    gdb_test "cont" "Continuing.*" "continuing"
+    delete_breakpoints
+    gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args"
+}
 #test set check range on
 gdb_test "set check range on" "" "set check range on" 
 #test show check range on
@@ -172,28 +183,30 @@ gdb_test "set listsize 100" "" "set listsize 100"
 #test show listsize 100
 gdb_test "show listsize" "Number of source lines gdb will list by default is 100..*" "show listsize (100)" 
 
-#test set prompt (FooBarBaz) 
-set newprompt "\\(FooBarBaz\\)"
-send_gdb "set prompt (FooBarBaz) \n"
-gdb_expect {
+if ![board_info target exists gdb_prompt] {
+    #test set prompt (FooBarBaz) 
+    set newprompt "\\(FooBarBaz\\)"
+    send_gdb "set prompt (FooBarBaz) \n"
+    gdb_expect {
        -re "$newprompt $"      { pass "set prompt (FooBarBaz) " }
        timeout                 { fail "(timeout) set prompt (FooBarBaz) " }
-       }
+    }
 
-#test show prompt (FooBarBaz) 
-send_gdb "show prompt\n"
-gdb_expect {
+    #test show prompt (FooBarBaz) 
+    send_gdb "show prompt\n"
+    gdb_expect {
        -re "Gdb's prompt is \"$newprompt \"..* $" \
-                               { pass "show prompt (FooBarBaz) " }
+               { pass "show prompt (FooBarBaz) " }
        timeout                 { fail "(timeout) show prompt (FooBarBaz) " }
-       }
+    }
 
-#test set prompt (gdb) 
-send_gdb "set prompt (gdb) \n"
-gdb_expect {
+    #test set prompt (gdb) 
+    send_gdb "set prompt (gdb) \n"
+    gdb_expect {
        -re "$gdb_prompt $"             { pass "set prompt (gdb) " }
        timeout                 { fail "(timeout) set prompt (gdb) " }
-       }
+    }
+}
 
 #test set radix 11
 gdb_test "set radix 11" "Unsupported output radix ``decimal 11''; output radix unchanged..*"  "set radix 11" 
This page took 0.026332 seconds and 4 git commands to generate.