PR c++/15176:
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / default.exp
index 138cc03e98ed70e8f6e4f281932563c04efc36e6..6920090a16d9a497cd9bdfdad0c8adde791c0974 100644 (file)
@@ -1,5 +1,4 @@
-#   Copyright 1988, 1990-1992, 1994-2003, 2005-2012 Free Software
-#   Foundation, Inc.
+#   Copyright 1988-2013 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
@@ -495,12 +494,13 @@ gdb_test "section" "Must specify section name and its virtual address.*" "sectio
 gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
 #test set args
 gdb_test_no_output "set args" "set args"
-#test set check "c" abbreviation
-gdb_test "set c" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"c\" abbreviation"
-#test set check "ch" abbreviation
-gdb_test "set ch" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"ch\" abbreviation"
-#test set check
-gdb_test "set check" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check"
+
+# Test set check abbreviations
+foreach x {"c" "ch" "check"} {
+    gdb_test "set $x" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
+       "set check \"$x\" abbreviation"
+}
+
 #test set check range
 gdb_test "set check range" ".*" "set check range"
 #test set check type
@@ -577,16 +577,17 @@ gdb_test "shell echo Hi dad!" "Hi dad!" "shell echo Hi dad!"
 gdb_test "show annotate" "Annotation_level is 0."       "show annotate"
 #test show args
 gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"
-#test show check "c" abbreviation
-gdb_test "show c" "range:  *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
-#test show check "ch" abbreviation
-gdb_test "show ch" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"
-#test show check
-gdb_test "show check" "range:  *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Type checking is \"auto; currently off\"." "show check"
+
+# test show check abbreviations
+foreach x {"c" "ch" "check"} {
+    gdb_test "show $x" "range:  *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type:  *Strict type checking is on\..*" \
+       "show check \"$x\" abbreviation"
+}
+
 #test show check range
 gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"
 #test show check type
-gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"
+gdb_test "show check type" "Strict type checking is on\." "show check type"
 #test show commands
 gdb_test "show commands" ".*" "show commands"
 #test show complaints
@@ -595,15 +596,15 @@ gdb_test "show complaints" "Max number of complaints about incorrect symbols is
 gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"
 
 #test show convenience
-# This is tricker as there are multiple internal convenience vars and we
-# can't assume any particular order.
-gdb_test_list_exact "show convenience" "show convenience" \
-    "\[^\r\n\]+\[\r\n\]+" \
-    "\[^\r\n\]+" \
+# This is trickier as there are multiple internal convenience vars and
+# functions and we can't assume any particular order.
+# And we have to handle the extra convenience funs provided by Python.
+set show_conv_list \
     { \
        {$_sdata = void} \
        {$_siginfo = void} \
        {$_thread = 0} \
+       {$_exception = <error: No frame selected>} \
        {$_probe_argc = <error: No frame selected>} \
        {$_probe_arg0 = <error: No frame selected>} \
        {$_probe_arg1 = <error: No frame selected>} \
@@ -618,6 +619,19 @@ gdb_test_list_exact "show convenience" "show convenience" \
        {$_probe_arg10 = <error: No frame selected>} \
        {$_probe_arg11 = <error: No frame selected>} \
     }
+if ![skip_python_tests] {
+    append show_conv_list \
+       {
+           {$_memeq = <internal function _memeq>} \
+           {$_regex = <internal function _regex>} \
+           {$_streq = <internal function _streq>} \
+           {$_strlen = <internal function _strlen>} \
+       }
+}
+gdb_test_list_exact "show convenience" "show convenience" \
+    "\[^\r\n\]+\[\r\n\]+" \
+    "\[^\r\n\]+" \
+    $show_conv_list
 
 #test show directories
 gdb_test "show directories" "Source directories searched: .cdir\[:;\].cwd" "show directories"
This page took 0.026007 seconds and 4 git commands to generate.