patch-2.4.0-test12 linux/arch/mips64/kernel/ptrace.c
Next file: linux/arch/mips64/kernel/scall_64.S
Previous file: linux/arch/mips64/kernel/process.c
Back to the patch index
Back to the overall index
- Lines: 71
- Date:
Tue Nov 28 21:42:04 2000
- Orig file:
v2.4.0-test11/linux/arch/mips64/kernel/ptrace.c
- Orig date:
Sun Jul 9 22:18:16 2000
diff -u --recursive --new-file v2.4.0-test11/linux/arch/mips64/kernel/ptrace.c linux/arch/mips64/kernel/ptrace.c
@@ -5,7 +5,7 @@
*
* Copyright (C) 1992 Ross Biro
* Copyright (C) Linus Torvalds
- * Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle
+ * Copyright (C) 1994, 95, 96, 97, 98, 2000 Ralf Baechle
* Copyright (C) 1996 David S. Miller
* Copyright (C) 2000 Ulf Carlsson
*
@@ -268,7 +268,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
break;
- child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
+ child->ptrace = 0;
child->exit_code = data;
write_lock_irq(&tasklist_lock);
REMOVE_LINKS(child);
@@ -280,6 +280,15 @@
break;
}
+ case PTRACE_SETOPTIONS: {
+ if (data & PTRACE_O_TRACESYSGOOD)
+ child->ptrace |= PT_TRACESYSGOOD;
+ else
+ child->ptrace &= ~PT_TRACESYSGOOD;
+ ret = 0;
+ break;
+ }
+
default:
ret = -EIO;
break;
@@ -534,7 +543,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
break;
- child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
+ child->ptrace = 0;
child->exit_code = data;
write_lock_irq(&tasklist_lock);
REMOVE_LINKS(child);
@@ -546,6 +555,15 @@
break;
}
+ case PTRACE_SETOPTIONS: {
+ if (data & PTRACE_O_TRACESYSGOOD)
+ child->ptrace |= PT_TRACESYSGOOD;
+ else
+ child->ptrace &= ~PT_TRACESYSGOOD;
+ ret = 0;
+ break;
+ }
+
default:
ret = -EIO;
break;
@@ -564,7 +582,10 @@
!= (PT_PTRACED|PT_TRACESYS))
return;
- current->exit_code = SIGTRAP;
+ /* The 0x80 provides a way for the tracing parent to distinguish
+ between a syscall stop and SIGTRAP delivery */
+ current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
+ ? 0x80 : 0);
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
schedule();
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)