Re: [RFA/RFC 2] Remove hardware break and watchpoints at program exit.

Eli Zaretskii
2002-01-11T13:58:18Z

> Date: Fri, 11 Jan 2002 13:56:42 +0100
> From: Pierre Muller <muller@cerbere.u-strasbg.fr>
>
> > > * breakpoint.c (REMOVE_HARDWARE_BREAKPOINT_AT_EXIT):
> > > Define to 0 if not defined.
> > > (REMOVE_HARDWARE_WATCHPOINT_AT_EXIT):
> > > Define to 0 if not defined.
> >
> >Why do we need these macros at all? Why not remove the breakpoints
> >and watchpoints unconditionally? Does anyone see any problem?
>
> Because some target might need to access the
> inferior registers to remove the watchpoint, and this
> isn't possible if the program has really already completed.

??? If a target accesses watchpoints of a dead and mourned debuggee,
it must have a bug, no?

> > > --- go32-nat.c 2001/12/06 08:15:37 1.26
> > > +++ go32-nat.c 2002/01/11 11:34:08
> > > @@ -670,7 +670,7 @@ go32_mourn_inferior (void)
> > > be nice if GDB itself would take care to remove all breakpoints
> > > at all times, but it doesn't, probably under an assumption that
> > > the OS cleans up when the debuggee exits. */
> > > - i386_cleanup_dregs ();
> > > + // i386_cleanup_dregs ();
> >
> >Please don't make such changes. If you want to remove some code, just
> >remove it, don't comment it away: it looks ad-hoc and not clean.
>
> I did that more or less to make you react,
> but I can't just remove the line as the comment before
> concerns the call to i386_cleanup_dregs()
>
> Should I remove the comment also?

Yes, of course: if code goes away, its comment should go away as well.