2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
6 * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Linux for s390 port by D.J. Barrow
8 * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
9 * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH
10 * port by Greg Banks <gbanks@pocketpenguins.com>
12 * All rights reserved.
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. The name of the author may not be used to endorse or promote products
23 * derived from this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 #include <sys/resource.h>
42 #include <sys/utsname.h>
50 # ifndef PTRACE_PEEKUSR
51 # define PTRACE_PEEKUSR PTRACE_PEEKUSER
53 # ifndef PTRACE_POKEUSR
54 # define PTRACE_POKEUSR PTRACE_POKEUSER
58 #ifdef HAVE_LINUX_PTRACE_H
59 # undef PTRACE_SYSCALL
60 # ifdef HAVE_STRUCT_IA64_FPREG
61 # define ia64_fpreg XXX_ia64_fpreg
63 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
64 # define pt_all_user_regs XXX_pt_all_user_regs
66 # include <linux/ptrace.h>
68 # undef pt_all_user_regs
73 # undef PTRACE_GETREGS
74 # define PTRACE_GETREGS PTRACE_GETREGS64
75 # undef PTRACE_SETREGS
76 # define PTRACE_SETREGS PTRACE_SETREGS64
79 #ifdef HAVE_LINUX_FUTEX_H
80 # include <linux/futex.h>
92 # define FUTEX_REQUEUE 3
96 #include <asm/posix_types.h>
98 #define GETGROUPS_T __kernel_gid_t
100 #define GETGROUPS32_T __kernel_gid32_t
103 # include <asm/ptrace_offsets.h>
104 # include <asm/rse.h>
108 # include <sys/prctl.h>
110 static const struct xlat prctl_options[] = {
112 { PR_MAXPROCS, "PR_MAXPROCS" },
115 { PR_ISBLOCKED, "PR_ISBLOCKED" },
117 #ifdef PR_SETSTACKSIZE
118 { PR_SETSTACKSIZE, "PR_SETSTACKSIZE" },
120 #ifdef PR_GETSTACKSIZE
121 { PR_GETSTACKSIZE, "PR_GETSTACKSIZE" },
124 { PR_MAXPPROCS, "PR_MAXPPROCS" },
126 #ifdef PR_UNBLKONEXEC
127 { PR_UNBLKONEXEC, "PR_UNBLKONEXEC" },
130 { PR_ATOMICSIM, "PR_ATOMICSIM" },
133 { PR_SETEXITSIG, "PR_SETEXITSIG" },
136 { PR_RESIDENT, "PR_RESIDENT" },
139 { PR_ATTACHADDR, "PR_ATTACHADDR" },
142 { PR_DETACHADDR, "PR_DETACHADDR" },
145 { PR_TERMCHILD, "PR_TERMCHILD" },
148 { PR_GETSHMASK, "PR_GETSHMASK" },
151 { PR_GETNSHARE, "PR_GETNSHARE" },
154 { PR_COREPID, "PR_COREPID" },
156 #ifdef PR_ATTACHADDRPERM
157 { PR_ATTACHADDRPERM, "PR_ATTACHADDRPERM" },
159 #ifdef PR_PTHREADEXIT
160 { PR_PTHREADEXIT, "PR_PTHREADEXIT" },
163 #ifdef PR_SET_PDEATHSIG
164 { PR_SET_PDEATHSIG, "PR_SET_PDEATHSIG" },
166 #ifdef PR_GET_PDEATHSIG
167 { PR_GET_PDEATHSIG, "PR_GET_PDEATHSIG" },
169 #ifdef PR_GET_DUMPABLE
170 { PR_GET_DUMPABLE, "PR_GET_DUMPABLE" },
172 #ifdef PR_SET_DUMPABLE
173 { PR_SET_DUMPABLE, "PR_SET_DUMPABLE" },
175 #ifdef PR_GET_UNALIGN
176 { PR_GET_UNALIGN, "PR_GET_UNALIGN" },
178 #ifdef PR_SET_UNALIGN
179 { PR_SET_UNALIGN, "PR_SET_UNALIGN" },
181 #ifdef PR_GET_KEEPCAPS
182 { PR_GET_KEEPCAPS, "PR_GET_KEEPCAPS" },
184 #ifdef PR_SET_KEEPCAPS
185 { PR_SET_KEEPCAPS, "PR_SET_KEEPCAPS" },
188 { PR_GET_FPEMU, "PR_GET_FPEMU" },
191 { PR_SET_FPEMU, "PR_SET_FPEMU" },
194 { PR_GET_FPEXC, "PR_GET_FPEXC" },
197 { PR_SET_FPEXC, "PR_SET_FPEXC" },
200 { PR_GET_TIMING, "PR_GET_TIMING" },
203 { PR_SET_TIMING, "PR_SET_TIMING" },
206 { PR_SET_NAME, "PR_SET_NAME" },
209 { PR_GET_NAME, "PR_GET_NAME" },
212 { PR_GET_ENDIAN, "PR_GET_ENDIAN" },
215 { PR_SET_ENDIAN, "PR_SET_ENDIAN" },
217 #ifdef PR_GET_SECCOMP
218 { PR_GET_SECCOMP, "PR_GET_SECCOMP" },
220 #ifdef PR_SET_SECCOMP
221 { PR_SET_SECCOMP, "PR_SET_SECCOMP" },
223 #ifdef PR_CAPBSET_READ
224 { PR_CAPBSET_READ, "PR_CAPBSET_READ" },
226 #ifdef PR_CAPBSET_DROP
227 { PR_CAPBSET_DROP, "PR_CAPBSET_DROP" },
230 { PR_GET_TSC, "PR_GET_TSC" },
233 { PR_SET_TSC, "PR_SET_TSC" },
235 #ifdef PR_GET_SECUREBITS
236 { PR_GET_SECUREBITS, "PR_GET_SECUREBITS" },
238 #ifdef PR_SET_SECUREBITS
239 { PR_SET_SECUREBITS, "PR_SET_SECUREBITS" },
241 #ifdef PR_SET_TIMERSLACK
242 { PR_SET_TIMERSLACK, "PR_SET_TIMERSLACK" },
244 #ifdef PR_GET_TIMERSLACK
245 { PR_GET_TIMERSLACK, "PR_GET_TIMERSLACK" },
247 #ifdef PR_TASK_PERF_EVENTS_DISABLE
248 { PR_TASK_PERF_EVENTS_DISABLE, "PR_TASK_PERF_EVENTS_DISABLE" },
250 #ifdef PR_TASK_PERF_EVENTS_ENABLE
251 { PR_TASK_PERF_EVENTS_ENABLE, "PR_TASK_PERF_EVENTS_ENABLE" },
254 { PR_MCE_KILL, "PR_MCE_KILL" },
256 #ifdef PR_MCE_KILL_GET
257 { PR_MCE_KILL_GET, "PR_MCE_KILL_GET" },
260 { PR_SET_MM, "PR_SET_MM" },
262 #ifdef PR_SET_CHILD_SUBREAPER
263 { PR_SET_CHILD_SUBREAPER, "PR_SET_CHILD_SUBREAPER" },
265 #ifdef PR_GET_CHILD_SUBREAPER
266 { PR_GET_CHILD_SUBREAPER, "PR_GET_CHILD_SUBREAPER" },
268 #ifdef PR_SET_NO_NEW_PRIVS
269 { PR_SET_NO_NEW_PRIVS, "PR_SET_NO_NEW_PRIVS" },
271 #ifdef PR_GET_NO_NEW_PRIVS
272 { PR_GET_NO_NEW_PRIVS, "PR_GET_NO_NEW_PRIVS" },
274 #ifdef PR_GET_TID_ADDRESS
275 { PR_GET_TID_ADDRESS, "PR_GET_TID_ADDRESS" },
281 unalignctl_string(unsigned int ctl)
283 static char buf[sizeof(int)*2 + 2];
286 #ifdef PR_UNALIGN_NOPRINT
287 case PR_UNALIGN_NOPRINT:
290 #ifdef PR_UNALIGN_SIGBUS
291 case PR_UNALIGN_SIGBUS:
297 sprintf(buf, "%x", ctl);
302 sys_prctl(struct tcb *tcp)
307 printxval(prctl_options, tcp->u_arg[0], "PR_???");
308 switch (tcp->u_arg[0]) {
313 #ifdef PR_SET_PDEATHSIG
314 case PR_SET_PDEATHSIG:
315 tprintf(", %lu", tcp->u_arg[1]);
318 #ifdef PR_GET_PDEATHSIG
319 case PR_GET_PDEATHSIG:
322 #ifdef PR_SET_DUMPABLE
323 case PR_SET_DUMPABLE:
324 tprintf(", %lu", tcp->u_arg[1]);
327 #ifdef PR_GET_DUMPABLE
328 case PR_GET_DUMPABLE:
331 #ifdef PR_SET_UNALIGN
333 tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
336 #ifdef PR_GET_UNALIGN
338 tprintf(", %#lx", tcp->u_arg[1]);
341 #ifdef PR_SET_KEEPCAPS
342 case PR_SET_KEEPCAPS:
343 tprintf(", %lu", tcp->u_arg[1]);
346 #ifdef PR_GET_KEEPCAPS
347 case PR_GET_KEEPCAPS:
351 for (i = 1; i < tcp->s_ent->nargs; i++)
352 tprintf(", %#lx", tcp->u_arg[i]);
356 switch (tcp->u_arg[0]) {
357 #ifdef PR_GET_PDEATHSIG
358 case PR_GET_PDEATHSIG:
359 if (umove(tcp, tcp->u_arg[1], &i) < 0)
360 tprintf(", %#lx", tcp->u_arg[1]);
362 tprintf(", {%u}", i);
365 #ifdef PR_GET_DUMPABLE
366 case PR_GET_DUMPABLE:
367 return RVAL_UDECIMAL;
369 #ifdef PR_GET_UNALIGN
371 if (syserror(tcp) || umove(tcp, tcp->u_arg[1], &i) < 0)
373 tcp->auxstr = unalignctl_string(i);
376 #ifdef PR_GET_KEEPCAPS
377 case PR_GET_KEEPCAPS:
378 return RVAL_UDECIMAL;
386 #endif /* HAVE_PRCTL */
389 sys_sethostname(struct tcb *tcp)
392 printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
393 tprintf(", %lu", tcp->u_arg[1]);
400 sys_gethostname(struct tcb *tcp)
404 tprintf("%#lx", tcp->u_arg[0]);
406 printpath(tcp, tcp->u_arg[0]);
407 tprintf(", %lu", tcp->u_arg[1]);
414 sys_setdomainname(struct tcb *tcp)
417 printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
418 tprintf(", %lu", tcp->u_arg[1]);
424 sys_exit(struct tcb *tcp)
427 fprintf(stderr, "_exit returned!\n");
430 /* special case: we stop tracing this process, finish line now */
431 tprintf("%ld) ", tcp->u_arg[0]);
438 /* defines copied from linux/sched.h since we can't include that
439 * ourselves (it conflicts with *lots* of libc includes)
441 #define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
442 #define CLONE_VM 0x00000100 /* set if VM shared between processes */
443 #define CLONE_FS 0x00000200 /* set if fs info shared between processes */
444 #define CLONE_FILES 0x00000400 /* set if open files shared between processes */
445 #define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */
446 #define CLONE_IDLETASK 0x00001000 /* kernel-only flag */
447 #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
448 #define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
449 #define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
450 #define CLONE_THREAD 0x00010000 /* Same thread group? */
451 #define CLONE_NEWNS 0x00020000 /* New namespace group? */
452 #define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
453 #define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
454 #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
455 #define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
456 #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
457 #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
458 #define CLONE_STOPPED 0x02000000 /* Start in stopped state */
459 #define CLONE_NEWUTS 0x04000000 /* New utsname group? */
460 #define CLONE_NEWIPC 0x08000000 /* New ipcs */
461 #define CLONE_NEWUSER 0x10000000 /* New user namespace */
462 #define CLONE_NEWPID 0x20000000 /* New pid namespace */
463 #define CLONE_NEWNET 0x40000000 /* New network namespace */
464 #define CLONE_IO 0x80000000 /* Clone io context */
466 static const struct xlat clone_flags[] = {
467 { CLONE_VM, "CLONE_VM" },
468 { CLONE_FS, "CLONE_FS" },
469 { CLONE_FILES, "CLONE_FILES" },
470 { CLONE_SIGHAND, "CLONE_SIGHAND" },
471 { CLONE_IDLETASK, "CLONE_IDLETASK" },
472 { CLONE_PTRACE, "CLONE_PTRACE" },
473 { CLONE_VFORK, "CLONE_VFORK" },
474 { CLONE_PARENT, "CLONE_PARENT" },
475 { CLONE_THREAD, "CLONE_THREAD" },
476 { CLONE_NEWNS, "CLONE_NEWNS" },
477 { CLONE_SYSVSEM, "CLONE_SYSVSEM" },
478 { CLONE_SETTLS, "CLONE_SETTLS" },
479 { CLONE_PARENT_SETTID, "CLONE_PARENT_SETTID" },
480 { CLONE_CHILD_CLEARTID, "CLONE_CHILD_CLEARTID" },
481 { CLONE_UNTRACED, "CLONE_UNTRACED" },
482 { CLONE_CHILD_SETTID, "CLONE_CHILD_SETTID" },
483 { CLONE_STOPPED, "CLONE_STOPPED" },
484 { CLONE_NEWUTS, "CLONE_NEWUTS" },
485 { CLONE_NEWIPC, "CLONE_NEWIPC" },
486 { CLONE_NEWUSER, "CLONE_NEWUSER" },
487 { CLONE_NEWPID, "CLONE_NEWPID" },
488 { CLONE_NEWNET, "CLONE_NEWNET" },
489 { CLONE_IO, "CLONE_IO" },
494 # include <asm/ldt.h>
495 # ifdef HAVE_STRUCT_USER_DESC
496 # define modify_ldt_ldt_s user_desc
498 extern void print_ldt_entry();
504 # define ARG_STACKSIZE (tcp->scno == SYS_clone2 ? 2 : -1)
505 # define ARG_PTID (tcp->scno == SYS_clone2 ? 3 : 2)
506 # define ARG_CTID (tcp->scno == SYS_clone2 ? 4 : 3)
507 # define ARG_TLS (tcp->scno == SYS_clone2 ? 5 : 4)
508 #elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
514 #elif defined X86_64 || defined X32 || defined ALPHA || defined TILE \
530 sys_clone(struct tcb *tcp)
533 const char *sep = "|";
534 unsigned long flags = tcp->u_arg[ARG_FLAGS];
535 tprintf("child_stack=%#lx, ", tcp->u_arg[ARG_STACK]);
537 if (ARG_STACKSIZE != -1)
538 tprintf("stack_size=%#lx, ",
539 tcp->u_arg[ARG_STACKSIZE]);
542 if (!printflags(clone_flags, flags &~ CSIGNAL, NULL))
544 if ((flags & CSIGNAL) != 0)
545 tprintf("%s%s", sep, signame(flags & CSIGNAL));
546 if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID
547 |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
549 if (flags & CLONE_PARENT_SETTID)
550 tprintf(", parent_tidptr=%#lx", tcp->u_arg[ARG_PTID]);
551 if (flags & CLONE_SETTLS) {
553 struct modify_ldt_ldt_s copy;
554 if (umove(tcp, tcp->u_arg[ARG_TLS], ©) != -1) {
555 tprintf(", {entry_number:%d, ",
560 print_ldt_entry(©);
564 tprintf(", tls=%#lx", tcp->u_arg[ARG_TLS]);
566 if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID))
567 tprintf(", child_tidptr=%#lx", tcp->u_arg[ARG_CTID]);
573 sys_unshare(struct tcb *tcp)
576 printflags(clone_flags, tcp->u_arg[0], "CLONE_???");
581 sys_fork(struct tcb *tcp)
584 return RVAL_UDECIMAL;
589 sys_vfork(struct tcb *tcp)
592 return RVAL_UDECIMAL;
596 int sys_getuid(struct tcb *tcp)
599 tcp->u_rval = (uid_t) tcp->u_rval;
600 return RVAL_UDECIMAL;
603 int sys_setfsuid(struct tcb *tcp)
606 tprintf("%u", (uid_t) tcp->u_arg[0]);
608 tcp->u_rval = (uid_t) tcp->u_rval;
609 return RVAL_UDECIMAL;
613 sys_setuid(struct tcb *tcp)
616 tprintf("%u", (uid_t) tcp->u_arg[0]);
622 sys_getresuid(struct tcb *tcp)
627 tprintf("%#lx, %#lx, %#lx", tcp->u_arg[0],
628 tcp->u_arg[1], tcp->u_arg[2]);
630 if (umove(tcp, tcp->u_arg[0], &uid) < 0)
631 tprintf("%#lx, ", tcp->u_arg[0]);
633 tprintf("[%lu], ", (unsigned long) uid);
634 if (umove(tcp, tcp->u_arg[1], &uid) < 0)
635 tprintf("%#lx, ", tcp->u_arg[1]);
637 tprintf("[%lu], ", (unsigned long) uid);
638 if (umove(tcp, tcp->u_arg[2], &uid) < 0)
639 tprintf("%#lx", tcp->u_arg[2]);
641 tprintf("[%lu]", (unsigned long) uid);
648 sys_setreuid(struct tcb *tcp)
651 printuid("", tcp->u_arg[0]);
652 printuid(", ", tcp->u_arg[1]);
658 sys_setresuid(struct tcb *tcp)
661 printuid("", tcp->u_arg[0]);
662 printuid(", ", tcp->u_arg[1]);
663 printuid(", ", tcp->u_arg[2]);
669 sys_setgroups(struct tcb *tcp)
672 unsigned long len, size, start, cur, end, abbrev_end;
677 tprintf("%lu, ", len);
682 start = tcp->u_arg[1];
687 size = len * sizeof(gid);
689 if (!verbose(tcp) || size / sizeof(gid) != len || end < start) {
690 tprintf("%#lx", start);
694 abbrev_end = start + max_strlen * sizeof(gid);
695 if (abbrev_end < start)
701 for (cur = start; cur < end; cur += sizeof(gid)) {
704 if (cur >= abbrev_end) {
708 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
713 tprintf("%lu", (unsigned long) gid);
717 tprintf(" %#lx", tcp->u_arg[1]);
723 sys_getgroups(struct tcb *tcp)
729 tprintf("%lu, ", len);
731 unsigned long size, start, cur, end, abbrev_end;
740 start = tcp->u_arg[1];
745 if (tcp->u_arg[0] == 0) {
746 tprintf("%#lx", start);
749 size = len * sizeof(gid);
751 if (!verbose(tcp) || tcp->u_arg[0] == 0 ||
752 size / sizeof(gid) != len || end < start) {
753 tprintf("%#lx", start);
757 abbrev_end = start + max_strlen * sizeof(gid);
758 if (abbrev_end < start)
764 for (cur = start; cur < end; cur += sizeof(gid)) {
767 if (cur >= abbrev_end) {
771 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
776 tprintf("%lu", (unsigned long) gid);
780 tprintf(" %#lx", tcp->u_arg[1]);
786 sys_setgroups32(struct tcb *tcp)
789 unsigned long len, size, start, cur, end, abbrev_end;
794 tprintf("%lu, ", len);
799 start = tcp->u_arg[1];
804 size = len * sizeof(gid);
806 if (!verbose(tcp) || size / sizeof(gid) != len || end < start) {
807 tprintf("%#lx", start);
811 abbrev_end = start + max_strlen * sizeof(gid);
812 if (abbrev_end < start)
818 for (cur = start; cur < end; cur += sizeof(gid)) {
821 if (cur >= abbrev_end) {
825 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
830 tprintf("%lu", (unsigned long) gid);
834 tprintf(" %#lx", tcp->u_arg[1]);
840 sys_getgroups32(struct tcb *tcp)
846 tprintf("%lu, ", len);
848 unsigned long size, start, cur, end, abbrev_end;
857 start = tcp->u_arg[1];
862 size = len * sizeof(gid);
864 if (!verbose(tcp) || tcp->u_arg[0] == 0 ||
865 size / sizeof(gid) != len || end < start) {
866 tprintf("%#lx", start);
870 abbrev_end = start + max_strlen * sizeof(gid);
871 if (abbrev_end < start)
877 for (cur = start; cur < end; cur += sizeof(gid)) {
880 if (cur >= abbrev_end) {
884 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
889 tprintf("%lu", (unsigned long) gid);
893 tprintf(" %#lx", tcp->u_arg[1]);
899 printargv(struct tcb *tcp, long addr)
904 char data[sizeof(long)];
908 unsigned wordsize = current_wordsize;
911 for (sep = ""; !abbrev(tcp) || n < max_strlen / 2; sep = ", ", ++n) {
912 if (umoven(tcp, addr, wordsize, cp.data) < 0) {
913 tprintf("%#lx", addr);
921 printstr(tcp, cp.p64, -1);
925 tprintf("%s...", sep);
929 printargc(const char *fmt, struct tcb *tcp, long addr)
934 for (count = 0; umove(tcp, addr, &cp) >= 0 && cp != NULL; count++) {
935 addr += sizeof(char *);
937 tprintf(fmt, count, count == 1 ? "" : "s");
940 #if defined(SPARC) || defined(SPARC64)
942 sys_execv(struct tcb *tcp)
945 printpath(tcp, tcp->u_arg[0]);
947 tprintf(", %#lx", tcp->u_arg[1]);
950 printargv(tcp, tcp->u_arg[1]);
959 sys_execve(struct tcb *tcp)
962 printpath(tcp, tcp->u_arg[0]);
964 tprintf(", %#lx", tcp->u_arg[1]);
967 printargv(tcp, tcp->u_arg[1]);
971 tprintf(", %#lx", tcp->u_arg[2]);
972 else if (abbrev(tcp))
973 printargc(", [/* %d var%s */]", tcp, tcp->u_arg[2]);
976 printargv(tcp, tcp->u_arg[2]);
984 #define __WNOTHREAD 0x20000000
987 #define __WALL 0x40000000
990 #define __WCLONE 0x80000000
993 static const struct xlat wait4_options[] = {
994 { WNOHANG, "WNOHANG" },
996 { WUNTRACED, "WUNTRACED" },
999 { WEXITED, "WEXITED" },
1002 { WTRAPPED, "WTRAPPED" },
1005 { WSTOPPED, "WSTOPPED" },
1008 { WCONTINUED, "WCONTINUED" },
1011 { WNOWAIT, "WNOWAIT" },
1014 { __WCLONE, "__WCLONE" },
1017 { __WALL, "__WALL" },
1020 { __WNOTHREAD, "__WNOTHREAD" },
1025 #if !defined WCOREFLAG && defined WCOREFLG
1026 # define WCOREFLAG WCOREFLG
1029 # define WCOREFLAG 0x80
1032 # define WCOREDUMP(status) ((status) & 0200)
1035 # define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
1038 # define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
1042 printstatus(int status)
1047 * Here is a tricky presentation problem. This solution
1048 * is still not entirely satisfactory but since there
1049 * are no wait status constructors it will have to do.
1051 if (WIFSTOPPED(status)) {
1052 tprintf("[{WIFSTOPPED(s) && WSTOPSIG(s) == %s}",
1053 signame(WSTOPSIG(status)));
1054 status &= ~W_STOPCODE(WSTOPSIG(status));
1056 else if (WIFSIGNALED(status)) {
1057 tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}",
1058 signame(WTERMSIG(status)),
1059 WCOREDUMP(status) ? " && WCOREDUMP(s)" : "");
1060 status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG);
1062 else if (WIFEXITED(status)) {
1063 tprintf("[{WIFEXITED(s) && WEXITSTATUS(s) == %d}",
1064 WEXITSTATUS(status));
1066 status &= ~W_EXITCODE(WEXITSTATUS(status), 0);
1069 tprintf("[%#x]", status);
1076 tprintf(" | %#x]", status);
1082 printwaitn(struct tcb *tcp, int n, int bitness)
1086 if (entering(tcp)) {
1087 /* On Linux, kernel-side pid_t is typedef'ed to int
1088 * on all arches. Also, glibc-2.8 truncates wait3 and wait4
1089 * pid argument to int on 64bit arches, producing,
1090 * for example, wait4(4294967295, ...) instead of -1
1091 * in strace. We have to use int here, not long.
1093 int pid = tcp->u_arg[0];
1094 tprintf("%d, ", pid);
1099 else if (syserror(tcp) || tcp->u_rval == 0)
1100 tprintf("%#lx", tcp->u_arg[1]);
1101 else if (umove(tcp, tcp->u_arg[1], &status) < 0)
1104 printstatus(status);
1107 printflags(wait4_options, tcp->u_arg[2], "W???");
1113 else if (tcp->u_rval > 0) {
1116 printrusage32(tcp, tcp->u_arg[3]);
1119 printrusage(tcp, tcp->u_arg[3]);
1122 tprintf("%#lx", tcp->u_arg[3]);
1129 sys_waitpid(struct tcb *tcp)
1131 return printwaitn(tcp, 3, 0);
1135 sys_wait4(struct tcb *tcp)
1137 return printwaitn(tcp, 4, 0);
1142 sys_osf_wait4(struct tcb *tcp)
1144 return printwaitn(tcp, 4, 1);
1148 static const struct xlat waitid_types[] = {
1151 { P_PPID, "P_PPID" },
1153 { P_PGID, "P_PGID" },
1168 { P_LWPID, "P_LWPID" },
1174 sys_waitid(struct tcb *tcp)
1176 if (entering(tcp)) {
1177 printxval(waitid_types, tcp->u_arg[0], "P_???");
1178 tprintf(", %ld, ", tcp->u_arg[1]);
1182 printsiginfo_at(tcp, tcp->u_arg[2]);
1185 printflags(wait4_options, tcp->u_arg[3], "W???");
1186 if (tcp->s_ent->nargs > 4) {
1191 else if (tcp->u_error)
1192 tprintf("%#lx", tcp->u_arg[4]);
1194 printrusage(tcp, tcp->u_arg[4]);
1201 sys_uname(struct tcb *tcp)
1203 struct utsname uname;
1206 if (syserror(tcp) || !verbose(tcp))
1207 tprintf("%#lx", tcp->u_arg[0]);
1208 else if (umove(tcp, tcp->u_arg[0], &uname) < 0)
1210 else if (!abbrev(tcp)) {
1211 tprintf("{sysname=\"%s\", nodename=\"%s\", ",
1212 uname.sysname, uname.nodename);
1213 tprintf("release=\"%s\", version=\"%s\", ",
1214 uname.release, uname.version);
1215 tprintf("machine=\"%s\"", uname.machine);
1216 #ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
1217 tprintf(", domainname=\"%s\"", uname.domainname);
1222 tprintf("{sys=\"%s\", node=\"%s\", ...}",
1223 uname.sysname, uname.nodename);
1228 static const struct xlat ptrace_cmds[] = {
1229 { PTRACE_TRACEME, "PTRACE_TRACEME" },
1230 { PTRACE_PEEKTEXT, "PTRACE_PEEKTEXT" },
1231 { PTRACE_PEEKDATA, "PTRACE_PEEKDATA" },
1232 { PTRACE_PEEKUSER, "PTRACE_PEEKUSER" },
1233 { PTRACE_POKETEXT, "PTRACE_POKETEXT" },
1234 { PTRACE_POKEDATA, "PTRACE_POKEDATA" },
1235 { PTRACE_POKEUSER, "PTRACE_POKEUSER" },
1236 { PTRACE_CONT, "PTRACE_CONT" },
1237 { PTRACE_KILL, "PTRACE_KILL" },
1238 { PTRACE_SINGLESTEP, "PTRACE_SINGLESTEP" },
1239 { PTRACE_ATTACH, "PTRACE_ATTACH" },
1240 { PTRACE_DETACH, "PTRACE_DETACH" },
1241 #ifdef PTRACE_GETREGS
1242 { PTRACE_GETREGS, "PTRACE_GETREGS" },
1244 #ifdef PTRACE_SETREGS
1245 { PTRACE_SETREGS, "PTRACE_SETREGS" },
1247 #ifdef PTRACE_GETFPREGS
1248 { PTRACE_GETFPREGS, "PTRACE_GETFPREGS" },
1250 #ifdef PTRACE_SETFPREGS
1251 { PTRACE_SETFPREGS, "PTRACE_SETFPREGS" },
1253 #ifdef PTRACE_GETFPXREGS
1254 { PTRACE_GETFPXREGS, "PTRACE_GETFPXREGS" },
1256 #ifdef PTRACE_SETFPXREGS
1257 { PTRACE_SETFPXREGS, "PTRACE_SETFPXREGS" },
1259 #ifdef PTRACE_GETVRREGS
1260 { PTRACE_GETVRREGS, "PTRACE_GETVRREGS" },
1262 #ifdef PTRACE_SETVRREGS
1263 { PTRACE_SETVRREGS, "PTRACE_SETVRREGS" },
1265 #ifdef PTRACE_SETOPTIONS
1266 { PTRACE_SETOPTIONS, "PTRACE_SETOPTIONS" },
1268 #ifdef PTRACE_GETEVENTMSG
1269 { PTRACE_GETEVENTMSG, "PTRACE_GETEVENTMSG" },
1271 #ifdef PTRACE_GETSIGINFO
1272 { PTRACE_GETSIGINFO, "PTRACE_GETSIGINFO" },
1274 #ifdef PTRACE_SETSIGINFO
1275 { PTRACE_SETSIGINFO, "PTRACE_SETSIGINFO" },
1277 #ifdef PTRACE_GETREGSET
1278 { PTRACE_GETREGSET, "PTRACE_GETREGSET" },
1280 #ifdef PTRACE_SETREGSET
1281 { PTRACE_SETREGSET, "PTRACE_SETREGSET" },
1283 #ifdef PTRACE_SET_SYSCALL
1284 { PTRACE_SET_SYSCALL, "PTRACE_SET_SYSCALL" },
1287 { PTRACE_SEIZE, "PTRACE_SEIZE" },
1289 #ifdef PTRACE_INTERRUPT
1290 { PTRACE_INTERRUPT, "PTRACE_INTERRUPT" },
1292 #ifdef PTRACE_LISTEN
1293 { PTRACE_LISTEN, "PTRACE_LISTEN" },
1295 { PTRACE_SYSCALL, "PTRACE_SYSCALL" },
1300 #ifdef PTRACE_SETOPTIONS
1301 static const struct xlat ptrace_setoptions_flags[] = {
1302 # ifdef PTRACE_O_TRACESYSGOOD
1303 { PTRACE_O_TRACESYSGOOD,"PTRACE_O_TRACESYSGOOD" },
1305 # ifdef PTRACE_O_TRACEFORK
1306 { PTRACE_O_TRACEFORK, "PTRACE_O_TRACEFORK" },
1308 # ifdef PTRACE_O_TRACEVFORK
1309 { PTRACE_O_TRACEVFORK, "PTRACE_O_TRACEVFORK" },
1311 # ifdef PTRACE_O_TRACECLONE
1312 { PTRACE_O_TRACECLONE, "PTRACE_O_TRACECLONE" },
1314 # ifdef PTRACE_O_TRACEEXEC
1315 { PTRACE_O_TRACEEXEC, "PTRACE_O_TRACEEXEC" },
1317 # ifdef PTRACE_O_TRACEVFORKDONE
1318 { PTRACE_O_TRACEVFORKDONE,"PTRACE_O_TRACEVFORKDONE"},
1320 # ifdef PTRACE_O_TRACEEXIT
1321 { PTRACE_O_TRACEEXIT, "PTRACE_O_TRACEEXIT" },
1325 #endif /* PTRACE_SETOPTIONS */
1327 static const struct xlat nt_descriptor_types[] = {
1329 { NT_PRSTATUS, "NT_PRSTATUS" },
1332 { NT_FPREGSET, "NT_FPREGSET" },
1335 { NT_PRPSINFO, "NT_PRPSINFO" },
1338 { NT_PRXREG, "NT_PRXREG" },
1340 #ifdef NT_TASKSTRUCT
1341 { NT_TASKSTRUCT, "NT_TASKSTRUCT" },
1344 { NT_PLATFORM, "NT_PLATFORM" },
1347 { NT_AUXV, "NT_AUXV" },
1350 { NT_GWINDOWS, "NT_GWINDOWS" },
1353 { NT_ASRS, "NT_ASRS" },
1356 { NT_PSTATUS, "NT_PSTATUS" },
1359 { NT_PSINFO, "NT_PSINFO" },
1362 { NT_PRCRED, "NT_PRCRED" },
1365 { NT_UTSNAME, "NT_UTSNAME" },
1368 { NT_LWPSTATUS, "NT_LWPSTATUS" },
1371 { NT_LWPSINFO, "NT_LWPSINFO" },
1374 { NT_PRFPXREG, "NT_PRFPXREG" },
1377 { NT_PRXFPREG, "NT_PRXFPREG" },
1380 { NT_PPC_VMX, "NT_PPC_VMX" },
1383 { NT_PPC_SPE, "NT_PPC_SPE" },
1386 { NT_PPC_VSX, "NT_PPC_VSX" },
1389 { NT_386_TLS, "NT_386_TLS" },
1391 #ifdef NT_386_IOPERM
1392 { NT_386_IOPERM, "NT_386_IOPERM" },
1394 #ifdef NT_X86_XSTATE
1395 { NT_X86_XSTATE, "NT_X86_XSTATE" },
1400 #define uoff(member) offsetof(struct user, member)
1402 const struct xlat struct_user_offsets[] = {
1403 #if defined(S390) || defined(S390X)
1404 { PT_PSWMASK, "psw_mask" },
1405 { PT_PSWADDR, "psw_addr" },
1406 { PT_GPR0, "gpr0" },
1407 { PT_GPR1, "gpr1" },
1408 { PT_GPR2, "gpr2" },
1409 { PT_GPR3, "gpr3" },
1410 { PT_GPR4, "gpr4" },
1411 { PT_GPR5, "gpr5" },
1412 { PT_GPR6, "gpr6" },
1413 { PT_GPR7, "gpr7" },
1414 { PT_GPR8, "gpr8" },
1415 { PT_GPR9, "gpr9" },
1416 { PT_GPR10, "gpr10" },
1417 { PT_GPR11, "gpr11" },
1418 { PT_GPR12, "gpr12" },
1419 { PT_GPR13, "gpr13" },
1420 { PT_GPR14, "gpr14" },
1421 { PT_GPR15, "gpr15" },
1422 { PT_ACR0, "acr0" },
1423 { PT_ACR1, "acr1" },
1424 { PT_ACR2, "acr2" },
1425 { PT_ACR3, "acr3" },
1426 { PT_ACR4, "acr4" },
1427 { PT_ACR5, "acr5" },
1428 { PT_ACR6, "acr6" },
1429 { PT_ACR7, "acr7" },
1430 { PT_ACR8, "acr8" },
1431 { PT_ACR9, "acr9" },
1432 { PT_ACR10, "acr10" },
1433 { PT_ACR11, "acr11" },
1434 { PT_ACR12, "acr12" },
1435 { PT_ACR13, "acr13" },
1436 { PT_ACR14, "acr14" },
1437 { PT_ACR15, "acr15" },
1438 { PT_ORIGGPR2, "orig_gpr2" },
1441 { PT_FPR0_HI, "fpr0.hi" },
1442 { PT_FPR0_LO, "fpr0.lo" },
1443 { PT_FPR1_HI, "fpr1.hi" },
1444 { PT_FPR1_LO, "fpr1.lo" },
1445 { PT_FPR2_HI, "fpr2.hi" },
1446 { PT_FPR2_LO, "fpr2.lo" },
1447 { PT_FPR3_HI, "fpr3.hi" },
1448 { PT_FPR3_LO, "fpr3.lo" },
1449 { PT_FPR4_HI, "fpr4.hi" },
1450 { PT_FPR4_LO, "fpr4.lo" },
1451 { PT_FPR5_HI, "fpr5.hi" },
1452 { PT_FPR5_LO, "fpr5.lo" },
1453 { PT_FPR6_HI, "fpr6.hi" },
1454 { PT_FPR6_LO, "fpr6.lo" },
1455 { PT_FPR7_HI, "fpr7.hi" },
1456 { PT_FPR7_LO, "fpr7.lo" },
1457 { PT_FPR8_HI, "fpr8.hi" },
1458 { PT_FPR8_LO, "fpr8.lo" },
1459 { PT_FPR9_HI, "fpr9.hi" },
1460 { PT_FPR9_LO, "fpr9.lo" },
1461 { PT_FPR10_HI, "fpr10.hi" },
1462 { PT_FPR10_LO, "fpr10.lo" },
1463 { PT_FPR11_HI, "fpr11.hi" },
1464 { PT_FPR11_LO, "fpr11.lo" },
1465 { PT_FPR12_HI, "fpr12.hi" },
1466 { PT_FPR12_LO, "fpr12.lo" },
1467 { PT_FPR13_HI, "fpr13.hi" },
1468 { PT_FPR13_LO, "fpr13.lo" },
1469 { PT_FPR14_HI, "fpr14.hi" },
1470 { PT_FPR14_LO, "fpr14.lo" },
1471 { PT_FPR15_HI, "fpr15.hi" },
1472 { PT_FPR15_LO, "fpr15.lo" },
1475 { PT_FPR0, "fpr0" },
1476 { PT_FPR1, "fpr1" },
1477 { PT_FPR2, "fpr2" },
1478 { PT_FPR3, "fpr3" },
1479 { PT_FPR4, "fpr4" },
1480 { PT_FPR5, "fpr5" },
1481 { PT_FPR6, "fpr6" },
1482 { PT_FPR7, "fpr7" },
1483 { PT_FPR8, "fpr8" },
1484 { PT_FPR9, "fpr9" },
1485 { PT_FPR10, "fpr10" },
1486 { PT_FPR11, "fpr11" },
1487 { PT_FPR12, "fpr12" },
1488 { PT_FPR13, "fpr13" },
1489 { PT_FPR14, "fpr14" },
1490 { PT_FPR15, "fpr15" },
1493 { PT_CR_10, "cr10" },
1494 { PT_CR_11, "cr11" },
1495 { PT_IEEE_IP, "ieee_exception_ip" },
1496 #elif defined(SPARC)
1497 /* XXX No support for these offsets yet. */
1499 /* XXX No support for these offsets yet. */
1500 #elif defined(POWERPC)
1502 # define PT_ORIG_R3 34
1504 # define REGSIZE (sizeof(unsigned long))
1505 { REGSIZE*PT_R0, "r0" },
1506 { REGSIZE*PT_R1, "r1" },
1507 { REGSIZE*PT_R2, "r2" },
1508 { REGSIZE*PT_R3, "r3" },
1509 { REGSIZE*PT_R4, "r4" },
1510 { REGSIZE*PT_R5, "r5" },
1511 { REGSIZE*PT_R6, "r6" },
1512 { REGSIZE*PT_R7, "r7" },
1513 { REGSIZE*PT_R8, "r8" },
1514 { REGSIZE*PT_R9, "r9" },
1515 { REGSIZE*PT_R10, "r10" },
1516 { REGSIZE*PT_R11, "r11" },
1517 { REGSIZE*PT_R12, "r12" },
1518 { REGSIZE*PT_R13, "r13" },
1519 { REGSIZE*PT_R14, "r14" },
1520 { REGSIZE*PT_R15, "r15" },
1521 { REGSIZE*PT_R16, "r16" },
1522 { REGSIZE*PT_R17, "r17" },
1523 { REGSIZE*PT_R18, "r18" },
1524 { REGSIZE*PT_R19, "r19" },
1525 { REGSIZE*PT_R20, "r20" },
1526 { REGSIZE*PT_R21, "r21" },
1527 { REGSIZE*PT_R22, "r22" },
1528 { REGSIZE*PT_R23, "r23" },
1529 { REGSIZE*PT_R24, "r24" },
1530 { REGSIZE*PT_R25, "r25" },
1531 { REGSIZE*PT_R26, "r26" },
1532 { REGSIZE*PT_R27, "r27" },
1533 { REGSIZE*PT_R28, "r28" },
1534 { REGSIZE*PT_R29, "r29" },
1535 { REGSIZE*PT_R30, "r30" },
1536 { REGSIZE*PT_R31, "r31" },
1537 { REGSIZE*PT_NIP, "NIP" },
1538 { REGSIZE*PT_MSR, "MSR" },
1539 { REGSIZE*PT_ORIG_R3, "ORIG_R3" },
1540 { REGSIZE*PT_CTR, "CTR" },
1541 { REGSIZE*PT_LNK, "LNK" },
1542 { REGSIZE*PT_XER, "XER" },
1543 { REGSIZE*PT_CCR, "CCR" },
1544 { REGSIZE*PT_FPR0, "FPR0" },
1546 #elif defined(ALPHA)
1613 { PT_F32, "f32" }, { PT_F33, "f33" }, { PT_F34, "f34" },
1614 { PT_F35, "f35" }, { PT_F36, "f36" }, { PT_F37, "f37" },
1615 { PT_F38, "f38" }, { PT_F39, "f39" }, { PT_F40, "f40" },
1616 { PT_F41, "f41" }, { PT_F42, "f42" }, { PT_F43, "f43" },
1617 { PT_F44, "f44" }, { PT_F45, "f45" }, { PT_F46, "f46" },
1618 { PT_F47, "f47" }, { PT_F48, "f48" }, { PT_F49, "f49" },
1619 { PT_F50, "f50" }, { PT_F51, "f51" }, { PT_F52, "f52" },
1620 { PT_F53, "f53" }, { PT_F54, "f54" }, { PT_F55, "f55" },
1621 { PT_F56, "f56" }, { PT_F57, "f57" }, { PT_F58, "f58" },
1622 { PT_F59, "f59" }, { PT_F60, "f60" }, { PT_F61, "f61" },
1623 { PT_F62, "f62" }, { PT_F63, "f63" }, { PT_F64, "f64" },
1624 { PT_F65, "f65" }, { PT_F66, "f66" }, { PT_F67, "f67" },
1625 { PT_F68, "f68" }, { PT_F69, "f69" }, { PT_F70, "f70" },
1626 { PT_F71, "f71" }, { PT_F72, "f72" }, { PT_F73, "f73" },
1627 { PT_F74, "f74" }, { PT_F75, "f75" }, { PT_F76, "f76" },
1628 { PT_F77, "f77" }, { PT_F78, "f78" }, { PT_F79, "f79" },
1629 { PT_F80, "f80" }, { PT_F81, "f81" }, { PT_F82, "f82" },
1630 { PT_F83, "f83" }, { PT_F84, "f84" }, { PT_F85, "f85" },
1631 { PT_F86, "f86" }, { PT_F87, "f87" }, { PT_F88, "f88" },
1632 { PT_F89, "f89" }, { PT_F90, "f90" }, { PT_F91, "f91" },
1633 { PT_F92, "f92" }, { PT_F93, "f93" }, { PT_F94, "f94" },
1634 { PT_F95, "f95" }, { PT_F96, "f96" }, { PT_F97, "f97" },
1635 { PT_F98, "f98" }, { PT_F99, "f99" }, { PT_F100, "f100" },
1636 { PT_F101, "f101" }, { PT_F102, "f102" }, { PT_F103, "f103" },
1637 { PT_F104, "f104" }, { PT_F105, "f105" }, { PT_F106, "f106" },
1638 { PT_F107, "f107" }, { PT_F108, "f108" }, { PT_F109, "f109" },
1639 { PT_F110, "f110" }, { PT_F111, "f111" }, { PT_F112, "f112" },
1640 { PT_F113, "f113" }, { PT_F114, "f114" }, { PT_F115, "f115" },
1641 { PT_F116, "f116" }, { PT_F117, "f117" }, { PT_F118, "f118" },
1642 { PT_F119, "f119" }, { PT_F120, "f120" }, { PT_F121, "f121" },
1643 { PT_F122, "f122" }, { PT_F123, "f123" }, { PT_F124, "f124" },
1644 { PT_F125, "f125" }, { PT_F126, "f126" }, { PT_F127, "f127" },
1646 { PT_F2, "f2" }, { PT_F3, "f3" }, { PT_F4, "f4" },
1647 { PT_F5, "f5" }, { PT_F10, "f10" }, { PT_F11, "f11" },
1648 { PT_F12, "f12" }, { PT_F13, "f13" }, { PT_F14, "f14" },
1649 { PT_F15, "f15" }, { PT_F16, "f16" }, { PT_F17, "f17" },
1650 { PT_F18, "f18" }, { PT_F19, "f19" }, { PT_F20, "f20" },
1651 { PT_F21, "f21" }, { PT_F22, "f22" }, { PT_F23, "f23" },
1652 { PT_F24, "f24" }, { PT_F25, "f25" }, { PT_F26, "f26" },
1653 { PT_F27, "f27" }, { PT_F28, "f28" }, { PT_F29, "f29" },
1654 { PT_F30, "f30" }, { PT_F31, "f31" }, { PT_R4, "r4" },
1655 { PT_R5, "r5" }, { PT_R6, "r6" }, { PT_R7, "r7" },
1656 { PT_B1, "b1" }, { PT_B2, "b2" }, { PT_B3, "b3" },
1657 { PT_B4, "b4" }, { PT_B5, "b5" },
1658 { PT_AR_EC, "ar.ec" }, { PT_AR_LC, "ar.lc" },
1660 { PT_CR_IPSR, "psr" }, { PT_CR_IIP, "ip" },
1661 { PT_CFM, "cfm" }, { PT_AR_UNAT, "ar.unat" },
1662 { PT_AR_PFS, "ar.pfs" }, { PT_AR_RSC, "ar.rsc" },
1663 { PT_AR_RNAT, "ar.rnat" }, { PT_AR_BSPSTORE, "ar.bspstore" },
1664 { PT_PR, "pr" }, { PT_B6, "b6" }, { PT_AR_BSP, "ar.bsp" },
1665 { PT_R1, "r1" }, { PT_R2, "r2" }, { PT_R3, "r3" },
1666 { PT_R12, "r12" }, { PT_R13, "r13" }, { PT_R14, "r14" },
1667 { PT_R15, "r15" }, { PT_R8, "r8" }, { PT_R9, "r9" },
1668 { PT_R10, "r10" }, { PT_R11, "r11" }, { PT_R16, "r16" },
1669 { PT_R17, "r17" }, { PT_R18, "r18" }, { PT_R19, "r19" },
1670 { PT_R20, "r20" }, { PT_R21, "r21" }, { PT_R22, "r22" },
1671 { PT_R23, "r23" }, { PT_R24, "r24" }, { PT_R25, "r25" },
1672 { PT_R26, "r26" }, { PT_R27, "r27" }, { PT_R28, "r28" },
1673 { PT_R29, "r29" }, { PT_R30, "r30" }, { PT_R31, "r31" },
1674 { PT_AR_CCV, "ar.ccv" }, { PT_AR_FPSR, "ar.fpsr" },
1675 { PT_B0, "b0" }, { PT_B7, "b7" }, { PT_F6, "f6" },
1676 { PT_F7, "f7" }, { PT_F8, "f8" }, { PT_F9, "f9" },
1678 { PT_AR_CSD, "ar.csd" },
1681 { PT_AR_SSD, "ar.ssd" },
1683 { PT_DBR, "dbr" }, { PT_IBR, "ibr" }, { PT_PMD, "pmd" },
1696 { 4*ORIG_EAX, "4*ORIG_EAX" },
1700 { 4*UESP, "4*UESP" },
1702 #elif defined(X86_64) || defined(X32)
1718 { 8*ORIG_RAX, "8*ORIG_RAX" },
1721 { 8*EFLAGS, "8*EFL" },
1725 { 4*PT_D1, "4*PT_D1" },
1726 { 4*PT_D2, "4*PT_D2" },
1727 { 4*PT_D3, "4*PT_D3" },
1728 { 4*PT_D4, "4*PT_D4" },
1729 { 4*PT_D5, "4*PT_D5" },
1730 { 4*PT_D6, "4*PT_D6" },
1731 { 4*PT_D7, "4*PT_D7" },
1732 { 4*PT_A0, "4*PT_A0" },
1733 { 4*PT_A1, "4*PT_A1" },
1734 { 4*PT_A2, "4*PT_A2" },
1735 { 4*PT_A3, "4*PT_A3" },
1736 { 4*PT_A4, "4*PT_A4" },
1737 { 4*PT_A5, "4*PT_A5" },
1738 { 4*PT_A6, "4*PT_A6" },
1739 { 4*PT_D0, "4*PT_D0" },
1740 { 4*PT_USP, "4*PT_USP" },
1741 { 4*PT_ORIG_D0, "4*PT_ORIG_D0" },
1742 { 4*PT_SR, "4*PT_SR" },
1743 { 4*PT_PC, "4*PT_PC" },
1745 { 4*REG_REG0, "4*REG_REG0" },
1746 { 4*(REG_REG0+1), "4*REG_REG1" },
1747 { 4*(REG_REG0+2), "4*REG_REG2" },
1748 { 4*(REG_REG0+3), "4*REG_REG3" },
1749 { 4*(REG_REG0+4), "4*REG_REG4" },
1750 { 4*(REG_REG0+5), "4*REG_REG5" },
1751 { 4*(REG_REG0+6), "4*REG_REG6" },
1752 { 4*(REG_REG0+7), "4*REG_REG7" },
1753 { 4*(REG_REG0+8), "4*REG_REG8" },
1754 { 4*(REG_REG0+9), "4*REG_REG9" },
1755 { 4*(REG_REG0+10), "4*REG_REG10" },
1756 { 4*(REG_REG0+11), "4*REG_REG11" },
1757 { 4*(REG_REG0+12), "4*REG_REG12" },
1758 { 4*(REG_REG0+13), "4*REG_REG13" },
1759 { 4*(REG_REG0+14), "4*REG_REG14" },
1760 { 4*REG_REG15, "4*REG_REG15" },
1761 { 4*REG_PC, "4*REG_PC" },
1762 { 4*REG_PR, "4*REG_PR" },
1763 { 4*REG_SR, "4*REG_SR" },
1764 { 4*REG_GBR, "4*REG_GBR" },
1765 { 4*REG_MACH, "4*REG_MACH" },
1766 { 4*REG_MACL, "4*REG_MACL" },
1767 { 4*REG_SYSCALL, "4*REG_SYSCALL" },
1768 { 4*REG_FPUL, "4*REG_FPUL" },
1769 { 4*REG_FPREG0, "4*REG_FPREG0" },
1770 { 4*(REG_FPREG0+1), "4*REG_FPREG1" },
1771 { 4*(REG_FPREG0+2), "4*REG_FPREG2" },
1772 { 4*(REG_FPREG0+3), "4*REG_FPREG3" },
1773 { 4*(REG_FPREG0+4), "4*REG_FPREG4" },
1774 { 4*(REG_FPREG0+5), "4*REG_FPREG5" },
1775 { 4*(REG_FPREG0+6), "4*REG_FPREG6" },
1776 { 4*(REG_FPREG0+7), "4*REG_FPREG7" },
1777 { 4*(REG_FPREG0+8), "4*REG_FPREG8" },
1778 { 4*(REG_FPREG0+9), "4*REG_FPREG9" },
1779 { 4*(REG_FPREG0+10), "4*REG_FPREG10" },
1780 { 4*(REG_FPREG0+11), "4*REG_FPREG11" },
1781 { 4*(REG_FPREG0+12), "4*REG_FPREG12" },
1782 { 4*(REG_FPREG0+13), "4*REG_FPREG13" },
1783 { 4*(REG_FPREG0+14), "4*REG_FPREG14" },
1784 { 4*REG_FPREG15, "4*REG_FPREG15" },
1786 { 4*REG_XDREG0, "4*REG_XDREG0" },
1787 { 4*(REG_XDREG0+2), "4*REG_XDREG2" },
1788 { 4*(REG_XDREG0+4), "4*REG_XDREG4" },
1789 { 4*(REG_XDREG0+6), "4*REG_XDREG6" },
1790 { 4*(REG_XDREG0+8), "4*REG_XDREG8" },
1791 { 4*(REG_XDREG0+10), "4*REG_XDREG10" },
1792 { 4*(REG_XDREG0+12), "4*REG_XDREG12" },
1793 { 4*REG_XDREG14, "4*REG_XDREG14" },
1795 { 4*REG_FPSCR, "4*REG_FPSCR" },
1801 { 16, "syscall no.(L)" },
1802 { 20, "syscall_no.(U)" },
1945 /* This entry is in case pt_regs contains dregs (depends on
1946 the kernel build options). */
1947 { uoff(regs), "offsetof(struct user, regs)" },
1948 { uoff(fpu), "offsetof(struct user, fpu)" },
1950 { uoff(regs.ARM_r0), "r0" },
1951 { uoff(regs.ARM_r1), "r1" },
1952 { uoff(regs.ARM_r2), "r2" },
1953 { uoff(regs.ARM_r3), "r3" },
1954 { uoff(regs.ARM_r4), "r4" },
1955 { uoff(regs.ARM_r5), "r5" },
1956 { uoff(regs.ARM_r6), "r6" },
1957 { uoff(regs.ARM_r7), "r7" },
1958 { uoff(regs.ARM_r8), "r8" },
1959 { uoff(regs.ARM_r9), "r9" },
1960 { uoff(regs.ARM_r10), "r10" },
1961 { uoff(regs.ARM_fp), "fp" },
1962 { uoff(regs.ARM_ip), "ip" },
1963 { uoff(regs.ARM_sp), "sp" },
1964 { uoff(regs.ARM_lr), "lr" },
1965 { uoff(regs.ARM_pc), "pc" },
1966 { uoff(regs.ARM_cpsr), "cpsr" },
1967 #elif defined(AVR32)
1968 { uoff(regs.sr), "sr" },
1969 { uoff(regs.pc), "pc" },
1970 { uoff(regs.lr), "lr" },
1971 { uoff(regs.sp), "sp" },
1972 { uoff(regs.r12), "r12" },
1973 { uoff(regs.r11), "r11" },
1974 { uoff(regs.r10), "r10" },
1975 { uoff(regs.r9), "r9" },
1976 { uoff(regs.r8), "r8" },
1977 { uoff(regs.r7), "r7" },
1978 { uoff(regs.r6), "r6" },
1979 { uoff(regs.r5), "r5" },
1980 { uoff(regs.r4), "r4" },
1981 { uoff(regs.r3), "r3" },
1982 { uoff(regs.r2), "r2" },
1983 { uoff(regs.r1), "r1" },
1984 { uoff(regs.r0), "r0" },
1985 { uoff(regs.r12_orig), "orig_r12" },
2059 { PTREGS_OFFSET_REG(0), "r0" },
2060 { PTREGS_OFFSET_REG(1), "r1" },
2061 { PTREGS_OFFSET_REG(2), "r2" },
2062 { PTREGS_OFFSET_REG(3), "r3" },
2063 { PTREGS_OFFSET_REG(4), "r4" },
2064 { PTREGS_OFFSET_REG(5), "r5" },
2065 { PTREGS_OFFSET_REG(6), "r6" },
2066 { PTREGS_OFFSET_REG(7), "r7" },
2067 { PTREGS_OFFSET_REG(8), "r8" },
2068 { PTREGS_OFFSET_REG(9), "r9" },
2069 { PTREGS_OFFSET_REG(10), "r10" },
2070 { PTREGS_OFFSET_REG(11), "r11" },
2071 { PTREGS_OFFSET_REG(12), "r12" },
2072 { PTREGS_OFFSET_REG(13), "r13" },
2073 { PTREGS_OFFSET_REG(14), "r14" },
2074 { PTREGS_OFFSET_REG(15), "r15" },
2075 { PTREGS_OFFSET_REG(16), "r16" },
2076 { PTREGS_OFFSET_REG(17), "r17" },
2077 { PTREGS_OFFSET_REG(18), "r18" },
2078 { PTREGS_OFFSET_REG(19), "r19" },
2079 { PTREGS_OFFSET_REG(20), "r20" },
2080 { PTREGS_OFFSET_REG(21), "r21" },
2081 { PTREGS_OFFSET_REG(22), "r22" },
2082 { PTREGS_OFFSET_REG(23), "r23" },
2083 { PTREGS_OFFSET_REG(24), "r24" },
2084 { PTREGS_OFFSET_REG(25), "r25" },
2085 { PTREGS_OFFSET_REG(26), "r26" },
2086 { PTREGS_OFFSET_REG(27), "r27" },
2087 { PTREGS_OFFSET_REG(28), "r28" },
2088 { PTREGS_OFFSET_REG(29), "r29" },
2089 { PTREGS_OFFSET_REG(30), "r30" },
2090 { PTREGS_OFFSET_REG(31), "r31" },
2091 { PTREGS_OFFSET_REG(32), "r32" },
2092 { PTREGS_OFFSET_REG(33), "r33" },
2093 { PTREGS_OFFSET_REG(34), "r34" },
2094 { PTREGS_OFFSET_REG(35), "r35" },
2095 { PTREGS_OFFSET_REG(36), "r36" },
2096 { PTREGS_OFFSET_REG(37), "r37" },
2097 { PTREGS_OFFSET_REG(38), "r38" },
2098 { PTREGS_OFFSET_REG(39), "r39" },
2099 { PTREGS_OFFSET_REG(40), "r40" },
2100 { PTREGS_OFFSET_REG(41), "r41" },
2101 { PTREGS_OFFSET_REG(42), "r42" },
2102 { PTREGS_OFFSET_REG(43), "r43" },
2103 { PTREGS_OFFSET_REG(44), "r44" },
2104 { PTREGS_OFFSET_REG(45), "r45" },
2105 { PTREGS_OFFSET_REG(46), "r46" },
2106 { PTREGS_OFFSET_REG(47), "r47" },
2107 { PTREGS_OFFSET_REG(48), "r48" },
2108 { PTREGS_OFFSET_REG(49), "r49" },
2109 { PTREGS_OFFSET_REG(50), "r50" },
2110 { PTREGS_OFFSET_REG(51), "r51" },
2111 { PTREGS_OFFSET_REG(52), "r52" },
2112 { PTREGS_OFFSET_TP, "tp" },
2113 { PTREGS_OFFSET_SP, "sp" },
2114 { PTREGS_OFFSET_LR, "lr" },
2115 { PTREGS_OFFSET_PC, "pc" },
2116 { PTREGS_OFFSET_EX1, "ex1" },
2117 { PTREGS_OFFSET_FAULTNUM, "faultnum" },
2118 { PTREGS_OFFSET_ORIG_R0, "orig_r0" },
2119 { PTREGS_OFFSET_FLAGS, "flags" },
2122 { 4*PT_FRAMETYPE, "4*PT_FRAMETYPE" },
2123 { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
2124 { 4*PT_R13, "4*PT_R13" },
2125 { 4*PT_R12, "4*PT_R12" },
2126 { 4*PT_R11, "4*PT_R11" },
2127 { 4*PT_R10, "4*PT_R10" },
2128 { 4*PT_R9, "4*PT_R9" },
2129 { 4*PT_R8, "4*PT_R8" },
2130 { 4*PT_R7, "4*PT_R7" },
2131 { 4*PT_R6, "4*PT_R6" },
2132 { 4*PT_R5, "4*PT_R5" },
2133 { 4*PT_R4, "4*PT_R4" },
2134 { 4*PT_R3, "4*PT_R3" },
2135 { 4*PT_R2, "4*PT_R2" },
2136 { 4*PT_R1, "4*PT_R1" },
2137 { 4*PT_R0, "4*PT_R0" },
2138 { 4*PT_MOF, "4*PT_MOF" },
2139 { 4*PT_DCCR, "4*PT_DCCR" },
2140 { 4*PT_SRP, "4*PT_SRP" },
2141 { 4*PT_IRP, "4*PT_IRP" },
2142 { 4*PT_CSRINSTR, "4*PT_CSRINSTR" },
2143 { 4*PT_CSRADDR, "4*PT_CSRADDR" },
2144 { 4*PT_CSRDATA, "4*PT_CSRDATA" },
2145 { 4*PT_USP, "4*PT_USP" },
2148 { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
2149 { 4*PT_R0, "4*PT_R0" },
2150 { 4*PT_R1, "4*PT_R1" },
2151 { 4*PT_R2, "4*PT_R2" },
2152 { 4*PT_R3, "4*PT_R3" },
2153 { 4*PT_R4, "4*PT_R4" },
2154 { 4*PT_R5, "4*PT_R5" },
2155 { 4*PT_R6, "4*PT_R6" },
2156 { 4*PT_R7, "4*PT_R7" },
2157 { 4*PT_R8, "4*PT_R8" },
2158 { 4*PT_R9, "4*PT_R9" },
2159 { 4*PT_R10, "4*PT_R10" },
2160 { 4*PT_R11, "4*PT_R11" },
2161 { 4*PT_R12, "4*PT_R12" },
2162 { 4*PT_R13, "4*PT_R13" },
2163 { 4*PT_ACR, "4*PT_ACR" },
2164 { 4*PT_SRS, "4*PT_SRS" },
2165 { 4*PT_MOF, "4*PT_MOF" },
2166 { 4*PT_SPC, "4*PT_SPC" },
2167 { 4*PT_CCS, "4*PT_CCS" },
2168 { 4*PT_SRP, "4*PT_SRP" },
2169 { 4*PT_ERP, "4*PT_ERP" },
2170 { 4*PT_EXS, "4*PT_EXS" },
2171 { 4*PT_EDA, "4*PT_EDA" },
2172 { 4*PT_USP, "4*PT_USP" },
2173 { 4*PT_PPC, "4*PT_PPC" },
2174 { 4*PT_BP_CTRL, "4*PT_BP_CTRL" },
2175 { 4*PT_BP+4, "4*PT_BP+4" },
2176 { 4*PT_BP+8, "4*PT_BP+8" },
2177 { 4*PT_BP+12, "4*PT_BP+12" },
2178 { 4*PT_BP+16, "4*PT_BP+16" },
2179 { 4*PT_BP+20, "4*PT_BP+20" },
2180 { 4*PT_BP+24, "4*PT_BP+24" },
2181 { 4*PT_BP+28, "4*PT_BP+28" },
2182 { 4*PT_BP+32, "4*PT_BP+32" },
2183 { 4*PT_BP+36, "4*PT_BP+36" },
2184 { 4*PT_BP+40, "4*PT_BP+40" },
2185 { 4*PT_BP+44, "4*PT_BP+44" },
2186 { 4*PT_BP+48, "4*PT_BP+48" },
2187 { 4*PT_BP+52, "4*PT_BP+52" },
2188 { 4*PT_BP+56, "4*PT_BP+56" },
2191 { PT_GPR(0), "r0" },
2192 { PT_GPR(1), "r1" },
2193 { PT_GPR(2), "r2" },
2194 { PT_GPR(3), "r3" },
2195 { PT_GPR(4), "r4" },
2196 { PT_GPR(5), "r5" },
2197 { PT_GPR(6), "r6" },
2198 { PT_GPR(7), "r7" },
2199 { PT_GPR(8), "r8" },
2200 { PT_GPR(9), "r9" },
2201 { PT_GPR(10), "r10" },
2202 { PT_GPR(11), "r11" },
2203 { PT_GPR(12), "r12" },
2204 { PT_GPR(13), "r13" },
2205 { PT_GPR(14), "r14" },
2206 { PT_GPR(15), "r15" },
2207 { PT_GPR(16), "r16" },
2208 { PT_GPR(17), "r17" },
2209 { PT_GPR(18), "r18" },
2210 { PT_GPR(19), "r19" },
2211 { PT_GPR(20), "r20" },
2212 { PT_GPR(21), "r21" },
2213 { PT_GPR(22), "r22" },
2214 { PT_GPR(23), "r23" },
2215 { PT_GPR(24), "r24" },
2216 { PT_GPR(25), "r25" },
2217 { PT_GPR(26), "r26" },
2218 { PT_GPR(27), "r27" },
2219 { PT_GPR(28), "r28" },
2220 { PT_GPR(29), "r29" },
2221 { PT_GPR(30), "r30" },
2222 { PT_GPR(31), "r31" },
2224 { PT_MSR, "rmsr", },
2225 { PT_EAR, "rear", },
2226 { PT_ESR, "resr", },
2227 { PT_FSR, "rfsr", },
2228 { PT_KERNEL_MODE, "kernel_mode", },
2267 { SYSCALL_NR, "syscall_nr" },
2268 { REG_AR_BASE, "ar0" },
2269 { REG_AR_BASE+1, "ar1" },
2270 { REG_AR_BASE+2, "ar2" },
2271 { REG_AR_BASE+3, "ar3" },
2272 { REG_AR_BASE+4, "ar4" },
2273 { REG_AR_BASE+5, "ar5" },
2274 { REG_AR_BASE+6, "ar6" },
2275 { REG_AR_BASE+7, "ar7" },
2276 { REG_AR_BASE+8, "ar8" },
2277 { REG_AR_BASE+9, "ar9" },
2278 { REG_AR_BASE+10, "ar10" },
2279 { REG_AR_BASE+11, "ar11" },
2280 { REG_AR_BASE+12, "ar12" },
2281 { REG_AR_BASE+13, "ar13" },
2282 { REG_AR_BASE+14, "ar14" },
2283 { REG_AR_BASE+15, "ar15" },
2284 { REG_AR_BASE+16, "ar16" },
2285 { REG_AR_BASE+17, "ar17" },
2286 { REG_AR_BASE+18, "ar18" },
2287 { REG_AR_BASE+19, "ar19" },
2288 { REG_AR_BASE+20, "ar20" },
2289 { REG_AR_BASE+21, "ar21" },
2290 { REG_AR_BASE+22, "ar22" },
2291 { REG_AR_BASE+23, "ar23" },
2292 { REG_AR_BASE+24, "ar24" },
2293 { REG_AR_BASE+25, "ar25" },
2294 { REG_AR_BASE+26, "ar26" },
2295 { REG_AR_BASE+27, "ar27" },
2296 { REG_AR_BASE+28, "ar28" },
2297 { REG_AR_BASE+29, "ar29" },
2298 { REG_AR_BASE+30, "ar30" },
2299 { REG_AR_BASE+31, "ar31" },
2300 { REG_AR_BASE+32, "ar32" },
2301 { REG_AR_BASE+33, "ar33" },
2302 { REG_AR_BASE+34, "ar34" },
2303 { REG_AR_BASE+35, "ar35" },
2304 { REG_AR_BASE+36, "ar36" },
2305 { REG_AR_BASE+37, "ar37" },
2306 { REG_AR_BASE+38, "ar38" },
2307 { REG_AR_BASE+39, "ar39" },
2308 { REG_AR_BASE+40, "ar40" },
2309 { REG_AR_BASE+41, "ar41" },
2310 { REG_AR_BASE+42, "ar42" },
2311 { REG_AR_BASE+43, "ar43" },
2312 { REG_AR_BASE+44, "ar44" },
2313 { REG_AR_BASE+45, "ar45" },
2314 { REG_AR_BASE+46, "ar46" },
2315 { REG_AR_BASE+47, "ar47" },
2316 { REG_AR_BASE+48, "ar48" },
2317 { REG_AR_BASE+49, "ar49" },
2318 { REG_AR_BASE+50, "ar50" },
2319 { REG_AR_BASE+51, "ar51" },
2320 { REG_AR_BASE+52, "ar52" },
2321 { REG_AR_BASE+53, "ar53" },
2322 { REG_AR_BASE+54, "ar54" },
2323 { REG_AR_BASE+55, "ar55" },
2324 { REG_AR_BASE+56, "ar56" },
2325 { REG_AR_BASE+57, "ar57" },
2326 { REG_AR_BASE+58, "ar58" },
2327 { REG_AR_BASE+59, "ar59" },
2328 { REG_AR_BASE+60, "ar60" },
2329 { REG_AR_BASE+61, "ar61" },
2330 { REG_AR_BASE+62, "ar62" },
2331 { REG_AR_BASE+63, "ar63" },
2332 { REG_LBEG, "lbeg" },
2333 { REG_LEND, "lend" },
2334 { REG_LCOUNT, "lcount" },
2340 { REG_A_BASE, "a0" },
2341 { REG_A_BASE+1, "a1" },
2342 { REG_A_BASE+2, "a2" },
2343 { REG_A_BASE+3, "a3" },
2344 { REG_A_BASE+4, "a4" },
2345 { REG_A_BASE+5, "a5" },
2346 { REG_A_BASE+6, "a6" },
2347 { REG_A_BASE+7, "a7" },
2348 { REG_A_BASE+8, "a8" },
2349 { REG_A_BASE+9, "a9" },
2350 { REG_A_BASE+10, "a10" },
2351 { REG_A_BASE+11, "a11" },
2352 { REG_A_BASE+12, "a12" },
2353 { REG_A_BASE+13, "a13" },
2354 { REG_A_BASE+14, "a14" },
2355 { REG_A_BASE+15, "a15" },
2358 /* Other fields in "struct user" */
2359 #if defined(S390) || defined(S390X)
2360 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2361 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2362 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2363 { uoff(start_code), "offsetof(struct user, start_code)" },
2364 /* S390[X] has no start_data */
2365 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2366 { uoff(signal), "offsetof(struct user, signal)" },
2367 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2368 { uoff(magic), "offsetof(struct user, magic)" },
2369 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2370 { sizeof(struct user), "sizeof(struct user)" },
2371 #elif defined(POWERPC)
2372 { sizeof(struct user), "sizeof(struct user)" },
2373 #elif defined(I386) || defined(X86_64) || defined(X32)
2374 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
2375 { uoff(i387), "offsetof(struct user, i387)" },
2376 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2377 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2378 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2379 { uoff(start_code), "offsetof(struct user, start_code)" },
2380 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2381 { uoff(signal), "offsetof(struct user, signal)" },
2382 { uoff(reserved), "offsetof(struct user, reserved)" },
2383 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2384 { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
2385 { uoff(magic), "offsetof(struct user, magic)" },
2386 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2387 { uoff(u_debugreg), "offsetof(struct user, u_debugreg)" },
2388 { sizeof(struct user), "sizeof(struct user)" },
2390 { sizeof(struct user), "sizeof(struct user)" },
2392 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
2393 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2394 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2395 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2396 { uoff(start_code), "offsetof(struct user, start_code)" },
2397 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2398 { uoff(signal), "offsetof(struct user, signal)" },
2399 { uoff(reserved), "offsetof(struct user, reserved)" },
2400 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2401 { uoff(magic), "offsetof(struct user, magic)" },
2402 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2403 { sizeof(struct user), "sizeof(struct user)" },
2404 #elif defined(AARCH64)
2407 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
2408 { uoff(m68kfp), "offsetof(struct user, m68kfp)" },
2409 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2410 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2411 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2412 { uoff(start_code), "offsetof(struct user, start_code)" },
2413 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2414 { uoff(signal), "offsetof(struct user, signal)" },
2415 { uoff(reserved), "offsetof(struct user, reserved)" },
2416 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2417 { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
2418 { uoff(magic), "offsetof(struct user, magic)" },
2419 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2420 { sizeof(struct user), "sizeof(struct user)" },
2421 #elif defined(MIPS) || defined(LINUX_MIPSN32)
2422 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2423 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2424 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2425 { uoff(start_code), "offsetof(struct user, start_code)" },
2426 { uoff(start_data), "offsetof(struct user, start_data)" },
2427 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2428 { uoff(signal), "offsetof(struct user, signal)" },
2429 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2430 { uoff(magic), "offsetof(struct user, magic)" },
2431 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2432 { sizeof(struct user), "sizeof(struct user)" },
2433 #elif defined(ALPHA)
2434 { sizeof(struct user), "sizeof(struct user)" },
2435 #elif defined(SPARC)
2436 { sizeof(struct user), "sizeof(struct user)" },
2437 #elif defined(SPARC64)
2438 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2439 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2440 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2441 { uoff(signal), "offsetof(struct user, signal)" },
2442 { uoff(magic), "offsetof(struct user, magic)" },
2443 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2444 { sizeof(struct user), "sizeof(struct user)" },
2447 #elif defined(SH) || defined(SH64)
2448 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
2449 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2450 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2451 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2452 { uoff(start_code), "offsetof(struct user, start_code)" },
2453 { uoff(start_data), "offsetof(struct user, start_data)" },
2454 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2455 { uoff(signal), "offsetof(struct user, signal)" },
2456 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2457 { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
2458 { uoff(magic), "offsetof(struct user, magic)" },
2459 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2460 { sizeof(struct user), "sizeof(struct user)" },
2461 #elif defined(CRISV10) || defined(CRISV32)
2462 { sizeof(struct user), "sizeof(struct user)" },
2465 #elif defined(MICROBLAZE)
2466 { sizeof(struct user), "sizeof(struct user)" },
2467 #elif defined(AVR32)
2468 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2469 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2470 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2471 { uoff(start_code), "offsetof(struct user, start_code)" },
2472 { uoff(start_data), "offsetof(struct user, start_data)" },
2473 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2474 { uoff(signal), "offsetof(struct user, signal)" },
2475 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2476 { uoff(magic), "offsetof(struct user, magic)" },
2477 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2478 { sizeof(struct user), "sizeof(struct user)" },
2480 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2481 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2482 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2483 { uoff(start_code), "offsetof(struct user, start_code)" },
2484 { uoff(signal), "offsetof(struct user, signal)" },
2485 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2486 { uoff(magic), "offsetof(struct user, magic)" },
2487 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2488 { sizeof(struct user), "sizeof(struct user)" },
2491 #elif defined(METAG)
2493 #elif defined(XTENSA)
2500 sys_ptrace(struct tcb *tcp)
2502 const struct xlat *x;
2505 if (entering(tcp)) {
2506 printxval(ptrace_cmds, tcp->u_arg[0], "PTRACE_???");
2507 tprintf(", %lu, ", tcp->u_arg[1]);
2509 addr = tcp->u_arg[2];
2510 if (tcp->u_arg[0] == PTRACE_PEEKUSER
2511 || tcp->u_arg[0] == PTRACE_POKEUSER
2513 for (x = struct_user_offsets; x->str; x++) {
2518 tprintf("%#lx, ", addr);
2519 else if (x->val > addr && x != struct_user_offsets) {
2521 tprintf("%s + %ld, ", x->str, addr - x->val);
2524 tprintf("%s, ", x->str);
2526 #ifdef PTRACE_GETREGSET
2527 if (tcp->u_arg[0] == PTRACE_GETREGSET
2528 || tcp->u_arg[0] == PTRACE_SETREGSET
2530 printxval(nt_descriptor_types, tcp->u_arg[2], "NT_???");
2534 tprintf("%#lx, ", addr);
2537 switch (tcp->u_arg[0]) {
2539 case PTRACE_PEEKDATA:
2540 case PTRACE_PEEKTEXT:
2541 case PTRACE_PEEKUSER:
2545 case PTRACE_SINGLESTEP:
2546 case PTRACE_SYSCALL:
2548 printsignal(tcp->u_arg[3]);
2550 #ifdef PTRACE_SETOPTIONS
2551 case PTRACE_SETOPTIONS:
2552 printflags(ptrace_setoptions_flags, tcp->u_arg[3], "PTRACE_O_???");
2555 #ifdef PTRACE_SETSIGINFO
2556 case PTRACE_SETSIGINFO: {
2557 printsiginfo_at(tcp, tcp->u_arg[3]);
2561 #ifdef PTRACE_GETSIGINFO
2562 case PTRACE_GETSIGINFO:
2563 /* Don't print anything, do it at syscall return. */
2566 #ifdef PTRACE_GETREGSET
2567 case PTRACE_GETREGSET:
2569 case PTRACE_SETREGSET:
2570 tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
2574 tprintf("%#lx", tcp->u_arg[3]);
2578 switch (tcp->u_arg[0]) {
2579 case PTRACE_PEEKDATA:
2580 case PTRACE_PEEKTEXT:
2581 case PTRACE_PEEKUSER:
2585 printnum(tcp, tcp->u_arg[3], "%#lx");
2588 #ifdef PTRACE_GETSIGINFO
2589 case PTRACE_GETSIGINFO: {
2590 printsiginfo_at(tcp, tcp->u_arg[3]);
2594 #ifdef PTRACE_GETREGSET
2595 case PTRACE_GETREGSET:
2596 tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
2604 #ifndef FUTEX_CMP_REQUEUE
2605 # define FUTEX_CMP_REQUEUE 4
2607 #ifndef FUTEX_WAKE_OP
2608 # define FUTEX_WAKE_OP 5
2610 #ifndef FUTEX_LOCK_PI
2611 # define FUTEX_LOCK_PI 6
2612 # define FUTEX_UNLOCK_PI 7
2613 # define FUTEX_TRYLOCK_PI 8
2615 #ifndef FUTEX_WAIT_BITSET
2616 # define FUTEX_WAIT_BITSET 9
2618 #ifndef FUTEX_WAKE_BITSET
2619 # define FUTEX_WAKE_BITSET 10
2621 #ifndef FUTEX_WAIT_REQUEUE_PI
2622 # define FUTEX_WAIT_REQUEUE_PI 11
2624 #ifndef FUTEX_CMP_REQUEUE_PI
2625 # define FUTEX_CMP_REQUEUE_PI 12
2627 #ifndef FUTEX_PRIVATE_FLAG
2628 # define FUTEX_PRIVATE_FLAG 128
2630 #ifndef FUTEX_CLOCK_REALTIME
2631 # define FUTEX_CLOCK_REALTIME 256
2633 static const struct xlat futexops[] = {
2634 { FUTEX_WAIT, "FUTEX_WAIT" },
2635 { FUTEX_WAKE, "FUTEX_WAKE" },
2636 { FUTEX_FD, "FUTEX_FD" },
2637 { FUTEX_REQUEUE, "FUTEX_REQUEUE" },
2638 { FUTEX_CMP_REQUEUE, "FUTEX_CMP_REQUEUE" },
2639 { FUTEX_WAKE_OP, "FUTEX_WAKE_OP" },
2640 { FUTEX_LOCK_PI, "FUTEX_LOCK_PI" },
2641 { FUTEX_UNLOCK_PI, "FUTEX_UNLOCK_PI" },
2642 { FUTEX_TRYLOCK_PI, "FUTEX_TRYLOCK_PI" },
2643 { FUTEX_WAIT_BITSET, "FUTEX_WAIT_BITSET" },
2644 { FUTEX_WAKE_BITSET, "FUTEX_WAKE_BITSET" },
2645 { FUTEX_WAIT_REQUEUE_PI, "FUTEX_WAIT_REQUEUE_PI" },
2646 { FUTEX_CMP_REQUEUE_PI, "FUTEX_CMP_REQUEUE_PI" },
2647 { FUTEX_WAIT|FUTEX_PRIVATE_FLAG, "FUTEX_WAIT_PRIVATE" },
2648 { FUTEX_WAKE|FUTEX_PRIVATE_FLAG, "FUTEX_WAKE_PRIVATE" },
2649 { FUTEX_FD|FUTEX_PRIVATE_FLAG, "FUTEX_FD_PRIVATE" },
2650 { FUTEX_REQUEUE|FUTEX_PRIVATE_FLAG, "FUTEX_REQUEUE_PRIVATE" },
2651 { FUTEX_CMP_REQUEUE|FUTEX_PRIVATE_FLAG, "FUTEX_CMP_REQUEUE_PRIVATE" },
2652 { FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG, "FUTEX_WAKE_OP_PRIVATE" },
2653 { FUTEX_LOCK_PI|FUTEX_PRIVATE_FLAG, "FUTEX_LOCK_PI_PRIVATE" },
2654 { FUTEX_UNLOCK_PI|FUTEX_PRIVATE_FLAG, "FUTEX_UNLOCK_PI_PRIVATE" },
2655 { FUTEX_TRYLOCK_PI|FUTEX_PRIVATE_FLAG, "FUTEX_TRYLOCK_PI_PRIVATE" },
2656 { FUTEX_WAIT_BITSET|FUTEX_PRIVATE_FLAG, "FUTEX_WAIT_BITSET_PRIVATE" },
2657 { FUTEX_WAKE_BITSET|FUTEX_PRIVATE_FLAG, "FUTEX_WAKE_BITSET_PRIVATE" },
2658 { FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG, "FUTEX_WAIT_REQUEUE_PI_PRIVATE" },
2659 { FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG, "FUTEX_CMP_REQUEUE_PI_PRIVATE" },
2660 { FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, "FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME" },
2661 { FUTEX_WAIT_BITSET|FUTEX_PRIVATE_FLAG|FUTEX_CLOCK_REALTIME, "FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME" },
2662 { FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, "FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME" },
2663 { FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG|FUTEX_CLOCK_REALTIME, "FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME" },
2666 #ifndef FUTEX_OP_SET
2667 # define FUTEX_OP_SET 0
2668 # define FUTEX_OP_ADD 1
2669 # define FUTEX_OP_OR 2
2670 # define FUTEX_OP_ANDN 3
2671 # define FUTEX_OP_XOR 4
2672 # define FUTEX_OP_CMP_EQ 0
2673 # define FUTEX_OP_CMP_NE 1
2674 # define FUTEX_OP_CMP_LT 2
2675 # define FUTEX_OP_CMP_LE 3
2676 # define FUTEX_OP_CMP_GT 4
2677 # define FUTEX_OP_CMP_GE 5
2679 static const struct xlat futexwakeops[] = {
2680 { FUTEX_OP_SET, "FUTEX_OP_SET" },
2681 { FUTEX_OP_ADD, "FUTEX_OP_ADD" },
2682 { FUTEX_OP_OR, "FUTEX_OP_OR" },
2683 { FUTEX_OP_ANDN, "FUTEX_OP_ANDN" },
2684 { FUTEX_OP_XOR, "FUTEX_OP_XOR" },
2687 static const struct xlat futexwakecmps[] = {
2688 { FUTEX_OP_CMP_EQ, "FUTEX_OP_CMP_EQ" },
2689 { FUTEX_OP_CMP_NE, "FUTEX_OP_CMP_NE" },
2690 { FUTEX_OP_CMP_LT, "FUTEX_OP_CMP_LT" },
2691 { FUTEX_OP_CMP_LE, "FUTEX_OP_CMP_LE" },
2692 { FUTEX_OP_CMP_GT, "FUTEX_OP_CMP_GT" },
2693 { FUTEX_OP_CMP_GE, "FUTEX_OP_CMP_GE" },
2698 sys_futex(struct tcb *tcp)
2700 if (entering(tcp)) {
2701 long int cmd = tcp->u_arg[1] & 127;
2702 tprintf("%p, ", (void *) tcp->u_arg[0]);
2703 printxval(futexops, tcp->u_arg[1], "FUTEX_???");
2704 tprintf(", %ld", tcp->u_arg[2]);
2705 if (cmd == FUTEX_WAKE_BITSET)
2706 tprintf(", %lx", tcp->u_arg[5]);
2707 else if (cmd == FUTEX_WAIT) {
2709 printtv(tcp, tcp->u_arg[3]);
2710 } else if (cmd == FUTEX_WAIT_BITSET) {
2712 printtv(tcp, tcp->u_arg[3]);
2713 tprintf(", %lx", tcp->u_arg[5]);
2714 } else if (cmd == FUTEX_REQUEUE)
2715 tprintf(", %ld, %p", tcp->u_arg[3], (void *) tcp->u_arg[4]);
2716 else if (cmd == FUTEX_CMP_REQUEUE || cmd == FUTEX_CMP_REQUEUE_PI)
2717 tprintf(", %ld, %p, %ld", tcp->u_arg[3], (void *) tcp->u_arg[4], tcp->u_arg[5]);
2718 else if (cmd == FUTEX_WAKE_OP) {
2719 tprintf(", %ld, %p, {", tcp->u_arg[3], (void *) tcp->u_arg[4]);
2720 if ((tcp->u_arg[5] >> 28) & 8)
2721 tprints("FUTEX_OP_OPARG_SHIFT|");
2722 printxval(futexwakeops, (tcp->u_arg[5] >> 28) & 0x7, "FUTEX_OP_???");
2723 tprintf(", %ld, ", (tcp->u_arg[5] >> 12) & 0xfff);
2724 if ((tcp->u_arg[5] >> 24) & 8)
2725 tprints("FUTEX_OP_OPARG_SHIFT|");
2726 printxval(futexwakecmps, (tcp->u_arg[5] >> 24) & 0x7, "FUTEX_OP_CMP_???");
2727 tprintf(", %ld}", tcp->u_arg[5] & 0xfff);
2728 } else if (cmd == FUTEX_WAIT_REQUEUE_PI) {
2730 printtv(tcp, tcp->u_arg[3]);
2731 tprintf(", %p", (void *) tcp->u_arg[4]);
2738 print_affinitylist(struct tcb *tcp, long list, unsigned int len)
2741 unsigned long w, min_len;
2743 if (abbrev(tcp) && len / sizeof(w) > max_strlen)
2744 min_len = len - max_strlen * sizeof(w);
2747 for (; len >= sizeof(w) && len > min_len;
2748 len -= sizeof(w), list += sizeof(w)) {
2749 if (umove(tcp, list, &w) < 0)
2760 tprintf("%#lx", list);
2762 tprintf(", %s}", (len >= sizeof(w) && len > min_len ?
2765 tprints(first ? "{}" : "}");
2770 sys_sched_setaffinity(struct tcb *tcp)
2772 if (entering(tcp)) {
2773 tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
2774 print_affinitylist(tcp, tcp->u_arg[2], tcp->u_arg[1]);
2780 sys_sched_getaffinity(struct tcb *tcp)
2782 if (entering(tcp)) {
2783 tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
2785 if (tcp->u_rval == -1)
2786 tprintf("%#lx", tcp->u_arg[2]);
2788 print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval);
2794 sys_get_robust_list(struct tcb *tcp)
2796 if (entering(tcp)) {
2797 tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]);
2802 if (syserror(tcp) ||
2804 umove(tcp, tcp->u_arg[1], &addr) < 0) {
2805 tprintf("%#lx, ", tcp->u_arg[1]);
2807 tprintf("[%p], ", addr);
2810 if (syserror(tcp) ||
2812 umove(tcp, tcp->u_arg[2], &len) < 0) {
2813 tprintf("%#lx", tcp->u_arg[2]);
2815 tprintf("[%lu]", (unsigned long) len);
2821 static const struct xlat schedulers[] = {
2822 { SCHED_OTHER, "SCHED_OTHER" },
2823 { SCHED_RR, "SCHED_RR" },
2824 { SCHED_FIFO, "SCHED_FIFO" },
2829 sys_sched_getscheduler(struct tcb *tcp)
2831 if (entering(tcp)) {
2832 tprintf("%d", (int) tcp->u_arg[0]);
2833 } else if (!syserror(tcp)) {
2834 tcp->auxstr = xlookup(schedulers, tcp->u_rval);
2835 if (tcp->auxstr != NULL)
2842 sys_sched_setscheduler(struct tcb *tcp)
2844 if (entering(tcp)) {
2845 struct sched_param p;
2846 tprintf("%d, ", (int) tcp->u_arg[0]);
2847 printxval(schedulers, tcp->u_arg[1], "SCHED_???");
2848 if (umove(tcp, tcp->u_arg[2], &p) < 0)
2849 tprintf(", %#lx", tcp->u_arg[2]);
2851 tprintf(", { %d }", p.__sched_priority);
2857 sys_sched_getparam(struct tcb *tcp)
2859 if (entering(tcp)) {
2860 tprintf("%d, ", (int) tcp->u_arg[0]);
2862 struct sched_param p;
2863 if (umove(tcp, tcp->u_arg[1], &p) < 0)
2864 tprintf("%#lx", tcp->u_arg[1]);
2866 tprintf("{ %d }", p.__sched_priority);
2872 sys_sched_setparam(struct tcb *tcp)
2874 if (entering(tcp)) {
2875 struct sched_param p;
2876 if (umove(tcp, tcp->u_arg[1], &p) < 0)
2877 tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
2879 tprintf("%d, { %d }", (int) tcp->u_arg[0], p.__sched_priority);
2885 sys_sched_get_priority_min(struct tcb *tcp)
2887 if (entering(tcp)) {
2888 printxval(schedulers, tcp->u_arg[0], "SCHED_???");
2894 sys_sched_rr_get_interval(struct tcb *tcp)
2896 if (entering(tcp)) {
2897 tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]);
2900 tprintf("%#lx", tcp->u_arg[1]);
2902 print_timespec(tcp, tcp->u_arg[1]);
2907 #if defined X86_64 || defined X32
2908 # include <asm/prctl.h>
2910 static const struct xlat archvals[] = {
2911 { ARCH_SET_GS, "ARCH_SET_GS" },
2912 { ARCH_SET_FS, "ARCH_SET_FS" },
2913 { ARCH_GET_FS, "ARCH_GET_FS" },
2914 { ARCH_GET_GS, "ARCH_GET_GS" },
2919 sys_arch_prctl(struct tcb *tcp)
2921 if (entering(tcp)) {
2922 printxval(archvals, tcp->u_arg[0], "ARCH_???");
2923 if (tcp->u_arg[0] == ARCH_SET_GS
2924 || tcp->u_arg[0] == ARCH_SET_FS
2926 tprintf(", %#lx", tcp->u_arg[1]);
2929 if (tcp->u_arg[0] == ARCH_GET_GS
2930 || tcp->u_arg[0] == ARCH_GET_FS
2933 if (!syserror(tcp) && umove(tcp, tcp->u_arg[1], &v) != -1)
2934 tprintf(", [%#lx]", v);
2936 tprintf(", %#lx", tcp->u_arg[1]);
2941 #endif /* X86_64 || X32 */
2944 sys_getcpu(struct tcb *tcp)
2948 if (tcp->u_arg[0] == 0)
2950 else if (umove(tcp, tcp->u_arg[0], &u) < 0)
2951 tprintf("%#lx, ", tcp->u_arg[0]);
2953 tprintf("[%u], ", u);
2954 if (tcp->u_arg[1] == 0)
2956 else if (umove(tcp, tcp->u_arg[1], &u) < 0)
2957 tprintf("%#lx, ", tcp->u_arg[1]);
2959 tprintf("[%u], ", u);
2960 tprintf("%#lx", tcp->u_arg[2]);
2966 sys_process_vm_readv(struct tcb *tcp)
2968 if (entering(tcp)) {
2970 tprintf("%ld, ", tcp->u_arg[0]);
2972 /* arg 2: local iov */
2973 if (syserror(tcp)) {
2974 tprintf("%#lx", tcp->u_arg[1]);
2976 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
2978 /* arg 3: local iovcnt */
2979 tprintf(", %lu, ", tcp->u_arg[2]);
2980 /* arg 4: remote iov */
2981 if (syserror(tcp)) {
2982 tprintf("%#lx", tcp->u_arg[3]);
2984 tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
2986 /* arg 5: remote iovcnt */
2988 tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);
2994 sys_process_vm_writev(struct tcb *tcp)
2996 if (entering(tcp)) {
2998 tprintf("%ld, ", tcp->u_arg[0]);
2999 /* arg 2: local iov */
3001 tprintf("%#lx", tcp->u_arg[1]);
3003 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
3004 /* arg 3: local iovcnt */
3005 tprintf(", %lu, ", tcp->u_arg[2]);
3006 /* arg 4: remote iov */
3008 tprintf("%#lx", tcp->u_arg[3]);
3010 tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
3011 /* arg 5: remote iovcnt */
3013 tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);