Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Omair Javaid <omair.javaid@linaro.org>
Cc: Yao Qi <yao@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Support for HWbreak/watchpoint accross fork/vfork on arm-native
Date: Thu, 13 Feb 2014 18:40:00 -0000	[thread overview]
Message-ID: <52FD117B.8060401@redhat.com> (raw)
In-Reply-To: <52FB95D3.5000207@linaro.org>

> +static int
> +update_registers_callback (struct lwp_info *lwp, void *arg)
> +{
> +  struct update_registers_data *data = (struct update_registers_data *) arg;
> +
> +  /* Force iterate_over_lwps to return matched lwp_info*.  */
> +  if (arg == NULL)
> +    return 1;
> +

You don't seem to have addressed my comment here?  It was:

"I don't understand this.  It seems nothing passes a NULL arg."


>    if (watchpoint)
>      {
>        count = arm_linux_get_hw_watchpoint_count ();
> -      bpts = t->wpts;
> -      dir = -1;
> +      bpts = arm_linux_get_debug_reg_state (pid)->wpts;
> +      if (count > MAX_WPTS)
> +        warning (_("arm-linux-gdb supports %d hardware watchpoints but target \
> +                 supports %d"), MAX_WPTS, count);

Like in the Aarch64 port, add a 'count = MAX_WPTS' as well, otherwise
GDB would access the arrays out of bounds when that happens.

>      }
>    else
>      {
>        count = arm_linux_get_hw_breakpoint_count ();
> -      bpts = t->bpts;
> -      dir = 1;
> +      bpts = arm_linux_get_debug_reg_state (pid)->bpts;
> +      if (count > MAX_BPTS)
> +        warning (_("arm-linux-gdb supports %d hardware breakpoints but target \
> +                 supports %d"), MAX_BPTS, count);

Likewise.

>      }
>  
>    for (i = 0; i < count; ++i)
>      if (!arm_hwbp_control_is_enabled (bpts[i].control))

-- 
Pedro Alves


  parent reply	other threads:[~2014-02-13 18:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 22:12 Omair Javaid
2014-01-30 22:23 ` Omair Javaid
2014-02-07 15:32   ` Pedro Alves
2014-02-08  0:49   ` Yao Qi
2014-02-12 15:40     ` Omair Javaid
2014-02-13  5:05       ` Yao Qi
2014-02-13 18:40       ` Pedro Alves [this message]
2014-02-14  0:06         ` Omair Javaid
2014-03-08 16:29           ` Omair Javaid
2014-03-10 15:13             ` Pedro Alves

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=52FD117B.8060401@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=omair.javaid@linaro.org \
    --cc=yao@codesourcery.com \
    /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