From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: gdb-patches@sourceware.org
Subject: [PATCH] gdb: testsuite: show print array-indexes after set in arrayidx.exp
Date: Wed, 24 Nov 2021 15:13:07 +0800 [thread overview]
Message-ID: <1637737987-12558-1-git-send-email-yangtiezhu@loongson.cn> (raw)
Add "show print array-indexes" testcases after set print array-indexes
to off or on.
Without this patch:
PASS: gdb.base/arrayidx.exp: set print array-indexes to off
PASS: gdb.base/arrayidx.exp: print array with array-indexes off
PASS: gdb.base/arrayidx.exp: set print array-indexes to on
PASS: gdb.base/arrayidx.exp: print array with array-indexes on
With this patch:
PASS: gdb.base/arrayidx.exp: set print array-indexes to off
PASS: gdb.base/arrayidx.exp: show print array-indexes is off
PASS: gdb.base/arrayidx.exp: print array with array-indexes off
PASS: gdb.base/arrayidx.exp: set print array-indexes to on
PASS: gdb.base/arrayidx.exp: show print array-indexes is on
PASS: gdb.base/arrayidx.exp: print array with array-indexes on
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
gdb/testsuite/gdb.base/arrayidx.exp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp
index af792ed..b2d52cf 100644
--- a/gdb/testsuite/gdb.base/arrayidx.exp
+++ b/gdb/testsuite/gdb.base/arrayidx.exp
@@ -36,6 +36,10 @@ if ![runto_main] then {
gdb_test_no_output "set print array-indexes off" \
"set print array-indexes to off"
+gdb_test "show print array-indexes" \
+ "Printing of array indexes is off." \
+ "show print array-indexes is off"
+
gdb_test "print array" \
"\\{1, 2, 3, 4\\}" \
"print array with array-indexes off"
@@ -45,6 +49,10 @@ gdb_test "print array" \
gdb_test_no_output "set print array-indexes on" \
"set print array-indexes to on"
+gdb_test "show print array-indexes" \
+ "Printing of array indexes is on." \
+ "show print array-indexes is on"
+
gdb_test "print array" \
"\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
"print array with array-indexes on"
--
2.1.0
next reply other threads:[~2021-11-24 7:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 7:13 Tiezhu Yang [this message]
2021-11-24 10:51 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1637737987-12558-1-git-send-email-yangtiezhu@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).