ptrace single-stepping change breaks Wine
torvalds at osdl.org
Sun Nov 21 16:33:32 CST 2004
On Sun, 21 Nov 2004, Davide Libenzi wrote:
> I'd agree with Linus here. A signal handler is part of the application, so
> it should be single stepped in the same way other application code does.
> My original patch simply reenabled the flag before returning to userspace,
> and this had the consequence to single step into signal handlers too.
Hmmm.. I think I may have a test-case for the problem.
printf("Copy protected: ok\n");
void handler(int signo)
extern char smc;
#define TF 0x100
int main(int argc, char **argv)
mprotect((void *)(0xfffff000 & (unsigned long)main), 4096, PROT_READ | PROT_WRITE);
asm volatile("pushfl ; orl %0,(%%esp) ; popfl"
: :"i" (TF):"memory");
asm volatile("pushfl ; andl %0,(%%esp) ; popfl"
: :"i" (~TF):"memory");
Compile it, run it, and it should say
Copy protected: ok
Now, try to "strace" it, or debug it with gdb, and see if you can repeat
Roland? Think of it as a challenge,
More information about the wine-devel