This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH/AARCH64] Fix hardware break points
- From: Will Newton <will dot newton at linaro dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, Andreas Schwab <schwab at linux-m68k dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 16 Sep 2013 13:53:12 +0100
- Subject: Re: [PATCH/AARCH64] Fix hardware break points
- Authentication-results: sourceware.org; auth=none
- References: <CA+=Sn1mFs3=aY70af9xWomP-t6-kfsgzXr83xRBuXdofoZVMsQ at mail dot gmail dot com> <87k3kbbsbz dot fsf at igel dot home> <CA+=Sn1k=30-Y=MFEq3gVcDR9xugWsMWpHi8_a79hCUX6vxjEEw at mail dot gmail dot com> <CANu=DmjNqWDGFQY9bB9KbY0L1U6eJ58CooAQoOinGsCZikM5yA at mail dot gmail dot com> <CA+=Sn1kwQNtXFU6EA5X90934qeRGSS8Ryb9DZTbOb9PVoX++5w at mail dot gmail dot com> <5236FD06 dot 9070807 at redhat dot com>
On 16 September 2013 13:43, Pedro Alves <palves@redhat.com> wrote:
> On 09/12/2013 08:15 AM, Andrew Pinski wrote:
>> On Tue, Sep 10, 2013 at 7:37 AM, Will Newton <will.newton@linaro.org> wrote:
>>> On 27 July 2013 23:42, Andrew Pinski <pinskia@gmail.com> wrote:
>>>
>>> Hi Andrew,
>>>
>>>> On Sat, Jul 27, 2013 at 2:34 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>>>>> Andrew Pinski <pinskia@gmail.com> writes:
>>>>>
>>>>>> OK? Built and tested on aarch64-linux-gnu with no regressions.
>>>>>
>>>>> Did you?
>>>>>
>>>>>> + memset (®s, 0, size(regs));
>>>>
>>>> This is what I get for copying and pasting from one source file to another.
>>>>
>>>> Here is the fixed one which was definitely tested.
>>>
>>> What's the status of this patch? It seems like it fixes real problems
>>> people are seeing in the field.
>
>> After not much thought, I decided this was an obvious patch as regs is
>> used uninitialized otherwise when passed to ptrace.
>
> Leaves me wondering what field of regs other than regs.dbg_regs is
> the kernel actually looking at then for NT_ARM_HW_WATCH/NT_ARM_HW_BREAK,
> given regs.dbg_regs _is_ initialized:
The dbg_info field is probably the important one, so it may be
possible to optimize the clearing slightly but I'm not sure if it's
worth it.
> for (i = 0; i < count; i++)
> {
> regs.dbg_regs[i].addr = addr[i];
> regs.dbg_regs[i].ctrl = ctrl[i];
> }
>
> if (ptrace (PTRACE_SETREGSET, tid,
> watchpoint ? NT_ARM_HW_WATCH : NT_ARM_HW_BREAK,
> (void *) &iov))
>
> Makes me wonder whether the issue is that "count" isn't right for
> the running kernel.
>
> Was a patch for gdbserver ever posted/committed? AFAICS,
> gdbserver's aarch64_linux_set_debug_regs is an exact copy of gdb's.
I posted a patch for that here:
https://sourceware.org/ml/gdb-patches/2013-09/msg00381.html
--
Will Newton
Toolchain Working Group, Linaro