From: Shuah Khan <skhan@linuxfoundation.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>, Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests: breakpoints: Fix wrong argument of ptrace() when single step
Date: Wed, 3 Feb 2021 11:30:13 -0700 [thread overview]
Message-ID: <f91f1e69-310e-5256-de6e-9bceeaa7b205@linuxfoundation.org> (raw)
In-Reply-To: <1612341547-22225-1-git-send-email-yangtiezhu@loongson.cn>
On 2/3/21 1:39 AM, Tiezhu Yang wrote:
> According to the error message, the first argument of ptrace() should be
> PTRACE_SINGLESTEP instead of PTRACE_CONT when ptrace single step.
>
> Fixes: f43365ee17f8 ("selftests: arm64: add test for unaligned/inexact watchpoint handling")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> tools/testing/selftests/breakpoints/breakpoint_test_arm64.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> index ad41ea6..2f4d4d6 100644
> --- a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> +++ b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> @@ -143,7 +143,7 @@ static bool run_test(int wr_size, int wp_size, int wr, int wp)
> if (!set_watchpoint(pid, wp_size, wp))
> return false;
>
> - if (ptrace(PTRACE_CONT, pid, NULL, NULL) < 0) {
> + if (ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL) < 0) {
> ksft_print_msg(
> "ptrace(PTRACE_SINGLESTEP) failed: %s\n",
> strerror(errno));
>
Right before this it does a set_watchpoint(). PTRACE_CONT is what
makes sense to me. Error might be the one that is incorrect here?
thanks,
-- Shuah
next prev parent reply other threads:[~2021-02-03 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 8:39 [PATCH] selftests: breakpoints: Fix wrong argument of ptrace() when single step Tiezhu Yang
2021-02-03 18:30 ` Shuah Khan [this message]
2021-02-04 2:36 ` Tiezhu Yang
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=f91f1e69-310e-5256-de6e-9bceeaa7b205@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.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