From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: ptrace: hw_break_set take into account hardware breakpoints number
Date: Mon, 29 Sep 2014 11:16:27 +0100 [thread overview]
Message-ID: <20140929101626.GE20303@arm.com> (raw)
In-Reply-To: <1411977842-16515-2-git-send-email-victor.kamensky@linaro.org>
Hi Victor,
On Mon, Sep 29, 2014 at 09:04:02AM +0100, Victor Kamensky wrote:
> hw_break_set function that performs ptrace_regset for hardware
> breakpoints and watchpoints needs to take into account actual
> number of hardware breakpoints and watchpoints available in CPU.
>
> Current code iterates over all 16 entries of 'struct user_hwdebug_state'
> and tries to reserve hardware breakpoint for each index, which fails
> if CPU supports less than 16 hardware breakpoints. One manifestation of
> the issue is that gdb fails to debug multithreaded user land application
> and exits with 'Unexpected error setting hardware debug registers'
> error - ptrace system call for hardware breakpoints regset fails with
> ENOSPC.
When does this happen? hw_break_set is driven by userspace, so if GDB is
asking for more registers than we actually have, then this is a GDB bug and
the kernel is doing the right thing.
Have you reproduced this with the latest version of GDB?
Will
next prev parent reply other threads:[~2014-09-29 10:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 8:04 [PATCH] arm64: ptrace: hw_break_set take into account hardware breakpoints number Victor Kamensky
2014-09-29 8:04 ` Victor Kamensky
2014-09-29 10:16 ` Will Deacon [this message]
2014-09-29 17:49 ` Victor Kamensky
2014-10-01 14:24 ` Christopher Covington
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=20140929101626.GE20303@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 NNTP newsgroup(s).