NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: kern/51514: ptrace(2) fails for 32-bit process on 64-bit kernel



>  	/* XXX avoid sign extension problems with unknown upper bits? */
> +	regs->r_gs = tf->tf_gs & 0xffff;
> +	regs->r_fs = tf->tf_fs & 0xffff;
> +	regs->r_es = tf->tf_es & 0xffff;
> +	regs->r_ds = tf->tf_ds & 0xffff;
> +	regs->r_eflags = tf->tf_rflags;
> @@ -501,9 +501,9 @@ netbsd32_process_read_regs(struct lwp *l
> -	regs->r_cs = tf->tf_cs;
> +	regs->r_cs = tf->tf_cs & 0xffff;
>  	regs->r_esp = tf->tf_rsp & 0xffffffff;
> -	regs->r_ss = tf->tf_ss;
> +	regs->r_ss = tf->tf_ss & 0xffff;

i wonder if there should be ASSERT()s that they're not set.  there
really should never be anything set here.  x86-heads?

> -	tf->tf_y = regs->r_pc;
> +	tf->tf_y = regs->r_y;

well spotted.

rest LGTM and what i was envisioning.  thanks!


.mrg.


Home | Main Index | Thread Index | Old Index