uint16_t err;
};
-#if defined LINUX_MIPSN32 || defined X32
-# define HAVE_STRUCT_TCB_EXT_ARG 1
-#else
-# define HAVE_STRUCT_TCB_EXT_ARG 0
-#endif
-
/* Trace Control Block */
struct tcb {
int flags; /* See below for TCB_ values */
int pid; /* If 0, this tcb is free */
int qual_flg; /* qual_flags[scno] or DEFAULT_QUAL_FLAGS + RAW */
unsigned long u_error; /* Error code */
- kernel_scno_t scno; /* System call number */
- kernel_ureg_t u_arg[MAX_ARGS]; /* System call arguments */
-#if HAVE_STRUCT_TCB_EXT_ARG
- unsigned long long ext_arg[MAX_ARGS];
- long long u_lrval; /* long long return value */
-#endif
- long u_rval; /* Return value */
+ kernel_ulong_t scno; /* System call number */
+ kernel_ulong_t u_arg[MAX_ARGS]; /* System call arguments */
+ kernel_long_t u_rval; /* Return value */
#if SUPPORTED_PERSONALITIES > 1
unsigned int currpers; /* Personality at the time of scno update */
#endif
#define RVAL_HEX 001 /* hex format */
#define RVAL_OCTAL 002 /* octal format */
#define RVAL_UDECIMAL 003 /* unsigned decimal format */
-#if HAVE_STRUCT_TCB_EXT_ARG
-# if 0 /* unused so far */
-# define RVAL_LDECIMAL 004 /* long decimal format */
-# define RVAL_LHEX 005 /* long hex format */
-# define RVAL_LOCTAL 006 /* long octal format */
-# endif
-# define RVAL_LUDECIMAL 007 /* long unsigned decimal format */
-#endif /* HAVE_STRUCT_TCB_EXT_ARG */
#define RVAL_FD 010 /* file descriptor */
-#define RVAL_MASK 017 /* mask for these values */
+#define RVAL_MASK 013 /* mask for these values */
#define RVAL_STR 020 /* Print `auxstr' field after return val */
#define RVAL_NONE 040 /* Print nothing */
* @return String literal corresponding to the syscall number in case latter
* is valid; NULL otherwise.
*/
-extern const char *syscall_name(kernel_scno_t scno);
+extern const char *syscall_name(kernel_ulong_t scno);
extern const char *err_name(unsigned long err);
extern bool is_erestart(struct tcb *);
}
extern int
-umoven(struct tcb *tcp, kernel_ureg_t addr, unsigned int len, void *laddr);
+umoven(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, void *laddr);
#define umove(pid, addr, objp) \
umoven((pid), (addr), sizeof(*(objp)), (void *) (objp))
extern int
-umoven_or_printaddr(struct tcb *tcp, kernel_ureg_t addr,
+umoven_or_printaddr(struct tcb *tcp, kernel_ulong_t addr,
unsigned int len, void *laddr);
#define umove_or_printaddr(pid, addr, objp) \
umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp))
extern int
-umoven_or_printaddr_ignore_syserror(struct tcb *tcp, kernel_ureg_t addr,
+umoven_or_printaddr_ignore_syserror(struct tcb *tcp, kernel_ulong_t addr,
unsigned int len, void *laddr);
extern int
-umovestr(struct tcb *tcp, kernel_ureg_t addr, unsigned int len, char *laddr);
+umovestr(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, char *laddr);
-extern int upeek(int pid, long, long *);
-extern int upoke(int pid, long, long);
+extern int upeek(int pid, unsigned long, kernel_ulong_t *);
+extern int upoke(int pid, unsigned long, kernel_ulong_t);
extern bool
print_array(struct tcb *tcp,
- kernel_ureg_t start_addr,
+ kernel_ulong_t start_addr,
size_t nmemb,
void *elem_buf,
size_t elem_size,
int (*umoven_func)(struct tcb *,
- kernel_ureg_t,
+ kernel_ulong_t,
unsigned int,
void *),
bool (*print_func)(struct tcb *,
extern int printllval(struct tcb *, const char *, int)
ATTRIBUTE_FORMAT((printf, 2, 0));
-extern void printaddr_klu(kernel_ulong_t addr);
+extern void printaddr(kernel_ulong_t addr);
extern int printxvals(const uint64_t, const char *, const struct xlat *, ...)
ATTRIBUTE_SENTINEL;
extern int printxval_searchn(const struct xlat *xlat, size_t xlat_size,
uint64_t val, const char *dflt);
#define printxval_search(xlat__, val__, dflt__) \
printxval_searchn(xlat__, ARRAY_SIZE(xlat__), val__, dflt__)
-extern kernel_ulong_t getarg_klu(struct tcb *tcp, int argn);
extern int printargs(struct tcb *);
extern int printargs_u(struct tcb *);
extern int printargs_d(struct tcb *);
extern void print_numeric_long_umask(unsigned long);
extern void
-dumpiov_in_msghdr(struct tcb *, kernel_ureg_t addr, unsigned long data_size);
+dumpiov_in_msghdr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t data_size);
extern void
-dumpiov_in_mmsghdr(struct tcb *, kernel_ureg_t addr);
+dumpiov_in_mmsghdr(struct tcb *, kernel_ulong_t addr);
extern void
-dumpiov_upto(struct tcb *, int len, kernel_ureg_t addr, unsigned long data_size);
+dumpiov_upto(struct tcb *, int len, kernel_ulong_t addr, kernel_ulong_t data_size);
extern void
-dumpstr(struct tcb *, kernel_ureg_t addr, int len);
+dumpstr(struct tcb *, kernel_ulong_t addr, int len);
extern void
-printstr_ex(struct tcb *, kernel_ureg_t addr, kernel_ureg_t len,
+printstr_ex(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len,
unsigned int user_style);
#define DECL_PRINTNUM(name) \
extern bool \
-printnum_ ## name(struct tcb *, kernel_ureg_t addr, const char *fmt) \
+printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
ATTRIBUTE_FORMAT((printf, 3, 0))
DECL_PRINTNUM(short);
DECL_PRINTNUM(int);
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
extern bool
-printnum_long_int(struct tcb *, kernel_ureg_t addr,
+printnum_long_int(struct tcb *, kernel_ulong_t addr,
const char *fmt_long, const char *fmt_int)
ATTRIBUTE_FORMAT((printf, 3, 0))
ATTRIBUTE_FORMAT((printf, 4, 0));
#define DECL_PRINTPAIR(name) \
extern bool \
-printpair_ ## name(struct tcb *, kernel_ureg_t addr, const char *fmt) \
+printpair_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
ATTRIBUTE_FORMAT((printf, 3, 0))
DECL_PRINTPAIR(int);
DECL_PRINTPAIR(int64);
#undef DECL_PRINTPAIR
extern void
-printpathn(struct tcb *, kernel_ureg_t addr, unsigned int n);
+printpathn(struct tcb *, kernel_ulong_t addr, unsigned int n);
extern void
-printpath(struct tcb *, kernel_ureg_t addr);
+printpath(struct tcb *, kernel_ulong_t addr);
#define TIMESPEC_TEXT_BUFSIZE \
(sizeof(intmax_t)*3 * 2 + sizeof("{tv_sec=%jd, tv_nsec=%jd}"))
extern void print_dirfd(struct tcb *, int);
extern int
-decode_sockaddr(struct tcb *, kernel_ureg_t addr, int addrlen);
+decode_sockaddr(struct tcb *, kernel_ulong_t addr, int addrlen);
extern void printuid(const char *, const unsigned int);
extern void
-print_sigset_addr_len(struct tcb *, kernel_ureg_t addr, long len);
+print_sigset_addr_len(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len);
extern const char *sprintsigmask_n(const char *, const void *, unsigned int);
#define tprintsigmask_addr(prefix, mask) \
extern void printsignal(int);
extern void
-tprint_iov_upto(struct tcb *, unsigned long len, kernel_ureg_t addr,
- enum iov_decode, unsigned long data_size);
+tprint_iov_upto(struct tcb *, kernel_ulong_t len, kernel_ulong_t addr,
+ enum iov_decode, kernel_ulong_t data_size);
extern void
-decode_netlink(struct tcb *, kernel_ureg_t addr, unsigned long len);
+decode_netlink(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len);
extern void tprint_open_modes(unsigned int);
extern const char *sprint_open_modes(unsigned int);
extern void
-print_seccomp_filter(struct tcb *, kernel_ureg_t addr);
+print_seccomp_filter(struct tcb *, kernel_ulong_t addr);
extern void
-print_seccomp_fprog(struct tcb *, kernel_ureg_t addr, unsigned short len);
+print_seccomp_fprog(struct tcb *, kernel_ulong_t addr, unsigned short len);
struct strace_stat;
extern void print_struct_stat(struct tcb *tcp, const struct strace_stat *const st);
struct strace_statfs;
extern void
-print_struct_statfs(struct tcb *, kernel_ureg_t addr);
+print_struct_statfs(struct tcb *, kernel_ulong_t addr);
extern void
-print_struct_statfs64(struct tcb *, kernel_ureg_t addr, unsigned long size);
+print_struct_statfs64(struct tcb *, kernel_ulong_t addr, kernel_ulong_t size);
extern void print_ifindex(unsigned int);
#define DECL_IOCTL(name) \
extern int \
-name ## _ioctl(struct tcb *, unsigned int request, kernel_ureg_t arg)
+name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg)
DECL_IOCTL(dm);
DECL_IOCTL(file);
DECL_IOCTL(fs_x);
#endif
static inline void
-printaddr(kernel_ureg_t addr)
-{
- printaddr_klu(addr);
-}
-
-static inline void
-printstrn(struct tcb *tcp, kernel_ureg_t addr, kernel_ureg_t len)
+printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len)
{
printstr_ex(tcp, addr, len, 0);
}
static inline void
-printstr(struct tcb *tcp, kernel_ureg_t addr)
+printstr(struct tcb *tcp, kernel_ulong_t addr)
{
printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED);
}
return printflags64(x, flags, dflt);
}
-static inline int
-printflags_long(const struct xlat *x, unsigned long flags, const char *dflt)
-{
- return printflags64(x, flags, dflt);
-}
-
static inline int
printxval64(const struct xlat *x, const uint64_t val, const char *dflt)
{
return printxvals(val, dflt, x, NULL);
}
-static inline int
-printxval_long(const struct xlat *x, const unsigned long val, const char *dflt)
-{
- return printxvals(val, dflt, x, NULL);
-}
-
static inline void
-tprint_iov(struct tcb *tcp, unsigned long len, kernel_ureg_t addr,
+tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr,
enum iov_decode decode_iov)
{
- tprint_iov_upto(tcp, len, addr, decode_iov, -1UL);
+ tprint_iov_upto(tcp, len, addr, decode_iov, -1);
}
#ifdef ALPHA
} timeval32_t;
extern void print_timeval32_t(const timeval32_t *);
-extern void printrusage32(struct tcb *, kernel_ureg_t);
-extern const char *sprint_timeval32(struct tcb *tcp, kernel_ureg_t);
-extern void print_timeval32(struct tcb *tcp, kernel_ureg_t);
-extern void print_timeval32_pair(struct tcb *tcp, kernel_ureg_t);
-extern void print_itimerval32(struct tcb *tcp, kernel_ureg_t);
+extern void printrusage32(struct tcb *, kernel_ulong_t);
+extern const char *sprint_timeval32(struct tcb *tcp, kernel_ulong_t);
+extern void print_timeval32(struct tcb *tcp, kernel_ulong_t);
+extern void print_timeval32_pair(struct tcb *tcp, kernel_ulong_t);
+extern void print_itimerval32(struct tcb *tcp, kernel_ulong_t);
#endif
#ifdef HAVE_STRUCT_USER_DESC
-extern void print_user_desc(struct tcb *, kernel_ureg_t addr);
+extern void print_user_desc(struct tcb *, kernel_ulong_t addr);
#endif
/* Strace log generation machinery.
# define widen_to_ulong(v) ((unsigned long)(v))
#endif
+/*
+ * Cast a pointer or a pointer-sized integer to kernel_ulong_t.
+ */
+#define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v))
+
/*
* Zero-extend a signed integer type to unsigned long long.
*/
/* Checks that sysent[scno] is not out of range. */
static inline bool
-scno_in_range(kernel_scno_t scno)
+scno_in_range(kernel_ulong_t scno)
{
return scno < nsyscalls;
}
* and its sysent[scno].sys_flags has no TRACE_INDIRECT_SUBCALL flag set.
*/
static inline bool
-scno_is_valid(kernel_scno_t scno)
+scno_is_valid(kernel_ulong_t scno)
{
return scno_in_range(scno)
&& sysent[scno].sys_func