This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/AARCH64] Fix hardware break points

On 09/12/2013 08:15 AM, Andrew Pinski wrote:
> On Tue, Sep 10, 2013 at 7:37 AM, Will Newton <> wrote:
>> On 27 July 2013 23:42, Andrew Pinski <> wrote:
>> Hi Andrew,
>>> On Sat, Jul 27, 2013 at 2:34 PM, Andreas Schwab <> wrote:
>>>> Andrew Pinski <> writes:
>>>>> OK?  Built and tested on aarch64-linux-gnu with no regressions.
>>>> Did you?
>>>>> +  memset (&regs, 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:

  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.

Pedro Alves

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]