# This testcase is part of GDB, the GNU debugger.
-# Copyright 2001-2016 Free Software Foundation, Inc.
+# Copyright 2001-2019 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
# We don't want to test all the charset names here, since that would
# be too many combinations. We we pick a subset.
set charset_subset {ASCII ISO-8859-1 EBCDIC-US IBM1047}
-foreach host_charset $charset_subset {
+foreach_with_prefix host_charset $charset_subset {
if {[valid_host_charset $host_charset]} {
set testname "try `set host-charset $host_charset'"
proc string_display { var_name set_prefix x_size x_type} {
- gdb_test_no_output "set ${var_name} = ${set_prefix}\"Test String\\0with zeroes\"" "assign ${var_name} with prefix ${set_prefix}"
- gdb_test "x /2${x_size}s ${var_name}" ".*\t${x_type}\"Test String\"\[\r\n\]+.*\t${x_type}\"with zeroes\"" "display String ${var_name} with x/${x_size}s"
+ with_test_prefix "set_prefix=$set_prefix" {
+ gdb_test_no_output "set ${var_name} = ${set_prefix}\"Test String\\0with zeroes\""\
+ "assign ${var_name} with prefix ${set_prefix}"
+ gdb_test "x /2${x_size}s ${var_name}" ".*\t${x_type}\"Test String\"\[\r\n\]+.*\t${x_type}\"with zeroes\"" \
+ "display String ${var_name} with x/${x_size}s"
+ }
}
if {$ucs2_ok} {