Fix zero_ext documentation
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / subst.exp
index cda75f950ea4784625247885a030c2b81d823f5e..f6fa0bc13df8ac40c7ae816c1ee1a5cacf440304 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006-2016 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # GNU General Public License for more details.
 #
 # 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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301, USA
-
-if $tracelevel {
-    strace $tracelevel
-}
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 gdb_exit
 gdb_start
@@ -26,10 +20,15 @@ gdb_reinitialize_dir $srcdir/$subdir
 # Do a bunch of testing of the set/unset/show substitute-path
 # commands that do not require the presence of an executable.
 
-gdb_test "set confirm off" \
-         "" \
+gdb_test_no_output "set confirm off" \
          "deactivate GDB's confirmation interface"
 
+# Clear any substitution rules that are available by default due
+# to GDB being configured with --with-relocated-sources.
+
+gdb_test_no_output "unset substitute-path" \
+         "remove default substitution rules"
+
 gdb_test "show substitute-path" \
          "List of all source path substitution rules:" \
          "show substitute-path, no rule entered yet"
@@ -46,8 +45,7 @@ gdb_test "unset substitute-path from" \
          "No substitution rule defined for `from'" \
          "unset substitute-path from, no rule entered yet"
 
-gdb_test "unset substitute-path" \
-         "" \
+gdb_test_no_output "unset substitute-path" \
          "unset substitute-path, no rule entered yet"
 
 gdb_test "unset substitute-path from" \
@@ -70,24 +68,19 @@ gdb_test "set substitute-path '' to" \
          "First argument must be at least one character long" \
          "set substitute-path, first argument is empty string"
 
-gdb_test "set substitute-path from to" \
-         "" \
+gdb_test_no_output "set substitute-path from to" \
          "add from -> to substitution rule"
 
-gdb_test "set substitute-path from1 to1/" \
-         "" \
+gdb_test_no_output "set substitute-path from1 to1/" \
          "add from1 -> to1 substitution rule"
 
-gdb_test "set substitute-path source destination" \
-         "" \
+gdb_test_no_output "set substitute-path source destination" \
          "add source -> destination substitution rule"
 
-gdb_test "set substitute-path depuis/ vers" \
-         "" \
+gdb_test_no_output "set substitute-path depuis/ vers" \
          "add depuis -> vers substitution rule"
 
-gdb_test "set substitute-path empty ''" \
-         "" \
+gdb_test_no_output "set substitute-path empty ''" \
          "add substitution rule to empty string"
 
 gdb_test "show substitute-path" \
@@ -102,17 +95,24 @@ gdb_test "show substitute-path depuis" \
          "Source path substitution rule matching `depuis':\r\n +`depuis' -> `vers'." \
          "show substitute-path depuis, after all paths added"
 
+gdb_test "show substitute-path from/path" \
+         "Source path substitution rule matching `from/path':\r\n +`from' -> `to'." \
+         "show substitute-path from/path, after all paths added"
+
+gdb_test "show substitute-path from_a_bad_path" \
+         "Source path substitution rule matching `from_a_bad_path':" \
+         "show substitute-path from_a_bad_path, after all paths added"
+
 gdb_test "show substitute-path garbage" \
          "Source path substitution rule matching `garbage':" \
          "show substitute-path garbage, after all paths added"
 
-gdb_test "unset substitute-path from" \
-         "" \
+gdb_test_no_output "unset substitute-path from" \
          "unset substitute-path from"
 
 gdb_test "show substitute-path from" \
          "Source path substitution rule matching `from':" \
-         ""
+         "show substitute-path from, after unsetting it"
 
 gdb_test "show substitute-path" \
          "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
@@ -122,24 +122,21 @@ gdb_test "unset substitute-path from" \
          "No substitution rule defined for `from'" \
          "unset substitute-path from after the rule was removed"
 
-gdb_test "unset substitute-path depuis" \
-         "" \
+gdb_test_no_output "unset substitute-path depuis" \
          "unset substitute-path depuis (middle of list)"
 
 gdb_test "show substitute-path" \
          "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`empty' -> `'." \
          "show substitute-path after depuis rule removed"
 
-gdb_test "unset substitute-path empty" \
-         "" \
+gdb_test_no_output "unset substitute-path empty" \
          "unset substitute-path empty (end of list)"
 
 gdb_test "show substitute-path" \
          "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'." \
          "show substitute-path after empty rule removed"
 
-gdb_test "unset substitute-path" \
-         "" \
+gdb_test_no_output "unset substitute-path" \
          "remove all remaining substitution rules"
 
 gdb_test "show substitute-path" \
This page took 0.02598 seconds and 4 git commands to generate.