From: Andrew Burgess <aburgess@redhat.com>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: testsuite: show print array-indexes after set in arrayidx.exp
Date: Wed, 24 Nov 2021 10:51:29 +0000 [thread overview]
Message-ID: <20211124105129.GN2514@redhat.com> (raw)
In-Reply-To: <1637737987-12558-1-git-send-email-yangtiezhu@loongson.cn>
* Tiezhu Yang <yangtiezhu@loongson.cn> [2021-11-24 15:13:07 +0800]:
> 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." \
This should be:
"Printing of array indexes is off\\." \
Otherwise the '.' is matching any character.
> + "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." \
Same again here.
OK to apply with these two fixes.
Thanks,
Andrew
> + "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
>
prev parent reply other threads:[~2021-11-24 10:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 7:13 Tiezhu Yang
2021-11-24 10:51 ` Andrew Burgess [this message]
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=20211124105129.GN2514@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yangtiezhu@loongson.cn \
/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).