X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=defs.h;h=7271280ca2046617ac81ab084c676bc45af20281;hb=3138213bc9a827a372ad9f8009ebcc5d8797ce2d;hp=62b371917b8061c359c10290bcee5650fce3408a;hpb=e3a7ef5a2a3ac31bfa0d3f9ce65981e51700073e;p=strace diff --git a/defs.h b/defs.h index 62b37191..7271280c 100644 --- a/defs.h +++ b/defs.h @@ -246,6 +246,13 @@ extern int ptrace(int, int, char *, int, ...); #define PERSONALITY1_WORDSIZE 4 #endif +#ifdef POWERPC64 +#undef SUPPORTED_PERSONALITIES +#define SUPPORTED_PERSONALITIES 2 +#define PERSONALITY0_WORDSIZE 8 +#define PERSONALITY1_WORDSIZE 4 +#endif + #ifdef SVR4 #ifdef HAVE_MP_PROCFS extern int mp_ioctl (int f, int c, void *a, int s); @@ -301,6 +308,34 @@ extern int mp_ioctl (int f, int c, void *a, int s); #define PR_FAULTED S_CORE #endif +#ifdef LINUX +# ifndef PTRACE_SETOPTIONS +# define PTRACE_SETOPTIONS 0x4200 +# endif +# ifndef PTRACE_GETEVENTMSG +# define PTRACE_GETEVENTMSG 0x4201 +# endif +# ifndef PTRACE_O_TRACEFORK +# define PTRACE_O_TRACEFORK 0x00000002 +# endif +# ifndef PTRACE_O_TRACEVFORK +# define PTRACE_O_TRACEVFORK 0x00000004 +# endif +# ifndef PTRACE_O_TRACECLONE +# define PTRACE_O_TRACECLONE 0x00000008 +# endif + +# ifndef PTRACE_EVENT_FORK +# define PTRACE_EVENT_FORK 1 +# endif +# ifndef PTRACE_EVENT_VFORK +# define PTRACE_EVENT_VFORK 2 +# endif +# ifndef PTRACE_EVENT_CLONE +# define PTRACE_EVENT_CLONE 3 +# endif +#endif /* LINUX */ + /* Trace Control Block */ struct tcb { short flags; /* See below for TCB_ values */ @@ -329,7 +364,6 @@ struct tcb { int nzombies; /* # of formerly traced children now dead */ #ifdef LINUX int nclone_threads; /* # of nchildren with CLONE_THREAD */ - int nclone_detached; /* # of nchildren with CLONE_DETACHED */ int nclone_waiting; /* clone threads in wait4 (TCB_SUSPENDED) */ #endif /* (1st arg of wait4()) */ @@ -375,7 +409,6 @@ struct tcb { || defined(ARM) || defined(MIPS) || defined(BFIN) || defined(TILE) # define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */ # endif -# define TCB_CLONE_DETACHED 04000 /* CLONE_DETACHED set in creating syscall */ # define TCB_CLONE_THREAD 010000 /* CLONE_THREAD set in creating syscall */ # define TCB_GROUP_EXITING 020000 /* TCB_EXITING was exit_group, not _exit */ # include @@ -419,7 +452,7 @@ struct tcb { struct xlat { int val; - char *str; + const char *str; }; extern const struct xlat open_mode_flags[]; @@ -455,6 +488,7 @@ extern const struct xlat open_access_modes[]; #define TRACE_PROCESS 010 /* Trace process-related syscalls. */ #define TRACE_SIGNAL 020 /* Trace signal-related syscalls. */ #define TRACE_DESC 040 /* Trace file descriptor-related syscalls. */ +#define SYSCALL_NEVER_FAILS 0100 /* Syscall is always successful. */ typedef enum { CFLAG_NONE = 0, @@ -465,6 +499,7 @@ typedef enum { extern struct tcb **tcbtab; extern int *qual_flags; extern int debug, followfork; +extern unsigned int ptrace_setoptions; extern int dtime, xflag, qflag; extern cflag_t cflag; extern int acolumn; @@ -483,13 +518,14 @@ extern void expand_tcbtab(void); #define alloctcb(pid) alloc_tcb((pid), 1) -extern void set_sortby(char *); +extern void set_sortby(const char *); extern void set_overhead(int); -extern void qualify(char *); +extern void qualify(const char *); extern int get_scno(struct tcb *); extern long known_scno(struct tcb *); extern long do_ptrace(int request, struct tcb *tcp, void *addr, void *data); extern int ptrace_restart(int request, struct tcb *tcp, int sig); +extern int force_result(struct tcb *, int, long); extern int trace_syscall(struct tcb *); extern int count_syscall(struct tcb *, struct timeval *); extern void printxval(const struct xlat *, int, const char *); @@ -503,8 +539,8 @@ extern int upeek(struct tcb *, long, long *); extern void dumpiov(struct tcb *, int, long); extern void dumpstr(struct tcb *, long, int); extern void printstr(struct tcb *, long, int); -extern void printnum(struct tcb *, long, char *); -extern void printnum_int(struct tcb *, long, char *); +extern void printnum(struct tcb *, long, const char *); +extern void printnum_int(struct tcb *, long, const char *); extern void printpath(struct tcb *, long); extern void printpathn(struct tcb *, long, int); extern void printtv_bitness(struct tcb *, long, enum bitness_t, int); @@ -514,6 +550,7 @@ extern void sprint_timespec(char *, struct tcb *, long); #ifdef HAVE_SIGINFO_T extern void printsiginfo(siginfo_t *, int); #endif +extern void printfd(struct tcb *, int); extern void printsock(struct tcb *, long, int); extern void print_sock_optmgmt(struct tcb *, long, int); extern void printrusage(struct tcb *, long); @@ -539,6 +576,9 @@ extern int internal_fork(struct tcb *); extern int internal_exec(struct tcb *); extern int internal_wait(struct tcb *, int); extern int internal_exit(struct tcb *); +#ifdef LINUX +extern int handle_new_child(struct tcb *, int, int); +#endif extern const struct ioctlent *ioctl_lookup(long); extern const struct ioctlent *ioctl_next_match(const struct ioctlent *); @@ -550,6 +590,7 @@ extern int stream_ioctl(struct tcb *, int, int); #ifdef LINUX extern int rtc_ioctl(struct tcb *, long, long); extern int scsi_ioctl(struct tcb *, long, long); +extern int block_ioctl(struct tcb *, long, long); #endif extern int tv_nz(struct timeval *); @@ -563,7 +604,8 @@ extern void tv_div(struct timeval *, struct timeval *, int); #ifdef SUNOS4 extern int fixvfork(struct tcb *); #endif -#if !(defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(IA64)) +#if !(defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(IA64) \ + && !defined(SH)) extern long getrval2(struct tcb *); #endif #ifdef USE_PROCFS @@ -578,12 +620,11 @@ extern int proc_open(struct tcb *tcp, int attaching); #define printtv_special(tcp, addr) \ printtv_bitness((tcp), (addr), BITNESS_CURRENT, 1) -#ifdef __GNUC__ extern void tprintf(const char *fmt, ...) - __attribute__ ((format (printf, 1, 2))); -#else -extern void tprintf(const char *fmt, ...); +#ifdef __GNUC__ + __attribute__ ((format (printf, 1, 2))) #endif + ; #ifndef HAVE_STRERROR const char *strerror(int);