From: Pedro Alves <pedro@palves.net>
To: Matthew Malcomson <matthew.malcomson@arm.com>,
Alan Hayward <Alan.Hayward@arm.com>
Cc: nd <nd@arm.com>, gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [Patch] GDB: aarch64: Add ability to step over a BR/BLR instruction
Date: Thu, 23 Jul 2020 19:58:39 +0100 [thread overview]
Message-ID: <3d86bcb9-dedd-6eb2-7cff-e8349d4b20da@palves.net> (raw)
In-Reply-To: <AM6PR08MB315727827E8293B3542136AEE0760@AM6PR08MB3157.eurprd08.prod.outlook.com>
On 7/23/20 5:48 PM, Matthew Malcomson wrote:
> +
> +# Test for displaced stepping over the BLR instruction.
> +gdb_test "run" \
> + "Starting program.*Breakpoint $decimal.*" \
> + "Run until BLR test start"
> +
Please don't use "run" directly. Use one of runto, runto_main,
gdb_run_cmd instead. See amd64-disp-step.exp for example.
If you use "run" directly, then the testcase won't run against
gdbserver. Please make sure this passes cleanly:
$ make check \
RUNTESTFLAGS="--target_board=native-gdbserver" \
TESTS="gdb.arch/aarch64-disp-stepping.exp"
> +set expected_lr [get_hexadecimal_valueof "\$pc + 4" 0]
> +gdb_test "print/x \$x0" \
> + ".. = 0x0" \
> + "Ensure x0 is 0 before BLR test."
The ".." at the start of the pattern are not necessary,
gdb_test will match anything that appears before your
pattern anyway.
Use lowercase, and no period at end. Throughout.
"Ensure" is redundant, IMHO. Every test is ensuring something.
So, I'd write:
gdb_test "print/x \$x0" \
" = 0x0" \
"x0 is 0 before BLR test"
> +gdb_test "print/x \$lr == $expected_lr" \
> + ".. = 0x1" \
> + "Ensure LR is set to just after BLR."
Is set to ... ?
Please cat the testsuite/gdb.sum file after running
your testcase in isolation and skim it to make sure
it all makes sense.
You can also use
with_test_prefix "BLR" {
...
}
with_test_prefix "BR" {
...
}
to group tests.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2020-07-23 18:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 14:55 Matthew Malcomson
2020-07-03 15:36 ` Luis Machado
2020-07-03 16:06 ` Alan Hayward
2020-07-20 11:13 ` Matthew Malcomson
2020-07-23 16:13 ` Alan Hayward
2020-07-23 16:48 ` Matthew Malcomson
2020-07-23 18:58 ` Pedro Alves [this message]
2020-08-20 12:41 ` Matthew Malcomson
2021-01-25 18:31 ` Matthew Malcomson via Gdb-patches
2021-01-25 18:44 ` Luis Machado via Gdb-patches
2021-01-26 11:13 ` Matthew Malcomson via Gdb-patches
2021-01-26 11:46 ` Luis Machado via Gdb-patches
2021-01-27 16:42 ` [Patch] GDB: aarch64: Add ability to displaced " Matthew Malcomson via Gdb-patches
2021-01-27 17:02 ` Luis Machado via Gdb-patches
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=3d86bcb9-dedd-6eb2-7cff-e8349d4b20da@palves.net \
--to=pedro@palves.net \
--cc=Alan.Hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=matthew.malcomson@arm.com \
--cc=nd@arm.com \
/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