public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Luis Gustavo <luis_gustavo@mentor.com>
To: Xin Tong <xerox.time.tech@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Hardware watchpoint for read
Date: Tue, 24 Apr 2012 13:18:00 -0000	[thread overview]
Message-ID: <4F96A812.4000008@mentor.com> (raw)
In-Reply-To: <CALKntY2EC1CUsO=Eavfh23WtQFsJCt8ANEhddL9Deeuyiw+iug@mail.gmail.com>

On 04/24/2012 10:15 AM, Xin Tong wrote:
> On Tue, Apr 24, 2012 at 9:09 AM, Luis Gustavo<luis_gustavo@mentor.com>  wrote:
>> Hi,
>>
>>
>> On 04/24/2012 10:02 AM, Xin Tong wrote:
>>>
>>> Hello
>>>
>>> I am wondering that can gdb insert hardware watch point for read to
>>> the watched memory ? can other debugger do that ? is it supported in
>>> hardware watchpoint ?
>>>
>>> Thanks
>>>
>>> Xin
>>>
>>
>> Read watchpoints are hard to implement as soft-watchpoints, so they're
>> usually implemented as hardware watchpoints.
>
> software write watchpoint is easier to implement ? do not software
> watchpoint need to watch all memory accesses (read and write) to a
> memory location in software ?

Writes are "easier" to implemenet due to the fact that they usually 
change memory contents. Reads don't.

>
>>
>> If a debugger knows how to properly set the bits in the hardware, either
>> through ptrace or other means, it can configure a read/write/read-write
>> watchpoint. Depends on hardware support really.
>
> do you know whether this is supported on the x86 chips ? is thee a way
> to try this out in gdb ?

All those modes should be supported in x86. Try "watch", "rwatch" and 
"awatch".

>
>>
>> Regards,
>> Luis

  reply	other threads:[~2012-04-24 13:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 13:03 Xin Tong
2012-04-24 13:09 ` Luis Gustavo
2012-04-24 13:16   ` Xin Tong
2012-04-24 13:18     ` Luis Gustavo [this message]
2012-04-24 14:18       ` Xin Tong
2012-04-24 14:20         ` Luis Gustavo
2012-04-24 15:06           ` Xin Tong
2012-04-24 15:11             ` Luis Gustavo
2012-04-25  1:15               ` Xin Tong
2012-04-25 11:51                 ` Luis Gustavo
2012-05-03 19:19                   ` Philippe Waroquiers
2012-05-03 19:41                     ` Xin Tong
2012-05-03 21:18                       ` Philippe Waroquiers

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=4F96A812.4000008@mentor.com \
    --to=luis_gustavo@mentor.com \
    --cc=gdb@sourceware.org \
    --cc=xerox.time.tech@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).