From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 1F0F93857C7E for ; Sat, 11 Dec 2021 11:48:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F0F93857C7E 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-x429.google.com with SMTP id d9so19150038wrw.4 for ; Sat, 11 Dec 2021 03:48:04 -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=NntFUSVmurf7RTpjseilwHribgHEdbJ1uBoR1fxqBg0=; b=TbP1kPUKEgcT+fvTMu1rMDW0Ztf00MbyGkLGpmG4by3Me94D/h6jSV8S2Y4xtnujLa TgKgl4EDl7oVwBJnOOX5IcpFDL+mS5CD4mXwDcHNPZrYJwCuUU+c+GUDFNu7e2fYJDnZ 0MmuOqxW9K9iMbJ55IKVvdvYLetgYpr8Xynf08gJwgfHWXT8AgUm0Oq+Dq/Co8LXyNiU V06liKcjL1TdJPdwuqFcP9RZZLVSd8PWdTAdgP6UIjTtOScock+VDYBVa3CMJ9HPtZZj eGRIXlurVGy6h4ItHUJyYd0B51DeEln0MZ9GyROxHJkhxQCqXcfi27sN311wdmsCBedb Q/Ow== 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=NntFUSVmurf7RTpjseilwHribgHEdbJ1uBoR1fxqBg0=; b=s8RzTXl+2vtAvAxhuN1jEKbX44k8H4XvUAfff8F+rMuNyxUVNvPLXZOWCTYIvVXvmA wuCrKQTbbBfRbWZerjvYhOmALj0DS8r7K94oy5oClS+0Vrv31BHOWMR1ir+9kR76f12S 7K6gVkcUlaTUOtL4sic/1kwjagUrt0onpN0FycKAKJjO6SAfvX2LBqgNwKozEVlzl1T/ s9Vqv76p6lkXsKKAOVsE59D6OpMKwwok1KoQzTw8XFapcSP+mAzjfI8xm5fcOC3dB2vu rLDTS3rwAg3K3ieDN/9oRA5mvtSz0Rta7SqDD3lZP06tgsiEXfQttnjJxFI68B3sse5m Xz0w== X-Gm-Message-State: AOAM531iNER/b1KCkkj7a3KP/a7CczdH+4ktK+xxqLDYz+Oz+FTvHsNj 8DzFm0C+vuWIr6zQtnrbA8K30K52uaY9xw== X-Google-Smtp-Source: ABdhPJxAz9hwOKHZo0dZGR+47buoplpfHdmX4/4cdC4Xr4nfdWmH0p1b67t/Jda0hk5bk9zUDdVCfg== X-Received: by 2002:a5d:4ccc:: with SMTP id c12mr20495776wrt.453.1639223283025; Sat, 11 Dec 2021 03:48:03 -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 d188sm1873129wmd.3.2021.12.11.03.48.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Dec 2021 03:48:02 -0800 (PST) Date: Sat, 11 Dec 2021 11:48:01 +0000 (GMT) From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Andrew Burgess Subject: [PATCH 6/6] Add `set print array-indexes' 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=-0.8 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_10_SHORT_WORD_LINES, 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:48:07 -0000 Add `set print array-indexes' tests for C/C++ arrays, complementing one for Fortran arrays. --- gdb/testsuite/gdb.base/array-indices.exp | 174 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.cp/array-indices.exp | 176 +++++++++++++++++++++++++++++++ 2 files changed, 350 insertions(+) gdb-set-print-array-indexes-test.diff Index: src/gdb/testsuite/gdb.base/array-indices.exp =================================================================== --- /dev/null +++ src/gdb/testsuite/gdb.base/array-indices.exp @@ -0,0 +1,174 @@ +# 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 printing of element indices in C arrays. + +standard_testfile array-repeat.c + +if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug}]} { + return -1 +} + +gdb_test_no_output "set print array-indexes on" + +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 n0 {[0]} +set n1 {[1]} +set n2 {[2]} +set n3 {[3]} +set n4 {[4]} +set n5 {[5]} +set a9p9o "{$n0 = 9, $n1 = 9, $n2 = 9, $n3 = 9, $n4 = 9, $n5 = 9}" +set a1p "{$n0 = 1, $n1 = 1, $n2 = 1, $n3 = 1, $n4 = 1}" +set a1p9 "{$n0 = 1, $n1 = 1, $n2 = 1, $n3 = 1, $n4 = 1, $n5 = 9}" +set a2po "{$n0 = 2, $n1 = 2, $n2 = 2, $n3 = 2, $n4 = 2}" +set a2p "{$n0 = ${a2po}, $n1 = ${a2po}, $n2 = ${a2po}, $n3 = ${a2po},\ + $n4 = ${a2po}}" +set a2p9o "{$n0 = 2, $n1 = 2, $n2 = 2, $n3 = 2, $n4 = 2, $n5 = 9}" +set a2p9 "{$n0 = ${a2p9o}, $n1 = ${a2p9o}, $n2 = ${a2p9o}, $n3 = ${a2p9o},\ + $n4 = ${a2p9o}, $n5 = ${a9p9o}}" +set a3po "{$n0 = 3, $n1 = 3, $n2 = 3, $n3 = 3, $n4 = 3}" +set a3p "{$n0 = ${a3po}, $n1 = ${a3po}, $n2 = ${a3po}, $n3 = ${a3po},\ + $n4 = ${a3po}}" +set a3p "{$n0 = ${a3p}, $n1 = ${a3p}, $n2 = ${a3p}, $n3 = ${a3p},\ + $n4 = ${a3p}}" +set a3p9o "{$n0 = 3, $n1 = 3, $n2 = 3, $n3 = 3, $n4 = 3, $n5 = 9}" +set a3p9 "{$n0 = ${a3p9o}, $n1 = ${a3p9o}, $n2 = ${a3p9o}, $n3 = ${a3p9o},\ + $n4 = ${a3p9o}, $n5 = ${a9p9o}}" +set a9p9 "{$n0 = ${a9p9o}, $n1 = ${a9p9o}, $n2 = ${a9p9o}, $n3 = ${a9p9o},\ + $n4 = ${a9p9o}, $n5 = ${a9p9o}}" +set a3p9 "{$n0 = ${a3p9}, $n1 = ${a3p9}, $n2 = ${a3p9}, $n3 = ${a3p9},\ + $n4 = ${a3p9}, $n5 = ${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 "{$n0 = 1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{$n0 = 1 ${rep5}, $n5 = 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}} ${rep5},\ + $n5 = {$n0 = {$n0 = 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 "{$n0 = 1, $n1 = 1, $n2 = 1...}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{$n0 = 1, $n1 = 1, $n2 = 1...}"] + gdb_test "print array_2d" \ + [string_to_regexp "{$n0 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n1 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n2 = {$n0 = 2, $n1 = 2, $n2 = 2...}...}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{$n0 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n1 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n2 = {$n0 = 2, $n1 = 2, $n2 = 2...}...}"] + gdb_test "print array_3d" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n1 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n2 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3,\ + $n2 = 3...}...}...}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n1 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n2 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3,\ + $n2 = 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 "{$n0 = 1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{$n0 = 1 ${rep5}, $n5 = 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}} ${rep5},\ + $n5 = {$n0 = {$n0 = 9 ${rep6}} ${rep6}}}"] +} Index: src/gdb/testsuite/gdb.cp/array-indices.exp =================================================================== --- /dev/null +++ src/gdb/testsuite/gdb.cp/array-indices.exp @@ -0,0 +1,176 @@ +# 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 printing of element indices in C++ arrays. + +if {[skip_cplus_tests]} { continue } + +standard_testfile array-repeat.cc + +if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}]} { + return -1 +} + +gdb_test_no_output "set print array-indexes on" + +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 n0 {[0]} +set n1 {[1]} +set n2 {[2]} +set n3 {[3]} +set n4 {[4]} +set n5 {[5]} +set a9p9o "{$n0 = 9, $n1 = 9, $n2 = 9, $n3 = 9, $n4 = 9, $n5 = 9}" +set a1p "{$n0 = 1, $n1 = 1, $n2 = 1, $n3 = 1, $n4 = 1}" +set a1p9 "{$n0 = 1, $n1 = 1, $n2 = 1, $n3 = 1, $n4 = 1, $n5 = 9}" +set a2po "{$n0 = 2, $n1 = 2, $n2 = 2, $n3 = 2, $n4 = 2}" +set a2p "{$n0 = ${a2po}, $n1 = ${a2po}, $n2 = ${a2po}, $n3 = ${a2po},\ + $n4 = ${a2po}}" +set a2p9o "{$n0 = 2, $n1 = 2, $n2 = 2, $n3 = 2, $n4 = 2, $n5 = 9}" +set a2p9 "{$n0 = ${a2p9o}, $n1 = ${a2p9o}, $n2 = ${a2p9o}, $n3 = ${a2p9o},\ + $n4 = ${a2p9o}, $n5 = ${a9p9o}}" +set a3po "{$n0 = 3, $n1 = 3, $n2 = 3, $n3 = 3, $n4 = 3}" +set a3p "{$n0 = ${a3po}, $n1 = ${a3po}, $n2 = ${a3po}, $n3 = ${a3po},\ + $n4 = ${a3po}}" +set a3p "{$n0 = ${a3p}, $n1 = ${a3p}, $n2 = ${a3p}, $n3 = ${a3p},\ + $n4 = ${a3p}}" +set a3p9o "{$n0 = 3, $n1 = 3, $n2 = 3, $n3 = 3, $n4 = 3, $n5 = 9}" +set a3p9 "{$n0 = ${a3p9o}, $n1 = ${a3p9o}, $n2 = ${a3p9o}, $n3 = ${a3p9o},\ + $n4 = ${a3p9o}, $n5 = ${a9p9o}}" +set a9p9 "{$n0 = ${a9p9o}, $n1 = ${a9p9o}, $n2 = ${a9p9o}, $n3 = ${a9p9o},\ + $n4 = ${a9p9o}, $n5 = ${a9p9o}}" +set a3p9 "{$n0 = ${a3p9}, $n1 = ${a3p9}, $n2 = ${a3p9}, $n3 = ${a3p9},\ + $n4 = ${a3p9}, $n5 = ${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 "{$n0 = 1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{$n0 = 1 ${rep5}, $n5 = 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}} ${rep5},\ + $n5 = {$n0 = {$n0 = 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 "{$n0 = 1, $n1 = 1, $n2 = 1...}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{$n0 = 1, $n1 = 1, $n2 = 1...}"] + gdb_test "print array_2d" \ + [string_to_regexp "{$n0 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n1 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n2 = {$n0 = 2, $n1 = 2, $n2 = 2...}...}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{$n0 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n1 = {$n0 = 2, $n1 = 2, $n2 = 2...},\ + $n2 = {$n0 = 2, $n1 = 2, $n2 = 2...}...}"] + gdb_test "print array_3d" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n1 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n2 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3,\ + $n2 = 3...}...}...}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n1 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3, $n2 = 3...}...},\ + $n2 = {$n0 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n1 = {$n0 = 3, $n1 = 3, $n2 = 3...},\ + $n2 = {$n0 = 3, $n1 = 3,\ + $n2 = 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 "{$n0 = 1 ${rep5}}"] + gdb_test "print array_1d9" \ + [string_to_regexp "{$n0 = 1 ${rep5}, $n5 = 9}"] + gdb_test "print array_2d" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}} ${rep5}}"] + gdb_test "print array_2d9" \ + [string_to_regexp "{$n0 = {$n0 = 2 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}}"] + gdb_test "print array_3d" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}} ${rep5}} ${rep5}}"] + gdb_test "print array_3d9" \ + [string_to_regexp "{$n0 = {$n0 = {$n0 = 3 ${rep5}, $n5 = 9} ${rep5},\ + $n5 = {$n0 = 9 ${rep6}}} ${rep5},\ + $n5 = {$n0 = {$n0 = 9 ${rep6}} ${rep6}}}"] +}