PTRACE_SINGLESTEP x86 vs alpha

From: J . A . Magallon (jamagallon@able.es)
Date: Sat Sep 22 2001 - 17:29:41 EST


Hi everyrone.

I'm trying to solve rejects when applying bproc-3.0.1 (designed for 2.4.7)
to 2.4.10-pre14. Everything is solved but this.

In arch/[i386,alpha]/kernel/ptrace.c:sys_ptrace,
code looks a bit different between i386 and alpha:

x86:
    case PTRACE_SINGLESTEP: { /* set the trap flag. */
        long tmp;

        ret = -EIO;
        if ((unsigned long) data > _NSIG)
            break;
        child->ptrace &= ~PT_TRACESYS;
        if ((child->ptrace & PT_DTRACE) == 0) {
            /* Spurious delayed TF traps may occur */
            child->ptrace |= PT_DTRACE;
        }
        tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG;
        put_stack_long(child, EFL_OFFSET, tmp);
        child->exit_code = data;
        /* give it a chance to run. */
        wake_up_process(child);
        ret = 0;
        break;
    }

alpha:
    case PTRACE_SINGLESTEP: /* execute single instruction. */
        ret = -EIO;
        if ((unsigned long) data > _NSIG)
            goto out;
        child->thread.bpt_nsaved = -1; /* mark single-stepping */
        child->ptrace &= ~PT_TRACESYS;
        wake_up_process(child); <==========0
        child->exit_code = data; <==========0 different
                                                                                                order than x86
        /* give it a chance to run. */
        ret = 0;
        goto out; <==========0 so bad are
                                                                                breaks in alpha gcc ??

Is it safe to reorder wake_up_process(child) and put it just before the goto ?

TIA

--
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.1 (Cooker) for i586
Linux werewolf 2.4.10-pre14 #1 SMP Sat Sep 22 11:04:31 CEST 2001 i686
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Sep 23 2001 - 21:00:51 EST