Re: patch for invalid hw breakpoints

Eli Zaretskii
2006-06-02T20:56:57Z

> Date: Fri, 2 Jun 2006 09:52:38 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org, Nathan Sidwell <nathan@codesourcery.com>
>
> Is this contract that you're asserting documented anywhere?

Not that I know of.

> Anyway, this is not a productive argument. Let's change remote.c
> instead. If someone ever finishes separating into a location per
> watched value, then we can arrange to only remove what we inserted
> at that later time.

That'd be fine with me.

> > Meanwhile, I really don't like the fact that remote.c throws an
> > internal error in situations that don't require that. To me, internal
> > error means a situation akin to SIGSEGV: something is dead wrong, but
> > the code has no means of figuring out what's that.
>
> If I were writing this code it would be a gdb_assert, which generates
> an internal error. Those are designed for two situations: hopelessly
> confused, and violated assumptions. This is the latter, not the
> former. It's thrown here because here is where we can detect that it
> happened.

Assertions for violated assumptions reveal bugs. In this case, the
bug is that the assumption was invalid.