* Adding watchpoint functions to target vector vs. TARGET*WATCHPOINT macros
@ 2008-09-09 5:19 David Daney
2008-09-09 12:17 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: David Daney @ 2008-09-09 5:19 UTC (permalink / raw)
To: gdb
In working on adding hardware watch register support to mips*-linux, I
have encountered a small issue.
Back in:
http://sourceware.org/ml/gdb-patches/2008-04/msg00443.html
Daniel pointed out that all the watch related functions could be added
directly to the target vector instead of writing target specific
TARGET*WATCHPOINT macros. While this is true, there is a small drawback.
The target vector is not installed until the inferior is started, so any
watches added before this happens end up being soft-watches.
If the various TARGET*WATCHPOINT macros are defined instead, hardware
watchpoints can be added even if the inferior has not been started.
This scares me a little as it seems that they may end up triggering in
the shell that is starting the inferior.
Ideally in when the first resume() is issued to the inferior the
watchpoints would be re-evaluated to see if some (or all) of them could
be converted to hardware watchpoints. There might have to be an
additional target hook to allow for this.
For the short term I think I will stick to adding the watch functions to
the target vector, but I am interested in feedback on the merits of
either re-evaluating the watchpoints or using the TARGET*WATCHPOINT macros
Thanks,
David Daney
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Adding watchpoint functions to target vector vs. TARGET*WATCHPOINT macros
2008-09-09 5:19 Adding watchpoint functions to target vector vs. TARGET*WATCHPOINT macros David Daney
@ 2008-09-09 12:17 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2008-09-09 12:17 UTC (permalink / raw)
To: David Daney; +Cc: gdb
On Mon, Sep 08, 2008 at 10:18:49PM -0700, David Daney wrote:
> Daniel pointed out that all the watch related functions could be added
> directly to the target vector instead of writing target specific
> TARGET*WATCHPOINT macros. While this is true, there is a small drawback.
>
> The target vector is not installed until the inferior is started, so any
> watches added before this happens end up being soft-watches.
While this is true, it is a general limitation of GDB and is much less
of a problem than the ones associated with the macros; please use the
target vector.
> Ideally in when the first resume() is issued to the inferior the
> watchpoints would be re-evaluated to see if some (or all) of them could
> be converted to hardware watchpoints. There might have to be an
> additional target hook to allow for this.
Right now there's never conversion from software to hardware
watchpoints. But I think this would be reasonable to do.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-09 12:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-09 5:19 Adding watchpoint functions to target vector vs. TARGET*WATCHPOINT macros David Daney
2008-09-09 12:17 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox