From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1256) id A252E385B83D; Thu, 7 Jul 2022 11:04:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A252E385B83D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Maciej W. Rozycki To: gdb-cvs@sourceware.org Subject: [binutils-gdb] GDB/testsuite: Add coverage for `print -elements' command X-Act-Checkin: binutils-gdb X-Git-Author: Maciej W. Rozycki X-Git-Refname: refs/heads/master X-Git-Oldrev: 88de583569400f6c81caa6f943d1290d134ea48a X-Git-Newrev: 309e147fbd26a433ec3a1e2cd346633bb615de29 Message-Id: <20220707110429.A252E385B83D@sourceware.org> Date: Thu, 7 Jul 2022 11:04:29 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 11:04:29 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D309e147fbd26= a433ec3a1e2cd346633bb615de29 commit 309e147fbd26a433ec3a1e2cd346633bb615de29 Author: Maciej W. Rozycki Date: Thu Jul 7 12:00:18 2022 +0100 GDB/testsuite: Add coverage for `print -elements' command =20 We currently have no coverage for the `print -elements ...' command (or `p -elements ...' in the shortened form), so add a couple of test cases mimicking ones using corresponding `set print elements ...' values. Diff: --- gdb/testsuite/gdb.base/printcmds.exp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/= printcmds.exp index 0a99f3d6f27..60b9de47e52 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -536,6 +536,15 @@ proc test_print_strings {} { gdb_test "p teststring" \ " =3D (.unsigned char .. )?\"teststring contents\"" "p teststring with el= ements set to 20" =20 + gdb_test "p -elements 1 -- teststring" \ + " =3D (.unsigned char .. )?\"t\"\\.\\.\\." + gdb_test "p -elements 5 -- teststring" \ + " =3D (.unsigned char .. )?\"tests\"\\.\\.\\." + gdb_test "p -elements 19 -- teststring" \ + " =3D (.unsigned char .. )?\"teststring contents\"" + gdb_test "p -elements 20 -- teststring" \ + " =3D (.unsigned char .. )?\"teststring contents\"" + gdb_test "print teststring2" \ " =3D \\(charptr\\) \"more contents\""