]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/setshow.exp
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / setshow.exp
index 25819ed961437ff4fbcc20fe37797346aaaa5f9c..113afae4742e24196d904a0447bc59d59ad91331 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003, 2007
+# 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
@@ -27,11 +28,11 @@ 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}] != "" } {
+     untested setshow.exp
+     return -1
 }
 
 # Start with a fresh gdb
@@ -41,6 +42,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,11 +98,13 @@ 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"
+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 gdb,use_stub] && ![target_info exists noargs] } {
+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
@@ -176,28 +184,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"