Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Cc: Ulrich Weigand <uweigand@de.ibm.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: Tue, 13 Sep 2011 14:54:00 -0000	[thread overview]
Message-ID: <201109131542.14795.pedro@codesourcery.com> (raw)
In-Reply-To: <4E6F6A30.2040101@linux.vnet.ibm.com>

On Tuesday 13 September 2011 15:35:28, Edjunior Barbosa Machado wrote:
> On 09/13/2011 09:55 AM, Pedro Alves wrote:

> > Can you expand on this?  I don't think I'm understanding that problem.
> 
> The problem of setting watches before run the inferior occurs because
> update_watchpoint() expect that the watchpoint being parsed shouldn't be
> in the breakpoint_chain.
> 
> When you adds the watchpoint it passes through update_watchpoint() the
> first time without reparsing it, but it adds the watch to the
> breakpoint_chain right after (in install_breakpoint()). Then, after
> start the inferior, when running update_watchpoint() again,
> hw_watchpoint_used_count() will count this watch previously added and
> reparse will not evaluate the available resources properly.
> Moreover, I've noticed it doesn't occur on x86 since
> target_can_use_hardware_watchpoint() (i386_can_use_hw_breakpoint())
> always returns 1, but affects archs such as ppc64. This problem in
> specific can be seen on gdb.base/watchpoint-hw.exp testcase.
> 
> By the way, had the chance to retest your new patch on ppc64 and it
> seems to fix several issues related to watchpoints, including the
> failure pointed by gdb.base/watchpoint-hw.exp.

Ah, okay.  I thought you were describing some other problem.  That
happens if we just always added the current watchpoint's resources
in addition to the resources of the watchpoints already listed, because
we would count the same breakpoint twice in some paths.

Waiting on Ulrich (or anyone else) to comment then.

-- 
Pedro Alves


  reply	other threads:[~2011-09-13 14:42 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
2011-09-13 14:16     ` Pedro Alves
2011-09-13 14:42       ` Edjunior Barbosa Machado
2011-09-13 14:54         ` Pedro Alves [this message]
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=201109131542.14795.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=emachado@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --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