Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Klee Dienes <klee@apple.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Compare contents when evaluating an array watchpoint
Date: Sun, 06 Oct 2002 23:12:00 -0000	[thread overview]
Message-ID: <C66935B8-D9BB-11D6-9563-00039396EEB8@apple.com> (raw)
In-Reply-To: <Pine.SUN.3.91.1021007075212.6644A-100000@is>

There's two phases to the process by which GDB handles watchpoints,  a 
"trigger" phase, where GDB causes itself to be stopped in any 
circumstance where the watchpoint might have been changed (either by 
hardware registers, page-protections, or single-stepping), and a 
"compare" phase, where it checks the value of the data being watched to 
see if it has actually changed.  My patch doesn't change the behavior 
of the trigger phase at all --- this phase has always set the trigger 
to watch the entire contents of the array.

My patch changes only the "compare" phase, by causing it to actually 
compare the contents of the array.  The one performance implication I 
can think of is that watching large arrays could be unpleasant on 
systems that can only do breakpoints via single-stepping (whereas 
before it would have been impossible, so I'm not overly concerned).

On Monday, October 7, 2002, at 01:53 AM, Eli Zaretskii wrote:
>
> On Sun, 6 Oct 2002, Klee Dienes wrote:
>
>> The following patch allows one to set watchpoints on arrays, and have
>> the watchpoint triggered if any element in the array changes.  Without
>> the patch, the C value_equal semantics causes the address of the array
>> to be checked for change, not the contents --- resulting in a
>> watchpoint that can never be hit.
>>
>> This is particularly useful if one wants to do commands like watch
>> {char[80]} 0xfff0000, or similar, in order to watch an arbitrary 
>> region
>> of memory.
>
> What will this do to hardware watchpoints on arrays/array elements?  On
> many platforms, hardware watchpoints have size limitations, so large
> arrays cannot be watched in their entirety.


  reply	other threads:[~2002-10-07  6:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-06  2:16 Klee Dienes
2002-10-06 22:53 ` Eli Zaretskii
2002-10-06 23:12   ` Klee Dienes [this message]
2002-10-07  7:26     ` Eli Zaretskii
2002-10-07 11:50       ` Klee Dienes
2002-10-09 12:42         ` Eli Zaretskii
2002-10-21 17:44     ` Andrew Cagney
2002-11-04 18:27       ` [RFA] " Klee Dienes
2002-11-18  9:52       ` [PATCH] " Jim Blandy
2003-01-08  0:46 ` Andrew Cagney

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=C66935B8-D9BB-11D6-9563-00039396EEB8@apple.com \
    --to=klee@apple.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