From: "Eli Zaretskii" <eliz@is.elta.co.il>
To: orjan.friberg@axis.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: Hardware watchpoints; dealing with false triggers?
Date: Thu, 22 Nov 2001 13:19:00 -0000 [thread overview]
Message-ID: <5137-Fri30Nov2001203301+0200-eliz@is.elta.co.il> (raw)
In-Reply-To: <3C07B6FE.BBFA048D@axis.com> (message from Orjan Friberg on Fri, 30 Nov 2001 17:42:38 +0100)
> Date: Fri, 30 Nov 2001 17:42:38 +0100
> From: Orjan Friberg <orjan.friberg@axis.com>
>
> Maybe I should clarify that I'm not talking about the x86, but a
> hypothetical target whose watchpoint mechanism would function this way.
Yes, I guessed that much.
> > > Now, say a there's a read of wp1's byte 0. The hardware would trigger,
> > > but it would be a false trigger. Gdb would somehow have to find out the
> > > actual address that was read and if it was found to be outside of the
> > > variable's range it would not trigger the watchpoint.
> >
> > You can't do that, at least not with x86 debug registers: when a
> > watchpoint triggers, you don't know what byte of its covered memory was
> > written to. All you know is that memory covered by a specific register
> > was written.
>
> Ok, but say that the actual address is shipped with the register packet
> when the target stops so that gdb in fact knows what address was
> actually read/written. I'm thinking gdb could compare that address with
> the watchpoints, and just send the target on its way if the address is
> outside the watched ranges.
This can be done. The low-level target end is repsonsible to tell
GDB whether a watchpoint triggered, and at what address. So given
enough information from your target, you could write the low-level
watchpoint code to DTRT.
> And this is the key issue: could the interface to the target-specific
> code be extended to handle the concept of "actual watchpoint address"?
We already have this: it's called target_stopped_data_address.
breakpoint.c uses this macro to see which watchpoint, if any,
triggered.
WARNING: multiple messages have this Message-ID
From: "Eli Zaretskii" <eliz@is.elta.co.il>
To: orjan.friberg@axis.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: Hardware watchpoints; dealing with false triggers?
Date: Fri, 30 Nov 2001 10:33:00 -0000 [thread overview]
Message-ID: <5137-Fri30Nov2001203301+0200-eliz@is.elta.co.il> (raw)
Message-ID: <20011130103300.vJNvd3MdicI7U75cL4u2y8MQGw0h593U-84DNYPZOQY@z> (raw)
In-Reply-To: <3C07B6FE.BBFA048D@axis.com>
> Date: Fri, 30 Nov 2001 17:42:38 +0100
> From: Orjan Friberg <orjan.friberg@axis.com>
>
> Maybe I should clarify that I'm not talking about the x86, but a
> hypothetical target whose watchpoint mechanism would function this way.
Yes, I guessed that much.
> > > Now, say a there's a read of wp1's byte 0. The hardware would trigger,
> > > but it would be a false trigger. Gdb would somehow have to find out the
> > > actual address that was read and if it was found to be outside of the
> > > variable's range it would not trigger the watchpoint.
> >
> > You can't do that, at least not with x86 debug registers: when a
> > watchpoint triggers, you don't know what byte of its covered memory was
> > written to. All you know is that memory covered by a specific register
> > was written.
>
> Ok, but say that the actual address is shipped with the register packet
> when the target stops so that gdb in fact knows what address was
> actually read/written. I'm thinking gdb could compare that address with
> the watchpoints, and just send the target on its way if the address is
> outside the watched ranges.
This can be done. The low-level target end is repsonsible to tell
GDB whether a watchpoint triggered, and at what address. So given
enough information from your target, you could write the low-level
watchpoint code to DTRT.
> And this is the key issue: could the interface to the target-specific
> code be extended to handle the concept of "actual watchpoint address"?
We already have this: it's called target_stopped_data_address.
breakpoint.c uses this macro to see which watchpoint, if any,
triggered.
next prev parent reply other threads:[~2001-11-30 18:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-29 6:25 Orjan Friberg
2001-11-19 11:58 ` Orjan Friberg
2001-11-19 12:06 ` Eli Zaretskii
2001-11-29 7:01 ` Eli Zaretskii
2001-11-30 8:44 ` Orjan Friberg
2001-11-21 17:14 ` Orjan Friberg
2001-11-22 13:19 ` Eli Zaretskii [this message]
2001-11-30 10:33 ` Eli Zaretskii
2001-12-04 3:09 ` Orjan Friberg
2001-12-04 3:43 ` Eli Zaretskii
2001-12-04 5:51 ` Orjan Friberg
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=5137-Fri30Nov2001203301+0200-eliz@is.elta.co.il \
--to=eliz@is.elta.co.il \
--cc=gdb-patches@sources.redhat.com \
--cc=orjan.friberg@axis.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