Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: Watchpoint resource accounting broken (Re: [5/6] breakpoints_ops for all kinds of breakpoints: new watchpoints instance type)
Date: Mon, 12 Sep 2011 15:23:00 -0000	[thread overview]
Message-ID: <4E6E2265.8050102@linux.vnet.ibm.com> (raw)
In-Reply-To: <201109121503.p8CF3JCD003396@d06av02.portsmouth.uk.ibm.com>

On 09/12/2011 12:03 PM, Ulrich Weigand wrote:
> However, update_watchpoint relies on having the watchpoint under
> investigation be on the breakpoint list; see the comment:
> 
>               /* We need to determine how many resources are already
>                  used for all other hardware watchpoints plus this one
>                  to see if we still have enough resources to also fit
>                  this watchpoint in as well.  To guarantee the
>                  hw_watchpoint_used_count call below counts this
>                  watchpoint, make sure that it is marked as a hardware
>                  watchpoint.  */
>               if (b->base.type == bp_watchpoint)
>                 b->base.type = bp_hardware_watchpoint;
> 
>               i = hw_watchpoint_used_count (b->base.type, &other_type_used);
>               target_resources_ok = target_can_use_hardware_watchpoint
>                     (b->base.type, i, other_type_used);
> 
> Note how just "i", the result of hw_watchpoint_used_count, is passed to
> target_can_use_hardware_watchpoint -- this works only if the current
> watchpoint is on the list that hw_watchpoint_used_count iterates over.

I noticed this problem too and was considering use "i + reg_cnt" instead
of only "i" when calling hw_watchpoint_used_count() (actually, I saw gdb
used to use this previously).
However, with this change, due to the same problem with the watchpoint
added to breakpoint list that Ulrich mentioned, watchpoints added before
run the inferior will not work.

-- 
Edjunior


  parent reply	other threads:[~2011-09-12 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22 15:58 [5/6] breakpoints_ops for all kinds of breakpoints: new watchpoints instance type Pedro Alves
2011-07-27 10:11 ` Edjunior Barbosa Machado
2011-09-12 15:06 ` Watchpoint resource accounting broken (Re: [5/6] breakpoints_ops for all kinds of breakpoints: new watchpoints instance type) Ulrich Weigand
2011-09-12 15:17   ` Pedro Alves
2011-09-12 15:23   ` Edjunior Barbosa Machado [this message]
2011-09-13 14:16     ` Pedro Alves
2011-09-13 14:42       ` Edjunior Barbosa Machado
2011-09-13 14:54         ` Pedro Alves
2011-09-13 16:49       ` Watchpoint resource accounting broken (Re: [5/6] breakpoints_ops for all kinds of breakpoints: new watchpoints instance type Ulrich Weigand
2011-09-13 17:20         ` 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=4E6E2265.8050102@linux.vnet.ibm.com \
    --to=emachado@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=uweigand@de.ibm.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