From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14205 invoked by alias); 11 Jan 2002 12:57:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14167 invoked from network); 11 Jan 2002 12:57:04 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.7) by sources.redhat.com with SMTP; 11 Jan 2002 12:57:04 -0000 Received: from laocoon (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (8.9.3/8.8.7) with ESMTP id NAA29342; Fri, 11 Jan 2002 13:56:51 +0100 Message-Id: <4.2.0.58.20020111135305.0135ea48@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Fri, 11 Jan 2002 04:57:00 -0000 To: Eli Zaretskii From: Pierre Muller Subject: Re: [RFA/RFC 2] Remove hardware break and watchpoints at program exit. Cc: gdb-patches@sources.redhat.com, djbarrow@de.ibm.com In-Reply-To: <2561-Fri11Jan2002143543+0200-eliz@is.elta.co.il> References: <4.2.0.58.20020111125745.0135ea48@ics.u-strasbg.fr> <4.2.0.58.20020111125745.0135ea48@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-SW-Source: 2002-01/txt/msg00284.txt.bz2 At 13:35 11/01/2002 , Eli Zaretskii a écrit: > > Date: Fri, 11 Jan 2002 13:00:44 +0100 > > From: Pierre Muller > > > > In breakpoint_init_inferior > > I added code that conditionally removes hardware watch and breakpoint > > if the context is inf_exited, i.e. at exit of the debugged program. > >Thanks. I like this approach much better, especially because I never >understood why does GDB do certain cleanups when the debuggee exits, >but doesn't do other, similar cleanups. > > > I still kept the call to a generic hardware removal function > > and testing the i386 case, I could see that even though the dr_mirror > > array is zeored out, the dr_control_mirror and > > dr_status_mirror still aren't set to zero. > > For dr_control_register, this is due to an error in the I386_DR_DISABLE > > because that macro only resets the active bit, but not the size and type bits > > associated to that debug register. > >Why is this a problem? Once the active bit is off, the corresponding >debug register is inactive, and its value is not important. I agree that it isn't important, it was just for cleanness... > > * 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. > > --- 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? Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99