-# 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
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
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.
#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
#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"