All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: ptrace: fix setting hw breakpoint/watchpoint
Date: Fri, 16 May 2014 14:44:20 +0100	[thread overview]
Message-ID: <20140516134420.GG12341@arm.com> (raw)
In-Reply-To: <1399290685-6336-1-git-send-email-catalin.udma@freescale.com>

On Mon, May 05, 2014 at 12:51:25PM +0100, Catalin Udma wrote:
> When setting hw breakpoints/watchpoints, GDB reports the error
> "Unexpected error setting hardware debug registers". The problem is
> reproducible on A53/A57 models where the supported number of
> breakpoints/watchpoints (6 or 4 read from ID_AA64DFR0_EL1) it is
> less than the maximum number of debug registers from user_hwdebug_state
> 
> This patch fixes the problem by restricting the registers access to the
> maximum number of supported breakpoints/watchpoints

Actually, I consider this to be a bug in GDB. It shouldn't be trying to
access registers that don't exist (we tell it the number of registers
available as part of the 32-bit info register).

I also think this has been fixed in GDB upstream:


  commit f45c82da381e0ce5ce51b7fb24d0d28611d266b8
  Author: Yufeng Zhang <yufeng.zhang@arm.com>
  Date:   Wed Dec 18 16:47:33 2013 +0000

      gdb/

          * aarch64-linux-nat.c (aarch64_linux_set_debug_regs): Set
          iov.iov_len with the real length in use.

      gdb/gdbserver/

          * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
          iov.iov_len with the real length in use.


so there's no need to change the kernel for this.

Will

  reply	other threads:[~2014-05-16 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 11:51 [PATCH] arm64: ptrace: fix setting hw breakpoint/watchpoint Catalin Udma
2014-05-16 13:44 ` Will Deacon [this message]
2014-05-16 14:35   ` catalin.udma at freescale.com
2014-05-16 16:21     ` Will Deacon
2014-05-19  8:24       ` catalin.udma at freescale.com

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=20140516134420.GG12341@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.