From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22238 invoked by alias); 12 Jan 2002 21:16:55 -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 22180 invoked from network); 12 Jan 2002 21:16:50 -0000 Received: from unknown (HELO factorix.sdv.fr) (194.206.196.2) by sources.redhat.com with SMTP; 12 Jan 2002 21:16:50 -0000 Received: from ordimaison (ip-76-192.evc.net [212.95.76.192]) by factorix.sdv.fr (8.11.4/8.11.4) with SMTP id g0CLArR23234; Sat, 12 Jan 2002 22:10:53 +0100 Message-Id: <3.0.6.32.20020112222820.00ff9750@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Sat, 12 Jan 2002 13:16:00 -0000 To: Mark Kettenis From: muller@cerbere.u-strasbg.fr Subject: Re: [RFA/RFC 3] Remove hardware break and watchpoints at program exit. Cc: Eli Zaretskii , gdb-patches@sources.redhat.com In-Reply-To: References: <4.2.0.58.20020111143044.019c7e50@ics.u-strasbg.fr> <4.2.0.58.20020111125745.0135ea48@ics.u-strasbg.fr> <4.2.0.58.20020111125745.0135ea48@ics.u-strasbg.fr> <4.2.0.58.20020111143044.019c7e50@ics.u-strasbg.fr> <4.2.0.58.20020111171505.01cdfad0@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2002-01/txt/msg00331.txt.bz2 At 14:19 12/01/02 +0100, Mark Kettenis wrote: >Pierre Muller writes: > >> After the previous discussion about the >> hardware watch and breakpoint removal >> about the debuggee exited. I slightly modifed my patch >> by adding a test to avoid calling ptrace >> in i386-linux-nat.c, i386bsd-nat.c and x86-64-linux-nat.c >> i386_linux_dr_set, i386bsd_dr_set and x86_64_linux_dr_set functions >> if taget_has_execution is 0. > >That should not be necessary. Those functions shouldn't be called >when there is no debuggee. I suspect that there is something wrong >with the hardware breakpoint/watchpoint implementation at a much >higher level. There was no call tp ptrace before my patch, but as Eli thought that the right solution would be to remove the hardware break and watchpoints at exit, I tried to implement this. But that implementation then ran into that problem that the code in i386-linux-nat.c, i386bsd-nat.c and x86-64-linux-nat.c implicitly supposed that the debuggee was still running... So here there is a conflict between i386-nat code that would work cleaner if we remove the hardware break and watchpoint at exit (and which works correctly for go32v2 and my still uncommitted patch for win32-nat) and the code that use ptrace. I did quite agree with Eli that its cleaner to remove those breakpoints, but if you prefer, I could resubmit a patch where the macros that trigger the removal are only set for go32v2 and win32 targets. As long as we also call i386_cleanup_dregs function, it should solve the bug present in 5.1 version, by which a watchpoint does not work anymore after a rerun of the debuggee.