#ifndef DEFAULT_SORTBY
# define DEFAULT_SORTBY "time"
#endif
-
-/* Experimental code using PTRACE_SEIZE can be enabled here.
+/*
+ * Experimental code using PTRACE_SEIZE can be enabled here.
* This needs Linux kernel 3.4.x or later to work.
*/
#define USE_SEIZE 1
#define TCB_REPRINT 00200 /* We should reprint this syscall on exit */
#define TCB_FILTERED 00400 /* This system call has been filtered out */
/* x86 does not need TCB_WAITEXECVE.
- * It can detect SIGTRAP by looking at eax/rax.
- * See "not a syscall entry (eax = %ld)\n" message
- * in syscall_fixup_on_sysenter().
+ * It can detect post-execve SIGTRAP by looking at eax/rax.
+ * See "not a syscall entry (eax = %ld)\n" message.
+ *
+ * Note! On new kernels (about 2.5.46+), we use PTRACE_O_TRACEEXEC, which
+ * suppresses post-execve SIGTRAP. If you are adding a new arch which is
+ * only supported by newer kernels, you most likely don't need to define
+ * TCB_WAITEXECVE!
*/
-#if defined(ALPHA) || defined(AVR32) || defined(SPARC) || defined(SPARC64) \
- || defined(POWERPC) || defined(IA64) || defined(HPPA) \
- || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) \
- || defined(ARM) || defined(AARCH64) || defined(MIPS) || defined(BFIN) \
- || defined(TILE)
+#if defined(ALPHA) \
+ || defined(SPARC) || defined(SPARC64) \
+ || defined(POWERPC) \
+ || defined(IA64) \
+ || defined(HPPA) \
+ || defined(SH) || defined(SH64) \
+ || defined(S390) || defined(S390X) \
+ || defined(ARM) || defined(AARCH64) \
+ || defined(MIPS)
/* This tracee has entered into execve syscall. Expect post-execve SIGTRAP
* to happen. (When it is detected, tracee is continued and this bit is cleared.)
*/
return 0;
}
+/* Note! On new kernels (about 2.5.46+), we use PTRACE_O_TRACECLONE
+ * and PTRACE_O_TRACE[V]FORK for tracing children.
+ * If you are adding a new arch which is only supported by newer kernels,
+ * you most likely don't need to add any code below
+ * beside a dummy "return 0" block in change_syscall().
+ */
+
/*
* These #if's are huge, please indent them correctly.
* It's easy to get confused otherwise.
# elif defined(ALPHA) || defined(MIPS)
# define arg0_offset REG_A0
# define arg1_offset (REG_A0+1)
-# elif defined(AVR32)
-# define arg0_offset (REG_R12)
-# define arg1_offset (REG_R11)
# elif defined(POWERPC)
# define arg0_offset (sizeof(unsigned long)*PT_R3)
# define arg1_offset (sizeof(unsigned long)*PT_R4)
# define restore_arg1(tcp, state, val) 0
# define arg0_index 1
# define arg1_index 0
-# elif defined TILE
-# define arg0_offset PTREGS_OFFSET_REG(0)
-# define arg1_offset PTREGS_OFFSET_REG(1)
-# define restore_arg0(tcp, state, val) 0
-# define restore_arg1(tcp, state, val) 0
# else
# define arg0_offset 0
# define arg1_offset 4
return -1;
return 0;
#elif defined(AVR32)
- if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_R8), new) < 0)
- return -1;
+ /* setbpt/clearbpt never used: */
+ /* AVR32 is only supported since about linux-2.6.19 */
return 0;
#elif defined(BFIN)
- if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_P0), new) < 0)
- return -1;
+ /* setbpt/clearbpt never used: */
+ /* Blackfin is only supported since about linux-2.6.23 */
return 0;
#elif defined(IA64)
if (ia32) {
return -1;
return 0;
#elif defined(TILE)
- if (ptrace(PTRACE_POKEUSER, tcp->pid,
- (char*)PTREGS_OFFSET_REG(0),
- new) != 0)
- return -1;
+ /* setbpt/clearbpt never used: */
+ /* Tilera CPUs are only supported since about linux-2.6.34 */
return 0;
#elif defined(MICROBLAZE)
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GPR(0)), new) < 0)