From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 7FCEC3857C79 for ; Sat, 11 Dec 2021 11:47:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7FCEC3857C79 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x435.google.com with SMTP id a9so19101491wrr.8 for ; Sat, 11 Dec 2021 03:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=RFJGdieagXakIUxCyxZqVfIf26Lmbo8Y7vvxJc2x/38=; b=Bgt/HiMYpvrnb6ZQA4eTk/FRQi1wRQ3sMi5yaMe2X8DeUr42LH/Ztut7jRKiCbH5/o GXeQdwHeSq2gBqvJXU3dFOM7Z8sSNn+coD23JKfW7wwf4C+jACP3aRLEH1RTOw7uVTi0 nT+UI19xUcP2Qa6GKmpllugezPmH5UdG22hpXXBDSogmoMyVWHSdelzK9Xs6xrm2BRkk QGIxProzVJcvWUuum5hWtz38Dub2W+uke/Agz6qfc4hUGYRgr2hHiW8vXo11O7qgYi2b PhUyz+i8nQepdW4FQBsqXfimikGDQiJPuWiA0RD6JNE8B8KkkkNeX9wyfkGXOT+Tou8m JQlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=RFJGdieagXakIUxCyxZqVfIf26Lmbo8Y7vvxJc2x/38=; b=ZtL5yNRn2xctigVdnWYKaWkZvMdVjqbWN+3XQT2VDRJoxiITxNDjJ23IBNUMr/sB9P T90ykQH6TDqe8B5yL1r9FN0dPVM55AeiyW2gwQpolEeiz/IfDVWoOtl8qnZpf37Bi8Wi nQYUrbCj/cbMFaVKSELfn+tLxyeIXzIiUgJjrKmofcygk7hp6S+iu1VYBl7VqmKN61Vr UWQy28n3NijkARY0QnoHbz0moIYmPcTD7dd3VJs6PbFsEfeWirVTqahw0Nl5z42gNnKF 4f8U5Qn5uhODSAw4tusi0166eh9UnaIVN95CYw5kcaLneuY211aWfi+izBWWyMhC9U8r shkg== X-Gm-Message-State: AOAM5300b7AMaKRVs3rZjBfyuYCQNeilenVzqcwXmRGR5lV1EWU0vmLK HzYlog6TdVbBKU5VcyOXuMExb45joZv+Gw== X-Google-Smtp-Source: ABdhPJzRQgmLIomZNmkfG7832kvLBIeeHRnzjMnGyXzV7pFQZ+vpmS71nEUPe+KYnjqatfGv1ZVJXQ== X-Received: by 2002:adf:ec82:: with SMTP id z2mr286119wrn.230.1639223256374; Sat, 11 Dec 2021 03:47:36 -0800 (PST) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [2001:8b0:154:0:ea6a:64ff:fe24:f2fc]) by smtp.gmail.com with ESMTPSA id d7sm4729503wrw.87.2021.12.11.03.47.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Dec 2021 03:47:35 -0800 (PST) Date: Sat, 11 Dec 2021 11:47:34 +0000 (GMT) From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Andrew Burgess Subject: [PATCH 4/6] Add `set print repeats' tests for C/C++ arrays In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_ASCII_DIVIDERS, KAM_SHORT, RCVD_IN_DNSWL_NONE, SCC_5_SHORT_WORD_LINES, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Dec 2021 11:47:40 -0000 Add `set print repeats' tests for C/C++ arrays, complementing one for Fortran arrays and covering the different interpretation of the `set print elements' setting in particular where the per-dimension count of the elements handled is matched against the trigger rather than the total element count as with Fortran arrays. --- gdb/testsuite/gdb.base/array-repeat.c | 63 ++++++++++++++ gdb/testsuite/gdb.base/array-repeat.exp | 137 +++++++++++++++++++++++++++++++ gdb/testsuite/gdb.cp/array-repeat.cc | 64 ++++++++++++++ gdb/testsuite/gdb.cp/array-repeat.exp | 139 ++++++++++++++++++++++++++++++++ 4 files changed, 403 insertions(+) create mode 100644 gdb/testsuite/gdb.fortran/array-repeat.exp create mode 100644 gdb/testsuite/gdb.fortran/array-repeat.f90 gdb-set-print-repeats-test.diff Index: src/gdb/testsuite/gdb.base/array-repeat.c =================================================================== --- /dev/null +++ src/gdb/testsuite/gdb.base/array-repeat.c @@ -0,0 +1,63 @@ +/* Copyright 2021 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 3 of the License, or + (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 + along with this program. If not, see . */ + +#include + +int +main (void) +{ + int array_1d[5]; + int array_1d9[6]; + int array_2d[5][5]; + int array_2d9[6][6]; + int array_3d[5][5][5]; + int array_3d9[6][6][6]; + int i; + + for (i = 0; i < sizeof (array_1d) / sizeof (int); i++) + *(array_1d + i) = 1; + for (i = 0; i < sizeof (array_1d9) / sizeof (int); i++) + *(array_1d9 + i) = i % 6 == 5 ? 9 : 1; + for (i = 0; i < sizeof (array_2d) / sizeof (int); i++) + *(*array_2d + i) = 2; + for (i = 0; i < sizeof (array_2d9) / sizeof (int); i++) + *(*array_2d9 + i) = i / 6 == 5 || i % 6 == 5 ? 9 : 2; + for (i = 0; i < sizeof (array_3d) / sizeof (int); i++) + *(**array_3d + i) = 3; + for (i = 0; i < sizeof (array_3d9) / sizeof (int); i++) + *(**array_3d9 + i) = i / 6 / 6 == 5 || i / 6 % 6 == 5 || i % 6 == 5 ? 9 : 3; + + printf("\n"); /* Break here */ + for (i = 0; i < sizeof (array_1d) / sizeof (int); i++) + printf(" %d", *(array_1d + i)); + printf("\n"); + for (i = 0; i < sizeof (array_1d9) / sizeof (int); i++) + printf(" %d", *(array_1d9 + i)); + printf("\n"); + for (i = 0; i < sizeof (array_2d) / sizeof (int); i++) + printf(" %d", *(*array_2d + i)); + printf("\n"); + for (i = 0; i < sizeof (array_2d9) / sizeof (int); i++) + printf(" %d", *(*array_2d9 + i)); + printf("\n"); + for (i = 0; i < sizeof (array_3d) / sizeof (int); i++) + printf(" %d", *(**array_3d + i)); + printf("\n"); + for (i = 0; i < sizeof (array_3d9) / sizeof (int); i++) + printf(" %d", *(**array_3d9 + i)); + printf("\n"); + + return 0; +} Index: src/gdb/testsuite/gdb.base/array-repeat.exp =================================================================== --- /dev/null +++ src/gdb/testsuite/gdb.base/array-repeat.exp @@ -0,0 +1,137 @@ +# Copyright 2021 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 3 of the License, or +# (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 +# along with this program. If not, see . + +# Test the detection and printing of repeated elements in C arrays. + +standard_testfile .c + +if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug}]} { + return -1 +} + +if {![runto_main]} { + perror "Could not run to main." + continue +} + +gdb_breakpoint [gdb_get_line_number "Break here"] +gdb_continue_to_breakpoint "Break here" + +# Build up the expected output for each array. +set a9p9o "{9, 9, 9, 9, 9, 9}" +set a1p "{1, 1, 1, 1, 1}" +set a1p9 "{1, 1, 1, 1, 1, 9}" +set a2po "{2, 2, 2, 2, 2}" +set a2p "{${a2po}, ${a2po}, ${a2po}, ${a2po}, ${a2po}}" +set a2p9o "{2, 2, 2, 2, 2, 9}" +set a2p9 "{${a2p9o}, ${a2p9o}, ${a2p9o}, ${a2p9o}, ${a2p9o}, ${a9p9o}}" +set a3po "{3, 3, 3, 3, 3}" +set a3p "{${a3po}, ${a3po}, ${a3po}, ${a3po}, ${a3po}}" +set a3p "{${a3p}, ${a3p}, ${a3p}, ${a3p}, ${a3p}}" +set a3p9o "{3, 3, 3, 3, 3, 9}" +set a3p9 "{${a3p9o}, ${a3p9o}, ${a3p9o}, ${a3p9o}, ${a3p9o}, ${a9p9o}}" +set a9p9 "{${a9p9o}, ${a9p9o}, ${a9p9o}, ${a9p9o}, ${a9p9o}, ${a9p9o}}" +set a3p9 "{${a3p9}, ${a3p9}, ${a3p9}, ${a3p9}, ${a3p9}, ${a9p9}}" + +# Convert the output into a regexp. +set r1p [string_to_regexp $a1p] +set r1p9 [string_to_regexp $a1p9] +set r2po [string_to_regexp $a2po] +set r2p9o [string_to_regexp $a2p9o] +set r2p [string_to_regexp $a2p] +set r2p9 [string_to_regexp $a2p9] +set r3po [string_to_regexp $a3po] +set r3p9o [string_to_regexp $a3p9o] +set r3p [string_to_regexp $a3p] +set r3p9 [string_to_regexp $a3p9] + +set rep5 "" +set rep6 "" + +with_test_prefix "repeats=unlimited, elements=unlimited" { + # Check the arrays print as expected. + gdb_test_no_output "set print repeats unlimited" + gdb_test_no_output "set print elements unlimited" + + gdb_test "print array_1d" "${r1p}" + gdb_test "print array_1d9" "${r1p9}" + gdb_test "print array_2d" "${r2p}" + gdb_test "print array_2d9" "${r2p9}" + gdb_test "print array_3d" "${r3p}" + gdb_test "print array_3d9" "${r3p9}" +} + +with_test_prefix "repeats=4, elements=unlimited" { + # Now set the repeat limit. + gdb_test_no_output "set print repeats 4" + gdb_test_no_output "set print elements unlimited" + + gdb_test "print array_1d" \ + [string_to_regexp "{1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{1 ${rep5}, 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{{2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{{2 ${rep5}, 9} ${rep5}, {9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{{{3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{{{3 ${rep5}, 9} ${rep5}, {9 ${rep6}}} ${rep5},\ + {{9 ${rep6}} ${rep6}}}"] +} + +with_test_prefix "repeats=unlimited, elements=3" { + # Now set the element limit. + gdb_test_no_output "set print repeats unlimited" + gdb_test_no_output "set print elements 3" + + gdb_test "print array_1d" \ + [string_to_regexp "{1, 1, 1...}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{1, 1, 1...}"] + gdb_test "print array_2d" \ + [string_to_regexp "{{2, 2, 2...}, {2, 2, 2...}, {2, 2, 2...}...}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{{2, 2, 2...}, {2, 2, 2...}, {2, 2, 2...}...}"] + gdb_test "print array_3d" \ + [string_to_regexp "{{{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...}...}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{{{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...}...}"] +} + +with_test_prefix "repeats=4, elements=12" { + # Now set both limits. + gdb_test_no_output "set print repeats 4" + gdb_test_no_output "set print elements 12" + + gdb_test "print array_1d" \ + [string_to_regexp "{1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{1 ${rep5}, 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{{2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{{2 ${rep5}, 9} ${rep5}, {9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{{{3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{{{3 ${rep5}, 9} ${rep5}, {9 ${rep6}}} ${rep5},\ + {{9 ${rep6}} ${rep6}}}"] +} Index: src/gdb/testsuite/gdb.cp/array-repeat.cc =================================================================== --- /dev/null +++ src/gdb/testsuite/gdb.cp/array-repeat.cc @@ -0,0 +1,64 @@ +// Copyright 2021 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 3 of the License, or +// (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 +// along with this program. If not, see . + +#include +#include + +int +main () +{ + int array_1d[5]; + int array_1d9[6]; + int array_2d[5][5]; + int array_2d9[6][6]; + int array_3d[5][5][5]; + int array_3d9[6][6][6]; + std::size_t i; + + for (i = 0; i < sizeof (array_1d) / sizeof (int); i++) + *(array_1d + i) = 1; + for (i = 0; i < sizeof (array_1d9) / sizeof (int); i++) + *(array_1d9 + i) = i % 6 == 5 ? 9 : 1; + for (i = 0; i < sizeof (array_2d) / sizeof (int); i++) + *(*array_2d + i) = 2; + for (i = 0; i < sizeof (array_2d9) / sizeof (int); i++) + *(*array_2d9 + i) = i / 6 == 5 || i % 6 == 5 ? 9 : 2; + for (i = 0; i < sizeof (array_3d) / sizeof (int); i++) + *(**array_3d + i) = 3; + for (i = 0; i < sizeof (array_3d9) / sizeof (int); i++) + *(**array_3d9 + i) = i / 6 / 6 == 5 || i / 6 % 6 == 5 || i % 6 == 5 ? 9 : 3; + + std::cout << "\n"; // Break here + for (i = 0; i < sizeof (array_1d) / sizeof (int); i++) + std::cout << " " << *(array_1d + i); + std::cout << "\n"; + for (i = 0; i < sizeof (array_1d9) / sizeof (int); i++) + std::cout << " " << *(array_1d9 + i); + std::cout << "\n"; + for (i = 0; i < sizeof (array_2d) / sizeof (int); i++) + std::cout << " " << *(*array_2d + i); + std::cout << "\n"; + for (i = 0; i < sizeof (array_2d9) / sizeof (int); i++) + std::cout << " " << *(*array_2d9 + i); + std::cout << "\n"; + for (i = 0; i < sizeof (array_3d) / sizeof (int); i++) + std::cout << " " << *(**array_3d + i); + std::cout << "\n"; + for (i = 0; i < sizeof (array_3d9) / sizeof (int); i++) + std::cout << " " << *(**array_3d9 + i); + std::cout << "\n"; + + return 0; +} Index: src/gdb/testsuite/gdb.cp/array-repeat.exp =================================================================== --- /dev/null +++ src/gdb/testsuite/gdb.cp/array-repeat.exp @@ -0,0 +1,139 @@ +# Copyright 2021 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 3 of the License, or +# (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 +# along with this program. If not, see . + +# Test the detection and printing of repeated elements in C++ arrays. + +if {[skip_cplus_tests]} { continue } + +standard_testfile .cc + +if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}]} { + return -1 +} + +if {![runto_main]} { + perror "Could not run to main." + continue +} + +gdb_breakpoint [gdb_get_line_number "Break here"] +gdb_continue_to_breakpoint "Break here" + +# Build up the expected output for each array. +set a9p9o "{9, 9, 9, 9, 9, 9}" +set a1p "{1, 1, 1, 1, 1}" +set a1p9 "{1, 1, 1, 1, 1, 9}" +set a2po "{2, 2, 2, 2, 2}" +set a2p "{${a2po}, ${a2po}, ${a2po}, ${a2po}, ${a2po}}" +set a2p9o "{2, 2, 2, 2, 2, 9}" +set a2p9 "{${a2p9o}, ${a2p9o}, ${a2p9o}, ${a2p9o}, ${a2p9o}, ${a9p9o}}" +set a3po "{3, 3, 3, 3, 3}" +set a3p "{${a3po}, ${a3po}, ${a3po}, ${a3po}, ${a3po}}" +set a3p "{${a3p}, ${a3p}, ${a3p}, ${a3p}, ${a3p}}" +set a3p9o "{3, 3, 3, 3, 3, 9}" +set a3p9 "{${a3p9o}, ${a3p9o}, ${a3p9o}, ${a3p9o}, ${a3p9o}, ${a9p9o}}" +set a9p9 "{${a9p9o}, ${a9p9o}, ${a9p9o}, ${a9p9o}, ${a9p9o}, ${a9p9o}}" +set a3p9 "{${a3p9}, ${a3p9}, ${a3p9}, ${a3p9}, ${a3p9}, ${a9p9}}" + +# Convert the output into a regexp. +set r1p [string_to_regexp $a1p] +set r1p9 [string_to_regexp $a1p9] +set r2po [string_to_regexp $a2po] +set r2p9o [string_to_regexp $a2p9o] +set r2p [string_to_regexp $a2p] +set r2p9 [string_to_regexp $a2p9] +set r3po [string_to_regexp $a3po] +set r3p9o [string_to_regexp $a3p9o] +set r3p [string_to_regexp $a3p] +set r3p9 [string_to_regexp $a3p9] + +set rep5 "" +set rep6 "" + +with_test_prefix "repeats=unlimited, elements=unlimited" { + # Check the arrays print as expected. + gdb_test_no_output "set print repeats unlimited" + gdb_test_no_output "set print elements unlimited" + + gdb_test "print array_1d" "${r1p}" + gdb_test "print array_1d9" "${r1p9}" + gdb_test "print array_2d" "${r2p}" + gdb_test "print array_2d9" "${r2p9}" + gdb_test "print array_3d" "${r3p}" + gdb_test "print array_3d9" "${r3p9}" +} + +with_test_prefix "repeats=4, elements=unlimited" { + # Now set the repeat limit. + gdb_test_no_output "set print repeats 4" + gdb_test_no_output "set print elements unlimited" + + gdb_test "print array_1d" \ + [string_to_regexp "{1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{1 ${rep5}, 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{{2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{{2 ${rep5}, 9} ${rep5}, {9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{{{3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{{{3 ${rep5}, 9} ${rep5}, {9 ${rep6}}} ${rep5},\ + {{9 ${rep6}} ${rep6}}}"] +} + +with_test_prefix "repeats=unlimited, elements=3" { + # Now set the element limit. + gdb_test_no_output "set print repeats unlimited" + gdb_test_no_output "set print elements 3" + + gdb_test "print array_1d" \ + [string_to_regexp "{1, 1, 1...}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{1, 1, 1...}"] + gdb_test "print array_2d" \ + [string_to_regexp "{{2, 2, 2...}, {2, 2, 2...}, {2, 2, 2...}...}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{{2, 2, 2...}, {2, 2, 2...}, {2, 2, 2...}...}"] + gdb_test "print array_3d" \ + [string_to_regexp "{{{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...}...}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{{{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...},\ + {{3, 3, 3...}, {3, 3, 3...}, {3, 3, 3...}...}...}"] +} + +with_test_prefix "repeats=4, elements=12" { + # Now set both limits. + gdb_test_no_output "set print repeats 4" + gdb_test_no_output "set print elements 12" + + gdb_test "print array_1d" \ + [string_to_regexp "{1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{1 ${rep5}, 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{{2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{{2 ${rep5}, 9} ${rep5}, {9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{{{3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{{{3 ${rep5}, 9} ${rep5}, {9 ${rep6}}} ${rep5},\ + {{9 ${rep6}} ${rep6}}}"] +}