2011-01-01 16:34:07 +01:00
|
|
|
# Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
2006-10-06 20:17:56 +02:00
|
|
|
|
|
|
|
# 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
|
2007-08-23 20:14:19 +02:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2006-10-06 20:17:56 +02:00
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 20:14:19 +02:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2006-10-06 20:17:56 +02:00
|
|
|
|
|
|
|
if $tracelevel {
|
|
|
|
strace $tracelevel
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
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.
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "set confirm off" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"deactivate GDB's confirmation interface"
|
|
|
|
|
|
|
|
gdb_test "show substitute-path" \
|
|
|
|
"List of all source path substitution rules:" \
|
|
|
|
"show substitute-path, no rule entered yet"
|
|
|
|
|
|
|
|
gdb_test "show substitute-path from" \
|
|
|
|
"Source path substitution rule matching `from':" \
|
|
|
|
"show substitute-path from, no rule entered yet"
|
|
|
|
|
|
|
|
gdb_test "show substitute-path too many" \
|
|
|
|
"Too many arguments in command" \
|
|
|
|
"show substitute-path, too many arguments"
|
|
|
|
|
|
|
|
gdb_test "unset substitute-path from" \
|
|
|
|
"No substitution rule defined for `from'" \
|
|
|
|
"unset substitute-path from, no rule entered yet"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "unset substitute-path" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"unset substitute-path, no rule entered yet"
|
|
|
|
|
|
|
|
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 from to" \
|
|
|
|
"Incorrect usage, too many arguments in command" \
|
|
|
|
"unset substitute-path, too many arguments"
|
|
|
|
|
|
|
|
gdb_test "set substitute-path too many arguments" \
|
|
|
|
"Incorrect usage, too many arguments in command" \
|
|
|
|
"set substitute-path, too many arguments"
|
|
|
|
|
|
|
|
gdb_test "set substitute-path missing" \
|
|
|
|
"Incorrect usage, too few arguments in command" \
|
|
|
|
"set substitute-path, too few arguments"
|
|
|
|
|
|
|
|
gdb_test "set substitute-path '' to" \
|
|
|
|
"First argument must be at least one character long" \
|
|
|
|
"set substitute-path, first argument is empty string"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "set substitute-path from to" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"add from -> to substitution rule"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "set substitute-path from1 to1/" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"add from1 -> to1 substitution rule"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "set substitute-path source destination" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"add source -> destination substitution rule"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "set substitute-path depuis/ vers" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"add depuis -> vers substitution rule"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "set substitute-path empty ''" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"add substitution rule to empty string"
|
|
|
|
|
|
|
|
gdb_test "show substitute-path" \
|
|
|
|
"List of all source path substitution rules:\r\n +`from' -> `to'.\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
|
|
|
|
"show substitute-path after all paths added"
|
|
|
|
|
|
|
|
gdb_test "show substitute-path from" \
|
|
|
|
"Source path substitution rule matching `from':\r\n +`from' -> `to'." \
|
|
|
|
"show substitute-path from, after all paths added"
|
|
|
|
|
|
|
|
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 garbage" \
|
|
|
|
"Source path substitution rule matching `garbage':" \
|
|
|
|
"show substitute-path garbage, after all paths added"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "unset substitute-path from" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"unset substitute-path from"
|
|
|
|
|
|
|
|
gdb_test "show substitute-path from" \
|
|
|
|
"Source path substitution rule matching `from':" \
|
2010-06-01 01:20:20 +02:00
|
|
|
"show substitute-path from, after unsetting it"
|
2006-10-06 20:17:56 +02:00
|
|
|
|
|
|
|
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' -> `'." \
|
|
|
|
"show substitute-path after from rule removed"
|
|
|
|
|
|
|
|
gdb_test "unset substitute-path from" \
|
|
|
|
"No substitution rule defined for `from'" \
|
|
|
|
"unset substitute-path from after the rule was removed"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "unset substitute-path depuis" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"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"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "unset substitute-path empty" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"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"
|
|
|
|
|
2010-06-01 23:29:21 +02:00
|
|
|
gdb_test_no_output "unset substitute-path" \
|
2006-10-06 20:17:56 +02:00
|
|
|
"remove all remaining substitution rules"
|
|
|
|
|
|
|
|
gdb_test "show substitute-path" \
|
|
|
|
"List of all source path substitution rules:" \
|
|
|
|
"show substitute-path after all remaining rules removed"
|
|
|
|
|
|
|
|
|