Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa:breakpoint] Correctly count watchpoints
Date: Mon, 30 Sep 2002 09:34:00 -0000	[thread overview]
Message-ID: <3D987D2D.6010605@redhat.com> (raw)
In-Reply-To: <Pine.SUN.3.91.1020930073410.25050J-100000@is>

> On Sun, 29 Sep 2002, Andrew Cagney wrote:
> 
> 
>> (per earlier post) An expression like:
>> 
>> 	a + b
>> 
>> requires two watchpoint resources (&a and &b).
> 
> 
> What do you mean by ``watchpoint resources''?  On a i386, watching &a 
> might require much more than a single debug register, depending on a's 
> size and alignment.

At this point I'm trying desperatly to not define it :-) Each watch 
element / location / value in the watchpoint expression is assumed to 
consume one watch resource.

Anyway, the problem you refer to is why I was thinking of re-defining 
TARGET_REGION_OK_FOR_HW_WATCHPOINT() so that it returns the number of 
watchpoint resources required to watch addr/len.  If {&a, sizeof a} 
required two registers it could return two.

Such a model is obviously simple and will be sub-optimal in many 
situtations.  I think its sufficient though.

A more complete model would involve extending/generalizing what Marko 
Mlinar has implemented for the opencore:
http://sources.redhat.com/ml/gdb/2002-09/msg00308.html

>> When first creating the 
>> watchpoint, gdb correctly counts this as two.  However,  when GDB goes 
>> back to compute the number of watchpoints already used, it does a 
>> re-count and treats the above (and any watchpoint expression) as only one.
>> 
>> The attached, I belive, fixes this by saving the mem_cnt that was computed.
> 
> 
> I agree that the count should at least be consistent.
> 
> 
>> One thing I wonder about though, should ``info breakpoints'' or ``maint 
>> info breakpoints'' display this info?
> 
> 
> Only if it's useful.  Could you please make a concrete suggestion as to 
> what should be printed about this information?

I think it would be helpful if, at least in maintainer mode, the user 
could see how many resources have been allocated to a watchpoint.  That 
way (as well as letting me check its working :-) the user would be in a 
better position to figure out where, exactly, all their watchpoints have 
gone.

>> Ok?
> 
> 
> Fine with me.

(I've a sinking feeling that hardware breakpoints have the same problem 
...).

Andrew



  reply	other threads:[~2002-09-30 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-29 20:34 Andrew Cagney
2002-09-29 22:40 ` Eli Zaretskii
2002-09-30  9:34   ` Andrew Cagney [this message]
2002-09-30 11:26     ` Eli Zaretskii
2002-09-30 12:42       ` Andrew Cagney
     [not found] <3D98A393.6010801@redhat.com>
2002-09-30 21:54 ` Eli Zaretskii
2002-09-30 23:00   ` Andrew Cagney
2002-10-01 11:23     ` Eli Zaretskii

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=3D987D2D.6010605@redhat.com \
    --to=ac131313@redhat.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.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