Index: aclocal.m4 =================================================================== RCS file: /cvsroot/strace/strace/aclocal.m4,v retrieving revision 1.6 diff -u -r1.6 aclocal.m4 --- aclocal.m4 2001/02/16 20:29:03 1.6 +++ aclocal.m4 2001/03/01 16:26:01 @@ -208,7 +208,13 @@ [AC_MSG_CHECKING(for pr_syscall in struct prstatus) AC_CACHE_VAL(ac_cv_struct_pr_syscall, [AC_TRY_COMPILE([#include ], -[struct prstatus s; s.pr_syscall;], +[#ifdef HAVE_MP_PROCFS +pstatus_t s; +s.pr_lwp.pr_syscall +#else +prstatus_t s; +s.pr_syscall +#endif], ac_cv_struct_pr_syscall=yes, ac_cv_struct_pr_syscall=no)]) AC_MSG_RESULT($ac_cv_struct_pr_syscall) Index: defs.h =================================================================== RCS file: /cvsroot/strace/strace/defs.h,v retrieving revision 1.18 diff -u -r1.18 defs.h --- defs.h 2001/02/16 19:59:55 1.18 +++ defs.h 2001/03/01 16:26:02 @@ -183,6 +183,7 @@ #define PR_WHAT pr_lwp.pr_what #define PR_REG pr_lwp.pr_context.uc_mcontext.gregs #define PR_FLAGS pr_lwp.pr_flags +#define PR_SYSCALL pr_lwp.pr_syscall #define PIOCSTIP PCSTOP #define PIOCSET PCSET #define PIOCRESET PCRESET @@ -201,6 +202,7 @@ #define PR_WHAT pr_what #define PR_REG pr_reg #define PR_FLAGS pr_flags +#define PR_SYSCALL pr_syscall #endif #endif #ifdef FREEBSD Index: syscall.c =================================================================== RCS file: /cvsroot/strace/strace/syscall.c,v retrieving revision 1.25 diff -u -r1.25 syscall.c --- syscall.c 2000/09/01 21:03:06 1.25 +++ syscall.c 2001/03/01 16:26:07 @@ -814,7 +814,7 @@ #endif #ifdef USE_PROCFS #ifdef HAVE_PR_SYSCALL - scno = tcp->status.pr_syscall; + scno = tcp->status.PR_SYSCALL; #else /* !HAVE_PR_SYSCALL */ #ifndef FREEBSD scno = tcp->status.PR_WHAT; @@ -1279,8 +1279,17 @@ memcpy(tcp->u_arg, &tcp->status.pr_reg[CTX_A0], tcp->u_nargs*sizeof(tcp->u_arg[0])); } -#else /* !MIPS */ -#ifdef HAVE_PR_SYSCALL +#elif UNIXWARE >= 2 + /* + * Like SGI, UnixWare doesn't set pr_sysarg until system call exit + */ + if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1) + tcp->u_nargs = sysent[tcp->scno].nargs; + else + tcp->u_nargs = tcp->status.pr_lwp.pr_nsysarg; + umoven(tcp, tcp->status.PR_REG[UESP] + 4, + tcp->u_nargs*sizeof(tcp->u_arg[0]), (char *) tcp->u_arg); +#elif defined (HAVE_PR_SYSCALL) if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1) tcp->u_nargs = sysent[tcp->scno].nargs; else @@ -1290,21 +1299,16 @@ for (i = 0; i < tcp->u_nargs; i++) tcp->u_arg[i] = tcp->status.pr_sysarg[i]; } -#else /* !HAVE_PR_SYSCALL */ -#ifdef I386 +#elif defined (I386) if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1) tcp->u_nargs = sysent[tcp->scno].nargs; else -#if UNIXWARE >= 2 - tcp->u_nargs = tcp->status.pr_lwp.pr_nsysarg; -#else tcp->u_nargs = 5; -#endif umoven(tcp, tcp->status.PR_REG[UESP] + 4, tcp->u_nargs*sizeof(tcp->u_arg[0]), (char *) tcp->u_arg); -#endif /* I386 */ +#else + I DONT KNOW WHAT TO DO #endif /* !HAVE_PR_SYSCALL */ -#endif /* !MIPS */ #endif /* SVR4 */ #ifdef FREEBSD if (tcp->scno >= 0 && tcp->scno < nsyscalls &&