Hi, This fixes a long standing issue with breakpoints being left in the inferior on a fork. We used to get away with it most times since often a fork is followed by an exec() which would just clear everything. But there are actually single threaded applications that use fork as a way to have a poor mans clone(). Roland, I CCed you in the hope that you could maybe point out some nice way now or in the future to do this. The patch itself might not be very interesting to you. The way we model Tasks and events means we do this in three stages. First we get a fork event and capture all the (software) breakpoint addresses, then we already create the Proc and then the main Task based on the pid given in the event, then we wait for an (stopped) event on this now Task, then we go over all the breakpoints left and patch in the original instructions again. This of course isn't very efficient since I assume the kernel could help us out here since it know the pages we touched through ptrace poke to set the breakpoints in the first place. If there was some way to have an event from the kernel where we got the forking and forked tasks in a quiescent state (at the same time) and then could inspect both and tell the kernel whether or not to copy the modified or original code pages that would be much better. Bonus points for having advanced knowledge of a pending exec event, which would wipe away any changes we do anyway (although I don't see how this would be possible). frysk-core/frysk/proc/live/ChangeLog 2008-04-22 Mark Wielaard * Breakpoint.java (reset): Make package private. (cloneForProc): New method. * BreakpointAddresses.java (cloneForProc): New method. (clearAllBreakpoints): New method. * LinuxPtraceProc.java (LinuxPtraceProc(Task,ProcessIdentifier)): Set breakpoints through forkingProc.breakpoints.cloneForProc(). (breakpoints): Make package private. * LinuxPtraceTask.java (LinuxPtraceTask(LinuxPtraceTask, LinuxPtraceProc,TaskAttachedObserverXXX)): Set currentISA. * LinuxPtraceTaskState.java (StartMainTask.wantToDetach.handleAttach): Clear breakpoints. (StartMainTask.wantToDetach.StoppedEvent): Likewise. * TestTaskObserverCode.java (testCodeOverFork): Resolve bug #5331. No regressions on fedora 8 x86 and x86_64. The testCodeOverFork now passes. Committed and pushed, Mark