public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: testsuite: show print array-indexes after set in arrayidx.exp
@ 2021-11-24  7:13 Tiezhu Yang
  2021-11-24 10:51 ` Andrew Burgess
  0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2021-11-24  7:13 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdb: testsuite: show print array-indexes after set in arrayidx.exp
  2021-11-24  7:13 [PATCH] gdb: testsuite: show print array-indexes after set in arrayidx.exp Tiezhu Yang
@ 2021-11-24 10:51 ` Andrew Burgess
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Burgess @ 2021-11-24 10:51 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: gdb-patches

* 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
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-24 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24  7:13 [PATCH] gdb: testsuite: show print array-indexes after set in arrayidx.exp Tiezhu Yang
2021-11-24 10:51 ` Andrew Burgess

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).