ptrace single-stepping change breaks Wine

Daniel Jacobowitz dan at debian.org
Thu Dec 30 17:00:46 CST 2004


i386 architecture details are really not my thing, so I'm going to
trust you on most of this, but this bit:

On Thu, Dec 30, 2004 at 02:46:17PM -0800, Linus Torvalds wrote:
>  	/* the 0x80 provides a way for the tracing parent to distinguish
>  	   between a syscall stop and SIGTRAP delivery */
> -	ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) &&
> -				 !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0));
> +	info.si_code = SIGTRAP;
> +	if ((current->ptrace & PT_TRACESYSGOOD) && !test_thread_flag(TIF_SINGLESTEP))
> +		info.si_code = SIGTRAP | 0x80;
> +	info.si_pid = current->tgid;
> +	info.si_uid = current->uid;
>  
> -	/*
> -	 * this isn't the same as continuing with a signal, but it will do
> -	 * for normal use.  strace only continues with a signal if the
> -	 * stopping signal is not SIGTRAP.  -brl
> -	 */
> -	if (current->exit_code) {
> -		send_sig(current->exit_code, current, 1);
> -		current->exit_code = 0;
> -	}
> +	/* Send us the fakey SIGTRAP */
> +	send_sig_info(SIGTRAP, &info, current);
>  }

does not look right to me.  Before, we'd get an 0x80|SIGTRAP result
from wait.  Now, you've moved the 0x80 to live only inside the siginfo.
This is accessible to the debugger via ptrace, but only very recently
(late 2.5.x).  So this will probably break users of PT_TRACESYSGOOD.

-- 
Daniel Jacobowitz



More information about the wine-devel mailing list