From: Luis Machado <luis.machado@arm.com>
To: "Alexandra Hájková" <ahajkova@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb.base/watchpoint-unaligned.exp: Always initialize wpoffset_to_wpnum
Date: Tue, 2 May 2023 12:34:59 +0100 [thread overview]
Message-ID: <291240a9-a10c-ea4e-daf8-72e3d64aa3ad@arm.com> (raw)
In-Reply-To: <20230425104732.126979-1-ahajkova@redhat.com>
Hi,
On 4/25/23 11:47, Alexandra Hájková via Gdb-patches wrote:
> to avoid TCL error which happens in some aarch64 types.
>
> ERROR: in testcase /root/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
> ERROR: can't read "wpoffset_to_wpnum(1)": no such element in array
> ERROR: tcl error code TCL READ VARNAME
> ERROR: tcl error info:
> can't read "wpoffset_to_wpnum(1)": no such element in array
> while executing
>
> Fixes bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30340
> ---
> The test uses gdb_test_multiple, and there are plenty of other reasons (see gdb_test_multiple in lib/gdb.exp) that a test using gdb_test_multiple might fail. We're never going to recreate each of those in the gdb.base/watchpoint-unaligned.exp script just so that we can ensure the variable is initialized. Instead we should just ensure the variable is always initialized.
>
> gdb/testsuite/gdb.base/watchpoint-unaligned.exp | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
> index ce5a1e5bf66..d31a9cdc2c8 100644
> --- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
> +++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
> @@ -103,6 +103,8 @@ foreach wpcount {4 7} {
> for {set wpoffset 1} {$wpoffset <= $wpcount} {incr wpoffset} {
> set test "$rwatch data.u.size1\[$wpoffset\]"
> set wpnum ""
> + # Initialize the result incase the test fails.
> + set wpoffset_to_wpnum($wpoffset) 0
> gdb_test_multiple $test $test {
> -re "$rwatch_exp (\[0-9\]+): .*\r\n$gdb_prompt $" {
> set wpoffset_to_wpnum($wpoffset) $expect_out(1,string)
> @@ -113,7 +115,6 @@ foreach wpcount {4 7} {
> setup_xfail breakpoints/23131 "arm*-*-*"
> }
> fail $test
> - set wpoffset_to_wpnum($wpoffset) 0
> }
> }
> }
Thanks. I think this approach is a reasonable one.
Reviewed-by: Luis Machado <luis.machado@arm.com>
next prev parent reply other threads:[~2023-05-02 11:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 21:08 [PATCH] gdb.base/watchpoint-unaligned.exp: Fix TCL error Alexandra Hájková
2023-04-13 13:55 ` Luis Machado
2023-04-25 10:47 ` [PATCH v2] gdb.base/watchpoint-unaligned.exp: Always initialize wpoffset_to_wpnum Alexandra Hájková
2023-05-02 11:34 ` Luis Machado [this message]
2023-05-02 13:50 ` Andrew Burgess
2023-05-02 14:53 ` Tom Tromey
2023-05-05 16:23 ` 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=291240a9-a10c-ea4e-daf8-72e3d64aa3ad@arm.com \
--to=luis.machado@arm.com \
--cc=ahajkova@redhat.com \
--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).