Re: patch for invalid hw breakpoints

Daniel Jacobowitz
2006-06-01T17:26:46Z

On Thu, Jun 01, 2006 at 08:17:48PM +0300, Eli Zaretskii wrote:
> [Patches should be sent to gdb-patches,; I redirected the thread.]
>
> > Date: Thu, 01 Jun 2006 14:20:40 +0100
> > From: Nathan Sidwell <nathan@codesourcery.com>
> >
> > I have a remote target w/o hw watchpoint support. I set a watchpoint only to
> > find that I then get an undeletable watchpoint as we try and remove it.
> >
> > The bug is that when insert_bp_location fails to insert one of the watched
> > addresses for a watch expression it then goes and tries to remove all the
> > addresses of that watched expression, rather than just the previous fragments of
> > the expression.
>
> And why is that a problem? I'm sorry, but I couldn't figure out from
> your description why removing a watch for an expression for which
> insertion didn't happen causes trouble. IIRC, it is supposed to
> silently fail, and its only effect should be to cause GDB to be happy
> that the watchpoint was completely removed. What am I missing?

It caused trouble for a remote stub. If I remember Nathan's example
right, we sent out packets like this:

-> Z02,1111110
<- E01
-> z02,1111110

We're asking the stub to remove something that isn't inserted. The
protocol documentation isn't clear on whether stubs have to support
this... but it didn't say that they did, and at least one didn't.

Nathan, have I got that right?

--
Daniel Jacobowitz
CodeSourcery