Bug 3676

Summary: TestTaskObserverInstructionAndCode kills (sigsegv or sigill) tracee
Product: frysk Reporter: Mark Wielaard <mark>
Component: generalAssignee: Mark Wielaard <mark>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 3346, 3500    

Description Mark Wielaard 2006-12-07 15:22:36 UTC
The test in TestTaskObserverInstructionAndCode adds an Instruction and Code
observer, steps, deletes both and adds a new Code observer. This crashes the
tracee as soon as it is resumed.
Comment 1 Andrew Cagney 2006-12-07 20:30:49 UTC
Try tracing the program counter each time the program is resumed and confirm
that it is pointing at the correct instruction.

On the i386, for a breakpoint, the instruction pointer is +1 the required value,
for complex combinations of PT_STEP and hitting a breakpoint, that gets complex.
Comment 2 Andrew Cagney 2006-12-07 20:54:50 UTC
single-stepping a breakpoint advances the pc; presumably though it should be
treated as though the breakpoint was hit with a continue - the pc needs to be
decremented.
Comment 3 Mark Wielaard 2007-01-15 13:53:39 UTC
2007-01-15  Mark Wielaard  <mark@klomp.org>

        Fixes bug #3676
        * Breakpoint.java (stepDone): Only set if still installed.
        (isInstalled): new method.
        (toString): Prettify.
        * IsaIA32.java (isTaskStepped): Reset flag.
        * IsaX8664.java (isTaskStepped): Likewise.
        * LinuxIa32On64.java (LinuxIa32On64): Install IndirectRegisters for
        d0 till d7.
        * LinuxPtraceTaskState.java (Running.sendContinue): Rewritten to take
        breakpoints into account.
        (Running.handleStoppedEvent): Fix log message. Call sendContinue()
        on new state.
        (Running.handleTrappedEvent): Rewritten.
        (running, syscallRunning, inSyscallRunning, inSyscallRunningTraced):
        Now have type Running.
        (BlockedSignal.handleUnblock): Call sendContinue() on new state.
        * TestTaskObserverInstruction.java: Don't test Isa.isTaskStepped().
        * TestTaskObserverInstructionAndCode.java: Enable.