From: pinskia@gmail.com
To: Yufeng Zhang <Yufeng.Zhang@arm.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Marcus Shawcroft <Marcus.Shawcroft@arm.com>
Subject: Re: [PATCH, AArch64] Fix bug in hardware watchpoint/breakpoint handling
Date: Thu, 19 Dec 2013 07:00:00 -0000 [thread overview]
Message-ID: <430CEAB7-7F7B-430D-9C37-75F87D1F65AC@gmail.com> (raw)
In-Reply-To: <52B1C84F.4000102@arm.com>
> On Dec 18, 2013, at 8:07 AM, Yufeng Zhang <Yufeng.Zhang@arm.com> wrote:
>
> Hi,
>
> This patch fixes an AArch64 GDB bug in handling the hardware debug registers. GDB calls ptrace to set hardware debug registers and it passes a full-length "struct user_hwdebug_state" variable regardless of the number of hardware debug registers available on a target. When there are fewer than 16 (the maximum number) hardware breakpoint/watchpoint registers on a target, the kernel will complain about the gdb's request to set non-existing hardware debug registers. There will be an warning of "Unexpected error setting hardware debug registers" when the inferior starts to run.
>
> This patch fixes the issue by setting iov.iov_len with a value reflecting the exact size in use.
>
> OK for the mainline?
I think this patch is wrong as the size that is passed is always just one element as sizeof (regs.dbg_regs [count - 1]) is the same as sizeof (regs.dbg_regs [0]). This should have been sizeof (regs.dbg_regs [0])*count instead.
Thanks,
Andrew Pinski
>
> Thanks.
> Yufeng
>
>
> 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.
> <patch>
next prev parent reply other threads:[~2013-12-19 7:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 16:07 Yufeng Zhang
2013-12-18 16:24 ` Pedro Alves
2013-12-19 7:00 ` pinskia [this message]
2013-12-19 10:16 ` Marcus Shawcroft
2013-12-19 10:23 ` pinskia
2013-12-19 10:26 ` Marcus Shawcroft
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=430CEAB7-7F7B-430D-9C37-75F87D1F65AC@gmail.com \
--to=pinskia@gmail.com \
--cc=Marcus.Shawcroft@arm.com \
--cc=Yufeng.Zhang@arm.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