summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/printcmds.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/printcmds.exp')
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index db57769c303..f2be549f2a5 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -1027,6 +1027,9 @@ proc test_repeat_bytes {} {
set fmt(SR) "\"%s\", %s"
set fmt(SS) "\"%s%s\""
+ # We have up to 60 elements to print.
+ gdb_test_no_output "set print elements 100"
+
# Set the target-charset to ASCII, because the output varies from
# different charset.
with_target_charset "ASCII" {
@@ -1074,6 +1077,17 @@ proc test_repeat_bytes {} {
}
}
+# Test for BZ#24331
+proc test_repeat_bytes_limit {} {
+ gdb_test "print -elem 3 -- \"AAAAA\"" "= \"AAA\"..."
+ gdb_test "print -char 3 -elem 10 -- \"AAAAA\"" "= \"AAA\"..."
+ gdb_test "print -elem 3 -- \"ABBBB\"" "= \"ABB\"..."
+ gdb_test "print -char 3 -elem 10 -- \"ABBBB\"" "= \"ABB\"..."
+
+ gdb_test "print -elem 3 -repeats 2 -- \"AAABBB\"" "= 'A' <repeats 3 times>..."
+ gdb_test "print -elem 4 -repeats 2 -- \"AAABBB\"" "= 'A' <repeats 3 times>, 'B' <repeats 3 times>"
+}
+
# Test printf of convenience variables.
# These tests can be done with or without a running inferior.
# PREFIX ensures uniqueness of test names.
@@ -1199,3 +1213,4 @@ test_printf_with_strings
test_print_symbol
test_repeat_bytes
test_radices
+test_repeat_bytes_limit