Hi, Now that bug #3997 has been identified as the thing that caused strange results on some machines (sig trap handler gets reset in the inferior when ptrace single stepping the handler) here is finally the last missing piece to make stepping work together with breakpointing and user traps. The testcase (funit-breakpoints) has a workaround for now, but if your machine fails the frysk-imports/tests/frysk3997/ptrace_step_sig test then you have a buggy kernel installed and stepping through sigtrap handlers will result in trouble. The other thing that makes stepping slightly inconvenient is that on some architectures you will get spurious trap events (for example for system calls). So the Isa now defines a method hasExecutedSpuriousTrap() that checks whether the last instruction was a trapping instruction that the kernel will handle (if not, then we do need to signal a SIGTRAP to the inferior). This only happens on x86, but not on x86_64 as far as I can see. PowerPC is a stub for now (please check if you have access to such a machine). We also need to keep track of whether a signal was just send to the inferior. In that case we do get a SIGTRAP, but not a step (the kernel adjusts the pc to point to the start of the signal handle). We need to distinguish this case from a real trap signal that also doesn't generate a step, but which indicates that we need to signal the SIGTRAP to the inferior. All tests in TestBreakpoints has been duplicated to be run with or without stepping the full test (checking whether breakpoints are still hit). The number of iterations has been brought down from 42 till 7 because stepping a whole process is such a slow thing and we do want the tests to run reasonable fast. 2007-02-07 Mark Wielaard * funit-breakpoints.c (send_hup, receive_hup): New static ints. (trap_handler): Renamed to ... (signal_handler): Now also handles SIGHUP. (dummy): Send SIGHUP. Add SIGTRAP signal install workaround. (main): Check both hup and trap counts. 2007-02-07 Mark Wielaard * Isa.java (hasExecutedSpuriousTrap): New method. * IsaIA32.java (hasExecutedSpuriousTrap): Likewise. * IsaPowerPC.java (hasExecutedSpuriousTrap): Likewise. * IsaX8664.java (hasExecutedSpuriousTrap): Likewise. * LinuxPtraceTask.java (sendContinue): Setup step_send and sig_send. (sendSyscallContinue): Likewise. (sendStepInstruction): Likewise. * LinuxPtraceTaskState.java (Running.handleTrappedEvent): Add sanity checks and check for spurios traps and signal handler entry. Chain to handleSignaledEvent() otherwise. * Task.java (step_send, sig_send): New fields. * TestBreakpoints.java (installInstructionObserver): New field. (setUp): Initialize installInstructionObserver to false. (testHitAndRun): Check whether an InstructionObserver should be installed. (testInsertRemove): Likewise. (testAddLots): Likewise. (testSteppingtestHitAndRun): New method. (testSteppingtestInsertRemove): New method. (testSteppingAddLots): New method. (InstructionObserver): New static class. Committed, Mark