gdb/linux-record: Support time, waitpid, pipe syscalls
[deliverable/binutils-gdb.git] / gdb / linux-record.c
CommitLineData
b7f6bf22
HZ
1/* Process record and replay target code for GNU/Linux.
2
32d0add0 3 Copyright (C) 2008-2015 Free Software Foundation, Inc.
b7f6bf22
HZ
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21#include "target.h"
2c543fc4 22#include "gdbtypes.h"
b7f6bf22
HZ
23#include "regcache.h"
24#include "record.h"
d02ed0bb 25#include "record-full.h"
b7f6bf22
HZ
26#include "linux-record.h"
27
28/* These macros are the values of the first argument of system call
29 "sys_ptrace". The values of these macros were obtained from Linux
30 Kernel source. */
31
32#define RECORD_PTRACE_PEEKTEXT 1
33#define RECORD_PTRACE_PEEKDATA 2
34#define RECORD_PTRACE_PEEKUSR 3
35
36/* These macros are the values of the first argument of system call
37 "sys_socketcall". The values of these macros were obtained from
38 Linux Kernel source. */
39
40#define RECORD_SYS_SOCKET 1
41#define RECORD_SYS_BIND 2
42#define RECORD_SYS_CONNECT 3
43#define RECORD_SYS_LISTEN 4
44#define RECORD_SYS_ACCEPT 5
45#define RECORD_SYS_GETSOCKNAME 6
46#define RECORD_SYS_GETPEERNAME 7
47#define RECORD_SYS_SOCKETPAIR 8
48#define RECORD_SYS_SEND 9
49#define RECORD_SYS_RECV 10
50#define RECORD_SYS_SENDTO 11
51#define RECORD_SYS_RECVFROM 12
52#define RECORD_SYS_SHUTDOWN 13
53#define RECORD_SYS_SETSOCKOPT 14
54#define RECORD_SYS_GETSOCKOPT 15
55#define RECORD_SYS_SENDMSG 16
56#define RECORD_SYS_RECVMSG 17
57
58/* These macros are the values of the first argument of system call
59 "sys_ipc". The values of these macros were obtained from Linux
60 Kernel source. */
61
62#define RECORD_SEMOP 1
63#define RECORD_SEMGET 2
64#define RECORD_SEMCTL 3
65#define RECORD_SEMTIMEDOP 4
66#define RECORD_MSGSND 11
67#define RECORD_MSGRCV 12
68#define RECORD_MSGGET 13
69#define RECORD_MSGCTL 14
70#define RECORD_SHMAT 21
71#define RECORD_SHMDT 22
72#define RECORD_SHMGET 23
73#define RECORD_SHMCTL 24
74
75/* These macros are the values of the first argument of system call
76 "sys_quotactl". The values of these macros were obtained from Linux
77 Kernel source. */
78
79#define RECORD_Q_GETFMT 0x800004
80#define RECORD_Q_GETINFO 0x800005
81#define RECORD_Q_GETQUOTA 0x800007
82#define RECORD_Q_XGETQSTAT (('5' << 8) + 5)
83#define RECORD_Q_XGETQUOTA (('3' << 8) + 3)
84
2c543fc4
HZ
85#define OUTPUT_REG(val, num) phex_nz ((val), \
86 TYPE_LENGTH (gdbarch_register_type (get_regcache_arch (regcache), (num))))
87
88static int
89record_linux_sockaddr (struct regcache *regcache,
90 struct linux_record_tdep *tdep, ULONGEST addr,
91 ULONGEST len)
92{
93 gdb_byte *a;
94 int addrlen;
95 struct gdbarch *gdbarch = get_regcache_arch (regcache);
96 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
97
98 if (!addr)
99 return 0;
100
224c3ddb 101 a = (gdb_byte *) alloca (tdep->size_int);
2c543fc4 102
25ea693b 103 if (record_full_arch_list_add_mem ((CORE_ADDR) len, tdep->size_int))
2c543fc4
HZ
104 return -1;
105
106 /* Get the addrlen. */
107 if (target_read_memory ((CORE_ADDR) len, a, tdep->size_int))
108 {
109 if (record_debug)
110 fprintf_unfiltered (gdb_stdlog,
111 "Process record: error reading "
112 "memory at addr = 0x%s len = %d.\n",
113 phex_nz (len, tdep->size_pointer),
114 tdep->size_int);
115 return -1;
116 }
117 addrlen = (int) extract_unsigned_integer (a, tdep->size_int, byte_order);
118 if (addrlen <= 0 || addrlen > tdep->size_sockaddr)
119 addrlen = tdep->size_sockaddr;
120
25ea693b 121 if (record_full_arch_list_add_mem ((CORE_ADDR) addr, addrlen))
2c543fc4
HZ
122 return -1;
123
124 return 0;
125}
126
127static int
128record_linux_msghdr (struct regcache *regcache,
129 struct linux_record_tdep *tdep, ULONGEST addr)
130{
131 gdb_byte *a;
132 struct gdbarch *gdbarch = get_regcache_arch (regcache);
133 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
134 CORE_ADDR tmpaddr;
135 int tmpint;
136
137 if (!addr)
138 return 0;
139
25ea693b 140 if (record_full_arch_list_add_mem ((CORE_ADDR) addr, tdep->size_msghdr))
2c543fc4
HZ
141 return -1;
142
224c3ddb 143 a = (gdb_byte *) alloca (tdep->size_msghdr);
2c543fc4
HZ
144 if (target_read_memory ((CORE_ADDR) addr, a, tdep->size_msghdr))
145 {
146 if (record_debug)
147 fprintf_unfiltered (gdb_stdlog,
148 "Process record: error reading "
149 "memory at addr = 0x%s "
150 "len = %d.\n",
151 phex_nz (addr, tdep->size_pointer),
152 tdep->size_msghdr);
153 return -1;
154 }
155
156 /* msg_name msg_namelen */
157 addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
158 a += tdep->size_pointer;
25ea693b
MM
159 if (record_full_arch_list_add_mem
160 ((CORE_ADDR) addr,
161 (int) extract_unsigned_integer (a,
162 tdep->size_int,
163 byte_order)))
2c543fc4 164 return -1;
933c5a62
MK
165 /* We have read an int, but skip size_pointer bytes to account for alignment
166 of the next field on 64-bit targets. */
167 a += tdep->size_pointer;
2c543fc4
HZ
168
169 /* msg_iov msg_iovlen */
170 addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
171 a += tdep->size_pointer;
172 if (addr)
173 {
174 ULONGEST i;
175 ULONGEST len = extract_unsigned_integer (a, tdep->size_size_t,
176 byte_order);
224c3ddb 177 gdb_byte *iov = (gdb_byte *) alloca (tdep->size_iovec);
2c543fc4
HZ
178
179 for (i = 0; i < len; i++)
180 {
181 if (target_read_memory ((CORE_ADDR) addr, iov, tdep->size_iovec))
182 {
183 if (record_debug)
184 fprintf_unfiltered (gdb_stdlog,
185 "Process record: error "
186 "reading memory at "
187 "addr = 0x%s "
188 "len = %d.\n",
189 phex_nz (addr,tdep->size_pointer),
190 tdep->size_iovec);
191 return -1;
192 }
193 tmpaddr = (CORE_ADDR) extract_unsigned_integer (iov,
194 tdep->size_pointer,
195 byte_order);
196 tmpint = (int) extract_unsigned_integer (iov + tdep->size_pointer,
197 tdep->size_size_t,
198 byte_order);
25ea693b 199 if (record_full_arch_list_add_mem (tmpaddr, tmpint))
2c543fc4
HZ
200 return -1;
201 addr += tdep->size_iovec;
202 }
203 }
204 a += tdep->size_size_t;
205
206 /* msg_control msg_controllen */
207 addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
208 a += tdep->size_pointer;
209 tmpint = (int) extract_unsigned_integer (a, tdep->size_size_t, byte_order);
25ea693b 210 if (record_full_arch_list_add_mem ((CORE_ADDR) addr, tmpint))
2c543fc4
HZ
211 return -1;
212
213 return 0;
214}
215
b7f6bf22
HZ
216/* When the architecture process record get a Linux syscall
217 instruction, it will get a Linux syscall number of this
218 architecture and convert it to the Linux syscall number "num" which
219 is internal to GDB. Most Linux syscalls across architectures in
220 Linux would be similar and mostly differ by sizes of types and
221 structures. This sizes are put to "tdep".
222
223 Record the values of the registers and memory that will be changed
224 in current system call.
225
226 Return -1 if something wrong. */
227
228int
13b6d1d4
MS
229record_linux_system_call (enum gdb_syscall syscall,
230 struct regcache *regcache,
2c543fc4 231 struct linux_record_tdep *tdep)
b7f6bf22 232{
5af949e3 233 struct gdbarch *gdbarch = get_regcache_arch (regcache);
2c543fc4
HZ
234 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
235 ULONGEST tmpulongest;
236 CORE_ADDR tmpaddr;
237 int tmpint;
b7f6bf22 238
13b6d1d4 239 switch (syscall)
b7f6bf22 240 {
13b6d1d4 241 case gdb_sys_restart_syscall:
b7f6bf22
HZ
242 break;
243
13b6d1d4 244 case gdb_sys_exit:
b7f6bf22 245 {
2c543fc4 246 int q;
e0881a8e 247
2c543fc4
HZ
248 target_terminal_ours ();
249 q = yquery (_("The next instruction is syscall exit. "
250 "It will make the program exit. "
251 "Do you want to stop the program?"));
252 target_terminal_inferior ();
253 if (q)
254 return 1;
b7f6bf22
HZ
255 }
256 break;
257
13b6d1d4 258 case gdb_sys_fork:
b7f6bf22
HZ
259 break;
260
13b6d1d4 261 case gdb_sys_read:
b7f6bf22 262 {
2c543fc4 263 ULONGEST addr, count;
e0881a8e 264
2c543fc4
HZ
265 regcache_raw_read_unsigned (regcache, tdep->arg2, &addr);
266 regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
25ea693b 267 if (record_full_arch_list_add_mem ((CORE_ADDR) addr, (int) count))
2c543fc4 268 return -1;
b7f6bf22
HZ
269 }
270 break;
271
13b6d1d4
MS
272 case gdb_sys_write:
273 case gdb_sys_open:
274 case gdb_sys_close:
b80d067f
MK
275 break;
276
13b6d1d4 277 case gdb_sys_waitpid:
b80d067f
MK
278 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
279 if (tmpulongest)
280 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
281 tdep->size_int))
282 return -1;
283 break;
284
13b6d1d4
MS
285 case gdb_sys_creat:
286 case gdb_sys_link:
287 case gdb_sys_unlink:
288 case gdb_sys_execve:
289 case gdb_sys_chdir:
b80d067f
MK
290 break;
291
13b6d1d4 292 case gdb_sys_time:
b80d067f
MK
293 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
294 if (tmpulongest)
295 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
296 tdep->size_time_t))
297 return -1;
298 break;
299
13b6d1d4
MS
300 case gdb_sys_mknod:
301 case gdb_sys_chmod:
302 case gdb_sys_lchown16:
303 case gdb_sys_ni_syscall17:
304 break;
305
306 case gdb_sys_stat:
307 case gdb_sys_fstat:
308 case gdb_sys_lstat:
2c543fc4 309 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
310 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
311 tdep->size__old_kernel_stat))
2c543fc4 312 return -1;
b7f6bf22
HZ
313 break;
314
13b6d1d4
MS
315 case gdb_sys_lseek:
316 case gdb_sys_getpid:
317 case gdb_sys_mount:
318 case gdb_sys_oldumount:
319 case gdb_sys_setuid16:
320 case gdb_sys_getuid16:
321 case gdb_sys_stime:
b7f6bf22
HZ
322 break;
323
13b6d1d4 324 case gdb_sys_ptrace:
2c543fc4
HZ
325 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
326 if (tmpulongest == RECORD_PTRACE_PEEKTEXT
327 || tmpulongest == RECORD_PTRACE_PEEKDATA
328 || tmpulongest == RECORD_PTRACE_PEEKUSR)
329 {
330 regcache_raw_read_unsigned (regcache, tdep->arg4,
331 &tmpulongest);
25ea693b 332 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 4))
2c543fc4
HZ
333 return -1;
334 }
b7f6bf22
HZ
335 break;
336
13b6d1d4
MS
337 case gdb_sys_alarm:
338 case gdb_sys_pause:
339 case gdb_sys_utime:
340 case gdb_sys_ni_syscall31:
341 case gdb_sys_ni_syscall32:
342 case gdb_sys_access:
343 case gdb_sys_nice:
344 case gdb_sys_ni_syscall35:
345 case gdb_sys_sync:
346 case gdb_sys_kill:
347 case gdb_sys_rename:
348 case gdb_sys_mkdir:
349 case gdb_sys_rmdir:
350 case gdb_sys_dup:
b80d067f
MK
351 break;
352
13b6d1d4 353 case gdb_sys_pipe:
b80d067f
MK
354 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
355 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
356 tdep->size_int * 2))
13b6d1d4
MS
357 break;
358
359 case gdb_sys_times:
2c543fc4 360 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
361 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
362 tdep->size_tms))
2c543fc4 363 return -1;
b7f6bf22
HZ
364 break;
365
13b6d1d4
MS
366 case gdb_sys_ni_syscall44:
367 case gdb_sys_brk:
368 case gdb_sys_setgid16:
369 case gdb_sys_getgid16:
370 case gdb_sys_signal:
371 case gdb_sys_geteuid16:
372 case gdb_sys_getegid16:
373 case gdb_sys_acct:
374 case gdb_sys_umount:
375 case gdb_sys_ni_syscall53:
376 break;
377
378 case gdb_sys_ioctl:
b7f6bf22 379 /* XXX Need to add a lot of support of other ioctl requests. */
2c543fc4
HZ
380 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
381 if (tmpulongest == tdep->ioctl_FIOCLEX
382 || tmpulongest == tdep->ioctl_FIONCLEX
383 || tmpulongest == tdep->ioctl_FIONBIO
384 || tmpulongest == tdep->ioctl_FIOASYNC
385 || tmpulongest == tdep->ioctl_TCSETS
386 || tmpulongest == tdep->ioctl_TCSETSW
387 || tmpulongest == tdep->ioctl_TCSETSF
388 || tmpulongest == tdep->ioctl_TCSETA
389 || tmpulongest == tdep->ioctl_TCSETAW
390 || tmpulongest == tdep->ioctl_TCSETAF
391 || tmpulongest == tdep->ioctl_TCSBRK
392 || tmpulongest == tdep->ioctl_TCXONC
393 || tmpulongest == tdep->ioctl_TCFLSH
394 || tmpulongest == tdep->ioctl_TIOCEXCL
395 || tmpulongest == tdep->ioctl_TIOCNXCL
396 || tmpulongest == tdep->ioctl_TIOCSCTTY
397 || tmpulongest == tdep->ioctl_TIOCSPGRP
398 || tmpulongest == tdep->ioctl_TIOCSTI
399 || tmpulongest == tdep->ioctl_TIOCSWINSZ
400 || tmpulongest == tdep->ioctl_TIOCMBIS
401 || tmpulongest == tdep->ioctl_TIOCMBIC
402 || tmpulongest == tdep->ioctl_TIOCMSET
403 || tmpulongest == tdep->ioctl_TIOCSSOFTCAR
404 || tmpulongest == tdep->ioctl_TIOCCONS
405 || tmpulongest == tdep->ioctl_TIOCSSERIAL
406 || tmpulongest == tdep->ioctl_TIOCPKT
407 || tmpulongest == tdep->ioctl_TIOCNOTTY
408 || tmpulongest == tdep->ioctl_TIOCSETD
409 || tmpulongest == tdep->ioctl_TCSBRKP
410 || tmpulongest == tdep->ioctl_TIOCTTYGSTRUCT
411 || tmpulongest == tdep->ioctl_TIOCSBRK
412 || tmpulongest == tdep->ioctl_TIOCCBRK
413 || tmpulongest == tdep->ioctl_TCSETS2
414 || tmpulongest == tdep->ioctl_TCSETSW2
415 || tmpulongest == tdep->ioctl_TCSETSF2
416 || tmpulongest == tdep->ioctl_TIOCSPTLCK
417 || tmpulongest == tdep->ioctl_TIOCSERCONFIG
418 || tmpulongest == tdep->ioctl_TIOCSERGWILD
419 || tmpulongest == tdep->ioctl_TIOCSERSWILD
420 || tmpulongest == tdep->ioctl_TIOCSLCKTRMIOS
421 || tmpulongest == tdep->ioctl_TIOCSERGETMULTI
422 || tmpulongest == tdep->ioctl_TIOCSERSETMULTI
423 || tmpulongest == tdep->ioctl_TIOCMIWAIT
424 || tmpulongest == tdep->ioctl_TIOCSHAYESESP)
425 {
426 /* Nothing to do. */
427 }
428 else if (tmpulongest == tdep->ioctl_TCGETS
429 || tmpulongest == tdep->ioctl_TCGETA
430 || tmpulongest == tdep->ioctl_TIOCGLCKTRMIOS)
431 {
432 regcache_raw_read_unsigned (regcache, tdep->arg3,
433 &tmpulongest);
25ea693b
MM
434 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
435 tdep->size_termios))
2c543fc4
HZ
436 return -1;
437 }
438 else if (tmpulongest == tdep->ioctl_TIOCGPGRP
439 || tmpulongest == tdep->ioctl_TIOCGSID)
440 {
441 regcache_raw_read_unsigned (regcache, tdep->arg3,
442 &tmpulongest);
25ea693b
MM
443 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
444 tdep->size_pid_t))
2c543fc4
HZ
445 return -1;
446 }
447 else if (tmpulongest == tdep->ioctl_TIOCOUTQ
448 || tmpulongest == tdep->ioctl_TIOCMGET
449 || tmpulongest == tdep->ioctl_TIOCGSOFTCAR
450 || tmpulongest == tdep->ioctl_FIONREAD
451 || tmpulongest == tdep->ioctl_TIOCINQ
452 || tmpulongest == tdep->ioctl_TIOCGETD
453 || tmpulongest == tdep->ioctl_TIOCGPTN
454 || tmpulongest == tdep->ioctl_TIOCSERGETLSR)
455 {
456 regcache_raw_read_unsigned (regcache, tdep->arg3,
457 &tmpulongest);
25ea693b
MM
458 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
459 tdep->size_int))
2c543fc4
HZ
460 return -1;
461 }
462 else if (tmpulongest == tdep->ioctl_TIOCGWINSZ)
463 {
464 regcache_raw_read_unsigned (regcache, tdep->arg3,
465 &tmpulongest);
25ea693b
MM
466 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
467 tdep->size_winsize))
2c543fc4
HZ
468 return -1;
469 }
470 else if (tmpulongest == tdep->ioctl_TIOCLINUX)
471 {
472 regcache_raw_read_unsigned (regcache, tdep->arg3,
473 &tmpulongest);
13b6d1d4 474 /* This syscall affects a char-size memory. */
25ea693b 475 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 1))
2c543fc4
HZ
476 return -1;
477 }
478 else if (tmpulongest == tdep->ioctl_TIOCGSERIAL)
479 {
480 regcache_raw_read_unsigned (regcache, tdep->arg3,
481 &tmpulongest);
25ea693b
MM
482 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
483 tdep->size_serial_struct))
2c543fc4
HZ
484 return -1;
485 }
486 else if (tmpulongest == tdep->ioctl_TCGETS2)
487 {
488 regcache_raw_read_unsigned (regcache, tdep->arg3,
489 &tmpulongest);
25ea693b
MM
490 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
491 tdep->size_termios2))
2c543fc4
HZ
492 return -1;
493 }
494 else if (tmpulongest == tdep->ioctl_FIOQSIZE)
495 {
496 regcache_raw_read_unsigned (regcache, tdep->arg3,
497 &tmpulongest);
25ea693b
MM
498 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
499 tdep->size_loff_t))
2c543fc4
HZ
500 return -1;
501 }
502 else if (tmpulongest == tdep->ioctl_TIOCGICOUNT)
503 {
504 regcache_raw_read_unsigned (regcache, tdep->arg3,
505 &tmpulongest);
25ea693b
MM
506 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
507 tdep->size_serial_icounter_struct))
2c543fc4
HZ
508 return -1;
509 }
510 else if (tmpulongest == tdep->ioctl_TIOCGHAYESESP)
511 {
512 regcache_raw_read_unsigned (regcache, tdep->arg3,
513 &tmpulongest);
25ea693b
MM
514 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
515 tdep->size_hayes_esp_config))
2c543fc4
HZ
516 return -1;
517 }
518 else if (tmpulongest == tdep->ioctl_TIOCSERGSTRUCT)
519 {
520 printf_unfiltered (_("Process record and replay target doesn't "
521 "support ioctl request TIOCSERGSTRUCT\n"));
522 return 1;
523 }
b7f6bf22 524 else
2c543fc4
HZ
525 {
526 printf_unfiltered (_("Process record and replay target doesn't "
527 "support ioctl request 0x%s.\n"),
528 OUTPUT_REG (tmpulongest, tdep->arg2));
529 return 1;
530 }
b7f6bf22
HZ
531 break;
532
13b6d1d4 533 case gdb_sys_fcntl:
b7f6bf22 534 /* XXX */
2c543fc4 535 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
b7f6bf22 536 sys_fcntl:
2c543fc4
HZ
537 if (tmpulongest == tdep->fcntl_F_GETLK)
538 {
539 regcache_raw_read_unsigned (regcache, tdep->arg3,
540 &tmpulongest);
25ea693b
MM
541 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
542 tdep->size_flock))
2c543fc4
HZ
543 return -1;
544 }
b7f6bf22
HZ
545 break;
546
13b6d1d4
MS
547 case gdb_sys_ni_syscall56:
548 case gdb_sys_setpgid:
549 case gdb_sys_ni_syscall58:
b7f6bf22
HZ
550 break;
551
13b6d1d4 552 case gdb_sys_olduname:
2c543fc4 553 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
554 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
555 tdep->size_oldold_utsname))
2c543fc4 556 return -1;
b7f6bf22
HZ
557 break;
558
13b6d1d4
MS
559 case gdb_sys_umask:
560 case gdb_sys_chroot:
b7f6bf22
HZ
561 break;
562
13b6d1d4 563 case gdb_sys_ustat:
2c543fc4 564 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
565 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
566 tdep->size_ustat))
2c543fc4 567 return -1;
b7f6bf22
HZ
568 break;
569
13b6d1d4
MS
570 case gdb_sys_dup2:
571 case gdb_sys_getppid:
572 case gdb_sys_getpgrp:
573 case gdb_sys_setsid:
b7f6bf22
HZ
574 break;
575
13b6d1d4 576 case gdb_sys_sigaction:
2c543fc4 577 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
578 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
579 tdep->size_old_sigaction))
2c543fc4 580 return -1;
b7f6bf22
HZ
581 break;
582
13b6d1d4
MS
583 case gdb_sys_sgetmask:
584 case gdb_sys_ssetmask:
585 case gdb_sys_setreuid16:
586 case gdb_sys_setregid16:
587 case gdb_sys_sigsuspend:
b7f6bf22
HZ
588 break;
589
13b6d1d4 590 case gdb_sys_sigpending:
2c543fc4 591 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
592 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
593 tdep->size_old_sigset_t))
2c543fc4 594 return -1;
b7f6bf22
HZ
595 break;
596
13b6d1d4
MS
597 case gdb_sys_sethostname:
598 case gdb_sys_setrlimit:
b7f6bf22
HZ
599 break;
600
13b6d1d4 601 case gdb_sys_old_getrlimit:
2c543fc4 602 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
603 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
604 tdep->size_rlimit))
2c543fc4 605 return -1;
b7f6bf22
HZ
606 break;
607
13b6d1d4 608 case gdb_sys_getrusage:
2c543fc4 609 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
610 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
611 tdep->size_rusage))
2c543fc4 612 return -1;
b7f6bf22
HZ
613 break;
614
13b6d1d4 615 case gdb_sys_gettimeofday:
2c543fc4 616 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
617 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
618 tdep->size_timeval))
2c543fc4
HZ
619 return -1;
620 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
621 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
622 tdep->size_timezone))
2c543fc4 623 return -1;
b7f6bf22
HZ
624 break;
625
13b6d1d4 626 case gdb_sys_settimeofday:
b7f6bf22
HZ
627 break;
628
13b6d1d4 629 case gdb_sys_getgroups16:
2c543fc4 630 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
631 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
632 tdep->size_old_gid_t))
2c543fc4 633 return -1;
b7f6bf22
HZ
634 break;
635
13b6d1d4 636 case gdb_sys_setgroups16:
2c543fc4 637 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
638 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
639 tdep->size_old_gid_t))
2c543fc4 640 return -1;
b7f6bf22
HZ
641 break;
642
13b6d1d4 643 case gdb_old_select:
b7f6bf22 644 {
2c543fc4
HZ
645 struct sel_arg_struct
646 {
647 CORE_ADDR n;
648 CORE_ADDR inp;
649 CORE_ADDR outp;
650 CORE_ADDR exp;
651 CORE_ADDR tvp;
652 } sel;
653
654 regcache_raw_read_unsigned (regcache, tdep->arg1,
655 &tmpulongest);
656 if (tmpulongest)
657 {
658 if (target_read_memory (tmpulongest, (gdb_byte *) &sel,
659 sizeof(sel)))
660 {
661 if (record_debug)
662 fprintf_unfiltered (gdb_stdlog,
663 "Process record: error reading memory "
664 "at addr = 0x%s len = %lu.\n",
665 OUTPUT_REG (tmpulongest, tdep->arg1),
666 (unsigned long) sizeof (sel));
667 return -1;
668 }
25ea693b 669 if (record_full_arch_list_add_mem (sel.inp, tdep->size_fd_set))
2c543fc4 670 return -1;
25ea693b 671 if (record_full_arch_list_add_mem (sel.outp, tdep->size_fd_set))
2c543fc4 672 return -1;
25ea693b 673 if (record_full_arch_list_add_mem (sel.exp, tdep->size_fd_set))
2c543fc4 674 return -1;
25ea693b 675 if (record_full_arch_list_add_mem (sel.tvp, tdep->size_timeval))
2c543fc4
HZ
676 return -1;
677 }
b7f6bf22
HZ
678 }
679 break;
680
13b6d1d4 681 case gdb_sys_symlink:
b7f6bf22
HZ
682 break;
683
13b6d1d4 684 case gdb_sys_readlink:
b7f6bf22 685 {
2c543fc4 686 ULONGEST len;
e0881a8e 687
2c543fc4
HZ
688 regcache_raw_read_unsigned (regcache, tdep->arg2,
689 &tmpulongest);
690 regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
25ea693b 691 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) len))
2c543fc4 692 return -1;
b7f6bf22
HZ
693 }
694 break;
695
13b6d1d4
MS
696 case gdb_sys_uselib:
697 case gdb_sys_swapon:
b7f6bf22
HZ
698 break;
699
13b6d1d4 700 case gdb_sys_reboot:
b7f6bf22 701 {
2c543fc4 702 int q;
e0881a8e 703
2c543fc4 704 target_terminal_ours ();
e0881a8e
MS
705 q = yquery (_("The next instruction is syscall reboot. "
706 "It will restart the computer. "
707 "Do you want to stop the program?"));
2c543fc4
HZ
708 target_terminal_inferior ();
709 if (q)
710 return 1;
b7f6bf22
HZ
711 }
712 break;
713
13b6d1d4 714 case gdb_old_readdir:
2c543fc4 715 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b 716 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
72aded86 717 tdep->size_old_dirent))
2c543fc4 718 return -1;
b7f6bf22
HZ
719 break;
720
13b6d1d4 721 case gdb_old_mmap:
b7f6bf22
HZ
722 break;
723
13b6d1d4 724 case gdb_sys_munmap:
b7f6bf22 725 {
2c543fc4
HZ
726 ULONGEST len;
727
728 regcache_raw_read_unsigned (regcache, tdep->arg1,
729 &tmpulongest);
730 regcache_raw_read_unsigned (regcache, tdep->arg2, &len);
25ea693b 731 if (record_full_memory_query)
bb08c432
HZ
732 {
733 int q;
734
735 target_terminal_ours ();
736 q = yquery (_("\
737The next instruction is syscall munmap.\n\
738It will free the memory addr = 0x%s len = %u.\n\
739It will make record target cannot record some memory change.\n\
740Do you want to stop the program?"),
741 OUTPUT_REG (tmpulongest, tdep->arg1), (int) len);
742 target_terminal_inferior ();
743 if (q)
744 return 1;
745 }
b7f6bf22
HZ
746 }
747 break;
748
13b6d1d4
MS
749 case gdb_sys_truncate:
750 case gdb_sys_ftruncate:
751 case gdb_sys_fchmod:
752 case gdb_sys_fchown16:
753 case gdb_sys_getpriority:
754 case gdb_sys_setpriority:
755 case gdb_sys_ni_syscall98:
756 break;
757
758 case gdb_sys_statfs:
759 case gdb_sys_fstatfs:
2c543fc4 760 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
761 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
762 tdep->size_statfs))
2c543fc4 763 return -1;
b7f6bf22
HZ
764 break;
765
13b6d1d4 766 case gdb_sys_ioperm:
b7f6bf22
HZ
767 break;
768
13b6d1d4
MS
769 case gdb_sys_socket:
770 case gdb_sys_sendto:
771 case gdb_sys_sendmsg:
772 case gdb_sys_shutdown:
773 case gdb_sys_bind:
774 case gdb_sys_connect:
775 case gdb_sys_listen:
776 case gdb_sys_setsockopt:
2c543fc4
HZ
777 break;
778
13b6d1d4
MS
779 case gdb_sys_accept:
780 case gdb_sys_getsockname:
781 case gdb_sys_getpeername:
2c543fc4
HZ
782 {
783 ULONGEST len;
e0881a8e 784
2c543fc4
HZ
785 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
786 regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
787 if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
788 return -1;
789 }
790 break;
791
13b6d1d4 792 case gdb_sys_recvfrom:
2c543fc4
HZ
793 {
794 ULONGEST len;
e0881a8e 795
2c543fc4
HZ
796 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
797 regcache_raw_read_unsigned (regcache, tdep->arg5, &len);
798 if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
799 return -1;
800 }
907b7f4f
MS
801 break;
802
13b6d1d4 803 case gdb_sys_recv:
2c543fc4
HZ
804 {
805 ULONGEST size;
e0881a8e 806
2c543fc4
HZ
807 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
808 regcache_raw_read_unsigned (regcache, tdep->arg3, &size);
25ea693b
MM
809 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
810 (int) size))
2c543fc4
HZ
811 return -1;
812 }
813 break;
814
13b6d1d4 815 case gdb_sys_recvmsg:
2c543fc4
HZ
816 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
817 if (record_linux_msghdr (regcache, tdep, tmpulongest))
818 return -1;
819 break;
820
13b6d1d4 821 case gdb_sys_socketpair:
2c543fc4 822 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
823 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
824 tdep->size_int))
2c543fc4
HZ
825 return -1;
826 break;
827
13b6d1d4 828 case gdb_sys_getsockopt:
2c543fc4
HZ
829 regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
830 if (tmpulongest)
831 {
832 ULONGEST optvalp;
224c3ddb 833 gdb_byte *optlenp = (gdb_byte *) alloca (tdep->size_int);
e0881a8e 834
2c543fc4
HZ
835 if (target_read_memory ((CORE_ADDR) tmpulongest, optlenp,
836 tdep->size_int))
837 {
838 if (record_debug)
839 fprintf_unfiltered (gdb_stdlog,
840 "Process record: error reading "
841 "memory at addr = 0x%s "
842 "len = %d.\n",
843 OUTPUT_REG (tmpulongest, tdep->arg5),
844 tdep->size_int);
845 return -1;
846 }
847 regcache_raw_read_unsigned (regcache, tdep->arg4, &optvalp);
848 tmpint = (int) extract_signed_integer (optlenp, tdep->size_int,
849 byte_order);
25ea693b 850 if (record_full_arch_list_add_mem ((CORE_ADDR) optvalp, tmpint))
2c543fc4 851 return -1;
25ea693b
MM
852 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
853 tdep->size_int))
2c543fc4
HZ
854 return -1;
855 }
856 break;
857
13b6d1d4 858 case gdb_sys_socketcall:
2c543fc4
HZ
859 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
860 switch (tmpulongest)
861 {
862 case RECORD_SYS_SOCKET:
863 case RECORD_SYS_BIND:
864 case RECORD_SYS_CONNECT:
865 case RECORD_SYS_LISTEN:
866 break;
867 case RECORD_SYS_ACCEPT:
868 case RECORD_SYS_GETSOCKNAME:
869 case RECORD_SYS_GETPEERNAME:
870 {
871 regcache_raw_read_unsigned (regcache, tdep->arg2,
872 &tmpulongest);
873 if (tmpulongest)
874 {
224c3ddb 875 gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
2c543fc4
HZ
876 ULONGEST len;
877
878 tmpulongest += tdep->size_ulong;
879 if (target_read_memory ((CORE_ADDR) tmpulongest, a,
880 tdep->size_ulong * 2))
881 {
882 if (record_debug)
883 fprintf_unfiltered (gdb_stdlog,
884 "Process record: error reading "
885 "memory at addr = 0x%s len = %d.\n",
886 OUTPUT_REG (tmpulongest, tdep->arg2),
887 tdep->size_ulong * 2);
888 return -1;
889 }
890 tmpulongest = extract_unsigned_integer (a,
891 tdep->size_ulong,
892 byte_order);
893 len = extract_unsigned_integer (a + tdep->size_ulong,
894 tdep->size_ulong, byte_order);
895 if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
896 return -1;
897 }
898 }
899 break;
900
901 case RECORD_SYS_SOCKETPAIR:
902 {
224c3ddb 903 gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong);
e0881a8e 904
2c543fc4
HZ
905 regcache_raw_read_unsigned (regcache, tdep->arg2,
906 &tmpulongest);
907 if (tmpulongest)
908 {
909 tmpulongest += tdep->size_ulong * 3;
910 if (target_read_memory ((CORE_ADDR) tmpulongest, a,
911 tdep->size_ulong))
912 {
913 if (record_debug)
914 fprintf_unfiltered (gdb_stdlog,
915 "Process record: error reading "
916 "memory at addr = 0x%s len = %d.\n",
917 OUTPUT_REG (tmpulongest, tdep->arg2),
918 tdep->size_ulong);
919 return -1;
920 }
921 tmpaddr
922 = (CORE_ADDR) extract_unsigned_integer (a, tdep->size_ulong,
923 byte_order);
25ea693b 924 if (record_full_arch_list_add_mem (tmpaddr, tdep->size_int))
2c543fc4
HZ
925 return -1;
926 }
927 }
928 break;
929 case RECORD_SYS_SEND:
930 case RECORD_SYS_SENDTO:
931 break;
932 case RECORD_SYS_RECVFROM:
933 regcache_raw_read_unsigned (regcache, tdep->arg2,
934 &tmpulongest);
935 if (tmpulongest)
936 {
224c3ddb 937 gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
2c543fc4
HZ
938 ULONGEST len;
939
940 tmpulongest += tdep->size_ulong * 4;
941 if (target_read_memory ((CORE_ADDR) tmpulongest, a,
942 tdep->size_ulong * 2))
943 {
944 if (record_debug)
945 fprintf_unfiltered (gdb_stdlog,
946 "Process record: error reading "
947 "memory at addr = 0x%s len = %d.\n",
948 OUTPUT_REG (tmpulongest, tdep->arg2),
949 tdep->size_ulong * 2);
950 return -1;
951 }
952 tmpulongest = extract_unsigned_integer (a, tdep->size_ulong,
953 byte_order);
954 len = extract_unsigned_integer (a + tdep->size_ulong,
955 tdep->size_ulong, byte_order);
956 if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
957 return -1;
958 }
959 case RECORD_SYS_RECV:
960 regcache_raw_read_unsigned (regcache, tdep->arg2,
961 &tmpulongest);
962 if (tmpulongest)
963 {
224c3ddb 964 gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
2c543fc4
HZ
965
966 tmpulongest += tdep->size_ulong;
967 if (target_read_memory ((CORE_ADDR) tmpulongest, a,
968 tdep->size_ulong))
969 {
970 if (record_debug)
971 fprintf_unfiltered (gdb_stdlog,
972 "Process record: error reading "
973 "memory at addr = 0x%s len = %d.\n",
974 OUTPUT_REG (tmpulongest, tdep->arg2),
975 tdep->size_ulong);
976 return -1;
977 }
978 tmpulongest = extract_unsigned_integer (a, tdep->size_ulong,
979 byte_order);
980 if (tmpulongest)
981 {
982 a += tdep->size_ulong;
983 tmpint = (int) extract_unsigned_integer (a, tdep->size_ulong,
984 byte_order);
25ea693b
MM
985 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
986 tmpint))
2c543fc4
HZ
987 return -1;
988 }
989 }
990 break;
991 case RECORD_SYS_SHUTDOWN:
992 case RECORD_SYS_SETSOCKOPT:
993 break;
994 case RECORD_SYS_GETSOCKOPT:
995 {
224c3ddb
SM
996 gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
997 gdb_byte *av = (gdb_byte *) alloca (tdep->size_int);
2c543fc4
HZ
998
999 regcache_raw_read_unsigned (regcache, tdep->arg2,
1000 &tmpulongest);
1001 if (tmpulongest)
1002 {
1003 tmpulongest += tdep->size_ulong * 3;
1004 if (target_read_memory ((CORE_ADDR) tmpulongest, a,
1005 tdep->size_ulong * 2))
1006 {
1007 if (record_debug)
1008 fprintf_unfiltered (gdb_stdlog,
1009 "Process record: error reading "
1010 "memory at addr = 0x%s len = %d.\n",
1011 OUTPUT_REG (tmpulongest, tdep->arg2),
1012 tdep->size_ulong * 2);
1013 return -1;
1014 }
1015 tmpulongest = extract_unsigned_integer (a + tdep->size_ulong,
1016 tdep->size_ulong,
1017 byte_order);
1018 if (tmpulongest)
1019 {
1020 if (target_read_memory ((CORE_ADDR) tmpulongest, av,
1021 tdep->size_int))
1022 {
1023 if (record_debug)
1024 fprintf_unfiltered (gdb_stdlog,
1025 "Process record: error reading "
1026 "memory at addr = 0x%s "
1027 "len = %d.\n",
1028 phex_nz (tmpulongest,
1029 tdep->size_ulong),
1030 tdep->size_int);
1031 return -1;
1032 }
1033 tmpaddr
1034 = (CORE_ADDR) extract_unsigned_integer (a,
1035 tdep->size_ulong,
1036 byte_order);
1037 tmpint = (int) extract_unsigned_integer (av,
1038 tdep->size_int,
1039 byte_order);
25ea693b 1040 if (record_full_arch_list_add_mem (tmpaddr, tmpint))
2c543fc4
HZ
1041 return -1;
1042 a += tdep->size_ulong;
1043 tmpaddr
1044 = (CORE_ADDR) extract_unsigned_integer (a,
1045 tdep->size_ulong,
1046 byte_order);
25ea693b
MM
1047 if (record_full_arch_list_add_mem (tmpaddr,
1048 tdep->size_int))
2c543fc4
HZ
1049 return -1;
1050 }
1051 }
1052 }
1053 break;
1054 case RECORD_SYS_SENDMSG:
1055 break;
1056 case RECORD_SYS_RECVMSG:
1057 {
224c3ddb 1058 gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong);
2c543fc4
HZ
1059
1060 regcache_raw_read_unsigned (regcache, tdep->arg2,
1061 &tmpulongest);
1062 if (tmpulongest)
1063 {
1064 tmpulongest += tdep->size_ulong;
1065 if (target_read_memory ((CORE_ADDR) tmpulongest, a,
1066 tdep->size_ulong))
1067 {
1068 if (record_debug)
1069 fprintf_unfiltered (gdb_stdlog,
1070 "Process record: error reading "
1071 "memory at addr = 0x%s len = %d.\n",
1072 OUTPUT_REG (tmpulongest, tdep->arg2),
1073 tdep->size_ulong);
1074 return -1;
1075 }
1076 tmpulongest = extract_unsigned_integer (a, tdep->size_ulong,
1077 byte_order);
1078 if (record_linux_msghdr (regcache, tdep, tmpulongest))
1079 return -1;
1080 }
1081 }
1082 break;
1083 default:
1084 printf_unfiltered (_("Process record and replay target "
1085 "doesn't support socketcall call 0x%s\n"),
1086 OUTPUT_REG (tmpulongest, tdep->arg1));
1087 return -1;
1088 break;
1089 }
b7f6bf22
HZ
1090 break;
1091
13b6d1d4 1092 case gdb_sys_syslog:
b7f6bf22
HZ
1093 break;
1094
13b6d1d4 1095 case gdb_sys_setitimer:
2c543fc4 1096 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1097 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1098 tdep->size_itimerval))
2c543fc4 1099 return -1;
b7f6bf22
HZ
1100 break;
1101
13b6d1d4 1102 case gdb_sys_getitimer:
2c543fc4 1103 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1104 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1105 tdep->size_itimerval))
2c543fc4 1106 return -1;
b7f6bf22
HZ
1107 break;
1108
13b6d1d4
MS
1109 case gdb_sys_newstat:
1110 case gdb_sys_newlstat:
1111 case gdb_sys_newfstat:
1112 case gdb_sys_newfstatat:
2c543fc4 1113 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1114 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1115 tdep->size_stat))
2c543fc4 1116 return -1;
b7f6bf22
HZ
1117 break;
1118
13b6d1d4 1119 case gdb_sys_uname:
2c543fc4 1120 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1121 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1122 tdep->size_old_utsname))
2c543fc4 1123 return -1;
b7f6bf22
HZ
1124 break;
1125
13b6d1d4
MS
1126 case gdb_sys_iopl:
1127 case gdb_sys_vhangup:
1128 case gdb_sys_ni_syscall112:
1129 case gdb_sys_vm86old:
b7f6bf22
HZ
1130 break;
1131
13b6d1d4 1132 case gdb_sys_wait4:
2c543fc4 1133 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1134 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1135 tdep->size_int))
2c543fc4
HZ
1136 return -1;
1137 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
1138 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1139 tdep->size_rusage))
2c543fc4 1140 return -1;
b7f6bf22
HZ
1141 break;
1142
13b6d1d4 1143 case gdb_sys_swapoff:
b7f6bf22
HZ
1144 break;
1145
13b6d1d4 1146 case gdb_sys_sysinfo:
2c543fc4 1147 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1148 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1149 tdep->size_sysinfo))
2c543fc4
HZ
1150 return -1;
1151 break;
1152
13b6d1d4
MS
1153 case gdb_sys_shmget:
1154 case gdb_sys_semget:
1155 case gdb_sys_semop:
1156 case gdb_sys_msgget:
2c543fc4 1157 /* XXX maybe need do some record works with sys_shmdt. */
13b6d1d4
MS
1158 case gdb_sys_shmdt:
1159 case gdb_sys_msgsnd:
1160 case gdb_sys_semtimedop:
2c543fc4
HZ
1161 break;
1162
13b6d1d4 1163 case gdb_sys_shmat:
2c543fc4 1164 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1165 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1166 tdep->size_ulong))
2c543fc4
HZ
1167 return -1;
1168 break;
1169
13b6d1d4 1170 case gdb_sys_shmctl:
2c543fc4 1171 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1172 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1173 tdep->size_shmid_ds))
2c543fc4
HZ
1174 return -1;
1175 break;
1176
13b6d1d4 1177 /* XXX sys_semctl 525 still not supported. */
2c543fc4 1178 /* sys_semctl */
2c543fc4 1179
13b6d1d4 1180 case gdb_sys_msgrcv:
2c543fc4
HZ
1181 {
1182 ULONGEST msgp;
8ac2c12b 1183 LONGEST l;
e0881a8e 1184
8ac2c12b 1185 regcache_raw_read_signed (regcache, tdep->arg3, &l);
2c543fc4 1186 regcache_raw_read_unsigned (regcache, tdep->arg2, &msgp);
8ac2c12b 1187 tmpint = l + tdep->size_long;
25ea693b 1188 if (record_full_arch_list_add_mem ((CORE_ADDR) msgp, tmpint))
2c543fc4
HZ
1189 return -1;
1190 }
1191 break;
1192
13b6d1d4 1193 case gdb_sys_msgctl:
2c543fc4 1194 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1195 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1196 tdep->size_msqid_ds))
2c543fc4 1197 return -1;
b7f6bf22
HZ
1198 break;
1199
13b6d1d4 1200 case gdb_sys_ipc:
2c543fc4
HZ
1201 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1202 tmpulongest &= 0xffff;
1203 switch (tmpulongest)
1204 {
1205 case RECORD_SEMOP:
1206 case RECORD_SEMGET:
1207 case RECORD_SEMTIMEDOP:
1208 case RECORD_MSGSND:
1209 case RECORD_MSGGET:
13b6d1d4 1210 /* XXX maybe need do some record works with RECORD_SHMDT. */
2c543fc4
HZ
1211 case RECORD_SHMDT:
1212 case RECORD_SHMGET:
1213 break;
1214 case RECORD_MSGRCV:
1215 {
8ac2c12b 1216 LONGEST second;
2c543fc4 1217 ULONGEST ptr;
e0881a8e 1218
2c543fc4
HZ
1219 regcache_raw_read_signed (regcache, tdep->arg3, &second);
1220 regcache_raw_read_unsigned (regcache, tdep->arg5, &ptr);
1221 tmpint = (int) second + tdep->size_long;
25ea693b 1222 if (record_full_arch_list_add_mem ((CORE_ADDR) ptr, tmpint))
2c543fc4
HZ
1223 return -1;
1224 }
1225 break;
1226 case RECORD_MSGCTL:
1227 regcache_raw_read_unsigned (regcache, tdep->arg5,
1228 &tmpulongest);
25ea693b
MM
1229 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1230 tdep->size_msqid_ds))
2c543fc4
HZ
1231 return -1;
1232 break;
1233 case RECORD_SHMAT:
1234 regcache_raw_read_unsigned (regcache, tdep->arg4,
1235 &tmpulongest);
25ea693b
MM
1236 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1237 tdep->size_ulong))
2c543fc4
HZ
1238 return -1;
1239 break;
1240 case RECORD_SHMCTL:
1241 regcache_raw_read_unsigned (regcache, tdep->arg5,
1242 &tmpulongest);
25ea693b
MM
1243 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1244 tdep->size_shmid_ds))
2c543fc4
HZ
1245 return -1;
1246 break;
1247 default:
13b6d1d4 1248 /* XXX RECORD_SEMCTL still not supported. */
2c543fc4 1249 printf_unfiltered (_("Process record and replay target doesn't "
13b6d1d4
MS
1250 "support ipc number %s\n"),
1251 pulongest (tmpulongest));
2c543fc4
HZ
1252 break;
1253 }
b7f6bf22
HZ
1254 break;
1255
13b6d1d4
MS
1256 case gdb_sys_fsync:
1257 case gdb_sys_sigreturn:
1258 case gdb_sys_clone:
1259 case gdb_sys_setdomainname:
b7f6bf22
HZ
1260 break;
1261
13b6d1d4 1262 case gdb_sys_newuname:
2c543fc4 1263 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1264 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1265 tdep->size_new_utsname))
2c543fc4 1266 return -1;
b7f6bf22
HZ
1267 break;
1268
13b6d1d4 1269 case gdb_sys_modify_ldt:
2c543fc4
HZ
1270 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1271 if (tmpulongest == 0 || tmpulongest == 2)
1272 {
1273 ULONGEST ptr, bytecount;
e0881a8e 1274
2c543fc4
HZ
1275 regcache_raw_read_unsigned (regcache, tdep->arg2, &ptr);
1276 regcache_raw_read_unsigned (regcache, tdep->arg3, &bytecount);
25ea693b 1277 if (record_full_arch_list_add_mem ((CORE_ADDR) ptr, (int) bytecount))
2c543fc4
HZ
1278 return -1;
1279 }
b7f6bf22
HZ
1280 break;
1281
13b6d1d4 1282 case gdb_sys_adjtimex:
2c543fc4 1283 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1284 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1285 tdep->size_timex))
2c543fc4 1286 return -1;
b7f6bf22
HZ
1287 break;
1288
13b6d1d4 1289 case gdb_sys_mprotect:
b7f6bf22
HZ
1290 break;
1291
13b6d1d4 1292 case gdb_sys_sigprocmask:
2c543fc4 1293 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1294 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1295 tdep->size_old_sigset_t))
2c543fc4 1296 return -1;
b7f6bf22
HZ
1297 break;
1298
13b6d1d4
MS
1299 case gdb_sys_ni_syscall127:
1300 case gdb_sys_init_module:
1301 case gdb_sys_delete_module:
1302 case gdb_sys_ni_syscall130:
b7f6bf22
HZ
1303 break;
1304
13b6d1d4 1305 case gdb_sys_quotactl:
2c543fc4
HZ
1306 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1307 switch (tmpulongest)
1308 {
1309 case RECORD_Q_GETFMT:
1310 regcache_raw_read_unsigned (regcache, tdep->arg4,
1311 &tmpulongest);
1312 /* __u32 */
25ea693b 1313 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 4))
2c543fc4
HZ
1314 return -1;
1315 break;
1316 case RECORD_Q_GETINFO:
1317 regcache_raw_read_unsigned (regcache, tdep->arg4,
1318 &tmpulongest);
25ea693b
MM
1319 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1320 tdep->size_mem_dqinfo))
2c543fc4
HZ
1321 return -1;
1322 break;
1323 case RECORD_Q_GETQUOTA:
1324 regcache_raw_read_unsigned (regcache, tdep->arg4,
1325 &tmpulongest);
25ea693b
MM
1326 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1327 tdep->size_if_dqblk))
2c543fc4
HZ
1328 return -1;
1329 break;
1330 case RECORD_Q_XGETQSTAT:
1331 case RECORD_Q_XGETQUOTA:
1332 regcache_raw_read_unsigned (regcache, tdep->arg4,
1333 &tmpulongest);
25ea693b
MM
1334 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1335 tdep->size_fs_quota_stat))
2c543fc4
HZ
1336 return -1;
1337 break;
1338 }
b7f6bf22
HZ
1339 break;
1340
13b6d1d4
MS
1341 case gdb_sys_getpgid:
1342 case gdb_sys_fchdir:
1343 case gdb_sys_bdflush:
b7f6bf22
HZ
1344 break;
1345
13b6d1d4 1346 case gdb_sys_sysfs:
2c543fc4
HZ
1347 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1348 if (tmpulongest == 2)
1349 {
1350 regcache_raw_read_unsigned (regcache, tdep->arg3,
1351 &tmpulongest);
13b6d1d4 1352 /*XXX the size of memory is not very clear. */
25ea693b 1353 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 10))
2c543fc4
HZ
1354 return -1;
1355 }
b7f6bf22
HZ
1356 break;
1357
13b6d1d4
MS
1358 case gdb_sys_personality:
1359 case gdb_sys_ni_syscall137:
1360 case gdb_sys_setfsuid16:
1361 case gdb_sys_setfsgid16:
b7f6bf22
HZ
1362 break;
1363
13b6d1d4 1364 case gdb_sys_llseek:
2c543fc4 1365 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
1366 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1367 tdep->size_loff_t))
2c543fc4 1368 return -1;
b7f6bf22
HZ
1369 break;
1370
13b6d1d4 1371 case gdb_sys_getdents:
72aded86 1372 case gdb_sys_getdents64:
b7f6bf22 1373 {
2c543fc4 1374 ULONGEST count;
e0881a8e 1375
2c543fc4
HZ
1376 regcache_raw_read_unsigned (regcache, tdep->arg2,
1377 &tmpulongest);
1378 regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
72aded86 1379 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, count))
2c543fc4 1380 return -1;
b7f6bf22
HZ
1381 }
1382 break;
1383
13b6d1d4 1384 case gdb_sys_select:
2c543fc4 1385 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1386 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1387 tdep->size_fd_set))
2c543fc4
HZ
1388 return -1;
1389 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1390 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1391 tdep->size_fd_set))
2c543fc4
HZ
1392 return -1;
1393 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
1394 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1395 tdep->size_fd_set))
2c543fc4
HZ
1396 return -1;
1397 regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
25ea693b
MM
1398 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1399 tdep->size_timeval))
2c543fc4 1400 return -1;
b7f6bf22
HZ
1401 break;
1402
13b6d1d4
MS
1403 case gdb_sys_flock:
1404 case gdb_sys_msync:
b7f6bf22
HZ
1405 break;
1406
13b6d1d4 1407 case gdb_sys_readv:
b7f6bf22 1408 {
2c543fc4
HZ
1409 ULONGEST vec, vlen;
1410
1411 regcache_raw_read_unsigned (regcache, tdep->arg2, &vec);
1412 if (vec)
1413 {
224c3ddb 1414 gdb_byte *iov = (gdb_byte *) alloca (tdep->size_iovec);
2c543fc4
HZ
1415
1416 regcache_raw_read_unsigned (regcache, tdep->arg3, &vlen);
1417 for (tmpulongest = 0; tmpulongest < vlen; tmpulongest++)
1418 {
1419 if (target_read_memory ((CORE_ADDR) vec, iov,
1420 tdep->size_iovec))
1421 {
1422 if (record_debug)
1423 fprintf_unfiltered (gdb_stdlog,
1424 "Process record: error reading "
1425 "memory at addr = 0x%s len = %d.\n",
1426 OUTPUT_REG (vec, tdep->arg2),
1427 tdep->size_iovec);
1428 return -1;
1429 }
1430 tmpaddr
1431 = (CORE_ADDR) extract_unsigned_integer (iov,
1432 tdep->size_pointer,
1433 byte_order);
1434 tmpint
1435 = (int) extract_unsigned_integer (iov + tdep->size_pointer,
1436 tdep->size_size_t,
1437 byte_order);
25ea693b 1438 if (record_full_arch_list_add_mem (tmpaddr, tmpint))
2c543fc4
HZ
1439 return -1;
1440 vec += tdep->size_iovec;
1441 }
1442 }
b7f6bf22
HZ
1443 }
1444 break;
1445
13b6d1d4
MS
1446 case gdb_sys_writev:
1447 case gdb_sys_getsid:
1448 case gdb_sys_fdatasync:
1449 case gdb_sys_sysctl:
1450 case gdb_sys_mlock:
1451 case gdb_sys_munlock:
1452 case gdb_sys_mlockall:
1453 case gdb_sys_munlockall:
1454 case gdb_sys_sched_setparam:
1455 break;
1456
1457 case gdb_sys_sched_getparam:
2c543fc4 1458 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1459 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1460 tdep->size_int))
2c543fc4 1461 return -1;
b7f6bf22
HZ
1462 break;
1463
13b6d1d4
MS
1464 case gdb_sys_sched_setscheduler:
1465 case gdb_sys_sched_getscheduler:
1466 case gdb_sys_sched_yield:
1467 case gdb_sys_sched_get_priority_max:
1468 case gdb_sys_sched_get_priority_min:
b7f6bf22
HZ
1469 break;
1470
13b6d1d4
MS
1471 case gdb_sys_sched_rr_get_interval:
1472 case gdb_sys_nanosleep:
2c543fc4 1473 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1474 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1475 tdep->size_timespec))
2c543fc4 1476 return -1;
b7f6bf22
HZ
1477 break;
1478
13b6d1d4
MS
1479 case gdb_sys_mremap:
1480 case gdb_sys_setresuid16:
b7f6bf22
HZ
1481 break;
1482
13b6d1d4 1483 case gdb_sys_getresuid16:
2c543fc4 1484 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1485 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1486 tdep->size_old_uid_t))
2c543fc4
HZ
1487 return -1;
1488 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1489 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1490 tdep->size_old_uid_t))
2c543fc4
HZ
1491 return -1;
1492 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1493 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1494 tdep->size_old_uid_t))
2c543fc4 1495 return -1;
b7f6bf22
HZ
1496 break;
1497
13b6d1d4
MS
1498 case gdb_sys_vm86:
1499 case gdb_sys_ni_syscall167:
b7f6bf22
HZ
1500 break;
1501
13b6d1d4 1502 case gdb_sys_poll:
2c543fc4
HZ
1503 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1504 if (tmpulongest)
1505 {
1506 ULONGEST nfds;
e0881a8e 1507
2c543fc4 1508 regcache_raw_read_unsigned (regcache, tdep->arg2, &nfds);
25ea693b
MM
1509 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1510 tdep->size_pollfd * nfds))
2c543fc4
HZ
1511 return -1;
1512 }
b7f6bf22
HZ
1513 break;
1514
13b6d1d4 1515 case gdb_sys_nfsservctl:
2c543fc4
HZ
1516 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1517 if (tmpulongest == 7 || tmpulongest == 8)
1518 {
1519 int rsize;
e0881a8e 1520
2c543fc4
HZ
1521 if (tmpulongest == 7)
1522 rsize = tdep->size_NFS_FHSIZE;
1523 else
1524 rsize = tdep->size_knfsd_fh;
1525 regcache_raw_read_unsigned (regcache, tdep->arg3,
1526 &tmpulongest);
25ea693b 1527 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, rsize))
2c543fc4
HZ
1528 return -1;
1529 }
b7f6bf22
HZ
1530 break;
1531
13b6d1d4 1532 case gdb_sys_setresgid16:
b7f6bf22
HZ
1533 break;
1534
13b6d1d4 1535 case gdb_sys_getresgid16:
2c543fc4 1536 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1537 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1538 tdep->size_old_gid_t))
2c543fc4
HZ
1539 return -1;
1540 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1541 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1542 tdep->size_old_gid_t))
2c543fc4
HZ
1543 return -1;
1544 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1545 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1546 tdep->size_old_gid_t))
2c543fc4 1547 return -1;
b7f6bf22
HZ
1548 break;
1549
13b6d1d4 1550 case gdb_sys_prctl:
2c543fc4
HZ
1551 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1552 switch (tmpulongest)
1553 {
1554 case 2:
1555 regcache_raw_read_unsigned (regcache, tdep->arg2,
1556 &tmpulongest);
25ea693b
MM
1557 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1558 tdep->size_int))
2c543fc4
HZ
1559 return -1;
1560 break;
1561 case 16:
1562 regcache_raw_read_unsigned (regcache, tdep->arg2,
1563 &tmpulongest);
25ea693b
MM
1564 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1565 tdep->size_TASK_COMM_LEN))
2c543fc4
HZ
1566 return -1;
1567 break;
1568 }
b7f6bf22
HZ
1569 break;
1570
13b6d1d4 1571 case gdb_sys_rt_sigreturn:
b7f6bf22
HZ
1572 break;
1573
13b6d1d4 1574 case gdb_sys_rt_sigaction:
2c543fc4 1575 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1576 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1577 tdep->size_sigaction))
2c543fc4 1578 return -1;
b7f6bf22
HZ
1579 break;
1580
13b6d1d4 1581 case gdb_sys_rt_sigprocmask:
2c543fc4 1582 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1583 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1584 tdep->size_sigset_t))
2c543fc4 1585 return -1;
b7f6bf22
HZ
1586 break;
1587
13b6d1d4 1588 case gdb_sys_rt_sigpending:
2c543fc4
HZ
1589 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1590 if (tmpulongest)
1591 {
1592 ULONGEST sigsetsize;
e0881a8e 1593
2c543fc4 1594 regcache_raw_read_unsigned (regcache, tdep->arg2,&sigsetsize);
25ea693b
MM
1595 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1596 (int) sigsetsize))
2c543fc4
HZ
1597 return -1;
1598 }
b7f6bf22
HZ
1599 break;
1600
13b6d1d4 1601 case gdb_sys_rt_sigtimedwait:
2c543fc4 1602 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1603 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1604 tdep->size_siginfo_t))
2c543fc4 1605 return -1;
b7f6bf22
HZ
1606 break;
1607
13b6d1d4
MS
1608 case gdb_sys_rt_sigqueueinfo:
1609 case gdb_sys_rt_sigsuspend:
b7f6bf22
HZ
1610 break;
1611
13b6d1d4 1612 case gdb_sys_pread64:
2c543fc4
HZ
1613 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
1614 if (tmpulongest)
1615 {
1616 ULONGEST count;
e0881a8e 1617
2c543fc4 1618 regcache_raw_read_unsigned (regcache, tdep->arg3,&count);
25ea693b
MM
1619 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1620 (int) count))
2c543fc4
HZ
1621 return -1;
1622 }
b7f6bf22
HZ
1623 break;
1624
13b6d1d4
MS
1625 case gdb_sys_pwrite64:
1626 case gdb_sys_chown16:
b7f6bf22
HZ
1627 break;
1628
13b6d1d4 1629 case gdb_sys_getcwd:
2c543fc4
HZ
1630 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
1631 if (tmpulongest)
1632 {
1633 ULONGEST size;
e0881a8e 1634
2c543fc4 1635 regcache_raw_read_unsigned (regcache, tdep->arg2, &size);
25ea693b
MM
1636 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1637 (int) size))
2c543fc4
HZ
1638 return -1;
1639 }
b7f6bf22
HZ
1640 break;
1641
13b6d1d4 1642 case gdb_sys_capget:
2c543fc4 1643 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1644 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1645 tdep->size_cap_user_data_t))
2c543fc4 1646 return -1;
b7f6bf22
HZ
1647 break;
1648
13b6d1d4 1649 case gdb_sys_capset:
b7f6bf22
HZ
1650 break;
1651
13b6d1d4 1652 case gdb_sys_sigaltstack:
2c543fc4 1653 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1654 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1655 tdep->size_stack_t))
2c543fc4 1656 return -1;
b7f6bf22
HZ
1657 break;
1658
13b6d1d4 1659 case gdb_sys_sendfile:
2c543fc4 1660 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1661 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1662 tdep->size_off_t))
2c543fc4 1663 return -1;
b7f6bf22
HZ
1664 break;
1665
13b6d1d4
MS
1666 case gdb_sys_ni_syscall188:
1667 case gdb_sys_ni_syscall189:
1668 case gdb_sys_vfork:
b7f6bf22
HZ
1669 break;
1670
13b6d1d4 1671 case gdb_sys_getrlimit:
2c543fc4 1672 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1673 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1674 tdep->size_rlimit))
2c543fc4 1675 return -1;
b7f6bf22
HZ
1676 break;
1677
13b6d1d4 1678 case gdb_sys_mmap2:
b7f6bf22
HZ
1679 break;
1680
13b6d1d4
MS
1681 case gdb_sys_truncate64:
1682 case gdb_sys_ftruncate64:
b7f6bf22
HZ
1683 break;
1684
13b6d1d4
MS
1685 case gdb_sys_stat64:
1686 case gdb_sys_lstat64:
1687 case gdb_sys_fstat64:
2c543fc4 1688 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1689 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1690 tdep->size_stat64))
2c543fc4 1691 return -1;
b7f6bf22
HZ
1692 break;
1693
13b6d1d4
MS
1694 case gdb_sys_lchown:
1695 case gdb_sys_getuid:
1696 case gdb_sys_getgid:
1697 case gdb_sys_geteuid:
1698 case gdb_sys_getegid:
1699 case gdb_sys_setreuid:
1700 case gdb_sys_setregid:
b7f6bf22
HZ
1701 break;
1702
13b6d1d4 1703 case gdb_sys_getgroups:
2c543fc4
HZ
1704 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
1705 if (tmpulongest)
1706 {
1707 ULONGEST gidsetsize;
e0881a8e 1708
2c543fc4
HZ
1709 regcache_raw_read_unsigned (regcache, tdep->arg1,
1710 &gidsetsize);
1711 tmpint = tdep->size_gid_t * (int) gidsetsize;
25ea693b 1712 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
2c543fc4
HZ
1713 return -1;
1714 }
b7f6bf22
HZ
1715 break;
1716
13b6d1d4
MS
1717 case gdb_sys_setgroups:
1718 case gdb_sys_fchown:
1719 case gdb_sys_setresuid:
b7f6bf22
HZ
1720 break;
1721
13b6d1d4 1722 case gdb_sys_getresuid:
2c543fc4 1723 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1724 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1725 tdep->size_uid_t))
2c543fc4
HZ
1726 return -1;
1727 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1728 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1729 tdep->size_uid_t))
2c543fc4
HZ
1730 return -1;
1731 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1732 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1733 tdep->size_uid_t))
2c543fc4 1734 return -1;
b7f6bf22
HZ
1735 break;
1736
13b6d1d4 1737 case gdb_sys_setresgid:
b7f6bf22
HZ
1738 break;
1739
13b6d1d4 1740 case gdb_sys_getresgid:
2c543fc4 1741 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1742 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1743 tdep->size_gid_t))
2c543fc4
HZ
1744 return -1;
1745 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1746 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1747 tdep->size_gid_t))
2c543fc4
HZ
1748 return -1;
1749 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1750 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1751 tdep->size_gid_t))
2c543fc4 1752 return -1;
b7f6bf22
HZ
1753 break;
1754
13b6d1d4
MS
1755 case gdb_sys_chown:
1756 case gdb_sys_setuid:
1757 case gdb_sys_setgid:
1758 case gdb_sys_setfsuid:
1759 case gdb_sys_setfsgid:
1760 case gdb_sys_pivot_root:
b7f6bf22
HZ
1761 break;
1762
13b6d1d4 1763 case gdb_sys_mincore:
2c543fc4 1764 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1765 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1766 tdep->size_PAGE_SIZE))
2c543fc4 1767 return -1;
b7f6bf22
HZ
1768 break;
1769
13b6d1d4 1770 case gdb_sys_madvise:
b7f6bf22
HZ
1771 break;
1772
13b6d1d4 1773 case gdb_sys_fcntl64:
2c543fc4
HZ
1774 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
1775 if (tmpulongest == tdep->fcntl_F_GETLK64)
50ef67b3 1776 {
2c543fc4
HZ
1777 regcache_raw_read_unsigned (regcache, tdep->arg3,
1778 &tmpulongest);
25ea693b
MM
1779 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1780 tdep->size_flock64))
2c543fc4
HZ
1781 return -1;
1782 }
1783 else if (tmpulongest != tdep->fcntl_F_SETLK64
1784 && tmpulongest != tdep->fcntl_F_SETLKW64)
50ef67b3 1785 {
2c543fc4
HZ
1786 goto sys_fcntl;
1787 }
b7f6bf22
HZ
1788 break;
1789
13b6d1d4
MS
1790 case gdb_sys_ni_syscall222:
1791 case gdb_sys_ni_syscall223:
1792 case gdb_sys_gettid:
1793 case gdb_sys_readahead:
1794 case gdb_sys_setxattr:
1795 case gdb_sys_lsetxattr:
1796 case gdb_sys_fsetxattr:
1797 break;
1798
1799 case gdb_sys_getxattr:
1800 case gdb_sys_lgetxattr:
1801 case gdb_sys_fgetxattr:
2c543fc4
HZ
1802 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
1803 if (tmpulongest)
1804 {
1805 ULONGEST size;
e0881a8e 1806
2c543fc4 1807 regcache_raw_read_unsigned (regcache, tdep->arg4, &size);
25ea693b
MM
1808 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1809 (int) size))
2c543fc4
HZ
1810 return -1;
1811 }
b7f6bf22
HZ
1812 break;
1813
13b6d1d4
MS
1814 case gdb_sys_listxattr:
1815 case gdb_sys_llistxattr:
1816 case gdb_sys_flistxattr:
2c543fc4
HZ
1817 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
1818 if (tmpulongest)
1819 {
1820 ULONGEST size;
e0881a8e 1821
2c543fc4 1822 regcache_raw_read_unsigned (regcache, tdep->arg3, &size);
25ea693b
MM
1823 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1824 (int) size))
2c543fc4
HZ
1825 return -1;
1826 }
b7f6bf22
HZ
1827 break;
1828
13b6d1d4
MS
1829 case gdb_sys_removexattr:
1830 case gdb_sys_lremovexattr:
1831 case gdb_sys_fremovexattr:
1832 case gdb_sys_tkill:
b7f6bf22
HZ
1833 break;
1834
13b6d1d4 1835 case gdb_sys_sendfile64:
2c543fc4 1836 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1837 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1838 tdep->size_loff_t))
2c543fc4 1839 return -1;
b7f6bf22
HZ
1840 break;
1841
13b6d1d4
MS
1842 case gdb_sys_futex:
1843 case gdb_sys_sched_setaffinity:
b7f6bf22
HZ
1844 break;
1845
13b6d1d4 1846 case gdb_sys_sched_getaffinity:
2c543fc4
HZ
1847 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
1848 if (tmpulongest)
1849 {
1850 ULONGEST len;
e0881a8e 1851
2c543fc4 1852 regcache_raw_read_unsigned (regcache, tdep->arg2, &len);
25ea693b
MM
1853 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1854 (int) len))
2c543fc4
HZ
1855 return -1;
1856 }
b7f6bf22
HZ
1857 break;
1858
13b6d1d4 1859 case gdb_sys_set_thread_area:
2c543fc4 1860 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1861 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1862 tdep->size_int))
2c543fc4 1863 return -1;
b7f6bf22
HZ
1864 break;
1865
13b6d1d4 1866 case gdb_sys_get_thread_area:
2c543fc4 1867 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
1868 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1869 tdep->size_user_desc))
2c543fc4 1870 return -1;
b7f6bf22
HZ
1871 break;
1872
13b6d1d4 1873 case gdb_sys_io_setup:
2c543fc4 1874 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
1875 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1876 tdep->size_long))
2c543fc4 1877 return -1;
b7f6bf22
HZ
1878 break;
1879
13b6d1d4 1880 case gdb_sys_io_destroy:
b7f6bf22
HZ
1881 break;
1882
13b6d1d4 1883 case gdb_sys_io_getevents:
2c543fc4
HZ
1884 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
1885 if (tmpulongest)
1886 {
1887 ULONGEST nr;
e0881a8e 1888
2c543fc4 1889 regcache_raw_read_unsigned (regcache, tdep->arg3, &nr);
25ea693b
MM
1890 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1891 nr * tdep->size_io_event))
2c543fc4
HZ
1892 return -1;
1893 }
b7f6bf22
HZ
1894 break;
1895
13b6d1d4 1896 case gdb_sys_io_submit:
2c543fc4
HZ
1897 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
1898 if (tmpulongest)
1899 {
1900 ULONGEST nr, i;
1901 gdb_byte *iocbp;
1902
1903 regcache_raw_read_unsigned (regcache, tdep->arg2, &nr);
224c3ddb 1904 iocbp = (gdb_byte *) alloca (nr * tdep->size_pointer);
2c543fc4
HZ
1905 if (target_read_memory ((CORE_ADDR) tmpulongest, iocbp,
1906 nr * tdep->size_pointer))
1907 {
1908 if (record_debug)
1909 fprintf_unfiltered (gdb_stdlog,
1910 "Process record: error reading memory "
1911 "at addr = 0x%s len = %u.\n",
1912 OUTPUT_REG (tmpulongest, tdep->arg2),
1913 (int) (nr * tdep->size_pointer));
1914 return -1;
1915 }
1916 for (i = 0; i < nr; i++)
1917 {
1918 tmpaddr
1919 = (CORE_ADDR) extract_unsigned_integer (iocbp,
1920 tdep->size_pointer,
1921 byte_order);
25ea693b 1922 if (record_full_arch_list_add_mem (tmpaddr, tdep->size_iocb))
2c543fc4
HZ
1923 return -1;
1924 iocbp += tdep->size_pointer;
1925 }
1926 }
b7f6bf22
HZ
1927 break;
1928
13b6d1d4 1929 case gdb_sys_io_cancel:
2c543fc4 1930 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1931 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1932 tdep->size_io_event))
2c543fc4 1933 return -1;
b7f6bf22
HZ
1934 break;
1935
13b6d1d4
MS
1936 case gdb_sys_fadvise64:
1937 case gdb_sys_ni_syscall251:
b7f6bf22
HZ
1938 break;
1939
13b6d1d4 1940 case gdb_sys_exit_group:
b7f6bf22 1941 {
2c543fc4 1942 int q;
e0881a8e 1943
2c543fc4
HZ
1944 target_terminal_ours ();
1945 q = yquery (_("The next instruction is syscall exit_group. "
1946 "It will make the program exit. "
1947 "Do you want to stop the program?"));
1948 target_terminal_inferior ();
1949 if (q)
1950 return 1;
b7f6bf22
HZ
1951 }
1952 break;
1953
13b6d1d4 1954 case gdb_sys_lookup_dcookie:
2c543fc4
HZ
1955 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
1956 if (tmpulongest)
1957 {
1958 ULONGEST len;
e0881a8e 1959
2c543fc4 1960 regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
25ea693b
MM
1961 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1962 (int) len))
2c543fc4
HZ
1963 return -1;
1964 }
b7f6bf22
HZ
1965 break;
1966
13b6d1d4
MS
1967 case gdb_sys_epoll_create:
1968 case gdb_sys_epoll_ctl:
b7f6bf22
HZ
1969 break;
1970
13b6d1d4 1971 case gdb_sys_epoll_wait:
2c543fc4
HZ
1972 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
1973 if (tmpulongest)
1974 {
1975 ULONGEST maxevents;
e0881a8e 1976
2c543fc4 1977 regcache_raw_read_unsigned (regcache, tdep->arg3, &maxevents);
25ea693b
MM
1978 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1979 (maxevents
1980 * tdep->size_epoll_event)))
2c543fc4
HZ
1981 return -1;
1982 }
b7f6bf22
HZ
1983 break;
1984
13b6d1d4
MS
1985 case gdb_sys_remap_file_pages:
1986 case gdb_sys_set_tid_address:
b7f6bf22
HZ
1987 break;
1988
13b6d1d4 1989 case gdb_sys_timer_create:
2c543fc4 1990 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
1991 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1992 tdep->size_int))
2c543fc4 1993 return -1;
b7f6bf22
HZ
1994 break;
1995
13b6d1d4 1996 case gdb_sys_timer_settime:
2c543fc4 1997 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
1998 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
1999 tdep->size_itimerspec))
2c543fc4 2000 return -1;
b7f6bf22
HZ
2001 break;
2002
13b6d1d4 2003 case gdb_sys_timer_gettime:
2c543fc4 2004 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
2005 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2006 tdep->size_itimerspec))
2c543fc4 2007 return -1;
b7f6bf22
HZ
2008 break;
2009
13b6d1d4
MS
2010 case gdb_sys_timer_getoverrun:
2011 case gdb_sys_timer_delete:
2012 case gdb_sys_clock_settime:
b7f6bf22
HZ
2013 break;
2014
13b6d1d4 2015 case gdb_sys_clock_gettime:
2c543fc4 2016 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
2017 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2018 tdep->size_timespec))
2c543fc4 2019 return -1;
b7f6bf22
HZ
2020 break;
2021
13b6d1d4 2022 case gdb_sys_clock_getres:
2c543fc4 2023 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
2024 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2025 tdep->size_timespec))
2c543fc4 2026 return -1;
b7f6bf22
HZ
2027 break;
2028
13b6d1d4 2029 case gdb_sys_clock_nanosleep:
2c543fc4 2030 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
2031 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2032 tdep->size_timespec))
2c543fc4 2033 return -1;
b7f6bf22
HZ
2034 break;
2035
13b6d1d4
MS
2036 case gdb_sys_statfs64:
2037 case gdb_sys_fstatfs64:
2c543fc4 2038 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
2039 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2040 tdep->size_statfs64))
2c543fc4 2041 return -1;
b7f6bf22
HZ
2042 break;
2043
13b6d1d4
MS
2044 case gdb_sys_tgkill:
2045 case gdb_sys_utimes:
2046 case gdb_sys_fadvise64_64:
2047 case gdb_sys_ni_syscall273:
2048 case gdb_sys_mbind:
b7f6bf22
HZ
2049 break;
2050
13b6d1d4 2051 case gdb_sys_get_mempolicy:
2c543fc4 2052 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
2053 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2054 tdep->size_int))
2c543fc4
HZ
2055 return -1;
2056 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
2057 if (tmpulongest)
2058 {
2059 ULONGEST maxnode;
e0881a8e 2060
2c543fc4 2061 regcache_raw_read_unsigned (regcache, tdep->arg3, &maxnode);
25ea693b
MM
2062 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2063 maxnode * tdep->size_long))
2c543fc4
HZ
2064 return -1;
2065 }
b7f6bf22
HZ
2066 break;
2067
13b6d1d4
MS
2068 case gdb_sys_set_mempolicy:
2069 case gdb_sys_mq_open:
2070 case gdb_sys_mq_unlink:
2071 case gdb_sys_mq_timedsend:
b7f6bf22
HZ
2072 break;
2073
13b6d1d4 2074 case gdb_sys_mq_timedreceive:
2c543fc4
HZ
2075 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
2076 if (tmpulongest)
2077 {
2078 ULONGEST msg_len;
e0881a8e 2079
2c543fc4 2080 regcache_raw_read_unsigned (regcache, tdep->arg3, &msg_len);
25ea693b
MM
2081 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2082 (int) msg_len))
2c543fc4
HZ
2083 return -1;
2084 }
2085 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
2086 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2087 tdep->size_int))
2c543fc4 2088 return -1;
b7f6bf22
HZ
2089 break;
2090
13b6d1d4 2091 case gdb_sys_mq_notify:
b7f6bf22
HZ
2092 break;
2093
13b6d1d4 2094 case gdb_sys_mq_getsetattr:
2c543fc4 2095 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
2096 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2097 tdep->size_mq_attr))
2c543fc4 2098 return -1;
b7f6bf22
HZ
2099 break;
2100
13b6d1d4 2101 case gdb_sys_kexec_load:
b7f6bf22
HZ
2102 break;
2103
13b6d1d4 2104 case gdb_sys_waitid:
2c543fc4 2105 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b 2106 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
aefb52a6 2107 tdep->size_siginfo_t))
2c543fc4
HZ
2108 return -1;
2109 regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
25ea693b
MM
2110 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2111 tdep->size_rusage))
2c543fc4 2112 return -1;
b7f6bf22
HZ
2113 break;
2114
13b6d1d4
MS
2115 case gdb_sys_ni_syscall285:
2116 case gdb_sys_add_key:
2117 case gdb_sys_request_key:
b7f6bf22
HZ
2118 break;
2119
13b6d1d4 2120 case gdb_sys_keyctl:
2c543fc4
HZ
2121 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
2122 if (tmpulongest == 6 || tmpulongest == 11)
2123 {
2124 regcache_raw_read_unsigned (regcache, tdep->arg3,
2125 &tmpulongest);
2126 if (tmpulongest)
2127 {
2128 ULONGEST buflen;
e0881a8e 2129
2c543fc4 2130 regcache_raw_read_unsigned (regcache, tdep->arg4, &buflen);
25ea693b
MM
2131 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2132 (int) buflen))
2c543fc4
HZ
2133 return -1;
2134 }
2135 }
b7f6bf22
HZ
2136 break;
2137
13b6d1d4
MS
2138 case gdb_sys_ioprio_set:
2139 case gdb_sys_ioprio_get:
2140 case gdb_sys_inotify_init:
2141 case gdb_sys_inotify_add_watch:
2142 case gdb_sys_inotify_rm_watch:
2143 case gdb_sys_migrate_pages:
2144 case gdb_sys_openat:
2145 case gdb_sys_mkdirat:
2146 case gdb_sys_mknodat:
2147 case gdb_sys_fchownat:
2148 case gdb_sys_futimesat:
2149 break;
2150
2151 case gdb_sys_fstatat64:
2c543fc4 2152 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
2153 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2154 tdep->size_stat64))
2c543fc4 2155 return -1;
b7f6bf22
HZ
2156 break;
2157
13b6d1d4
MS
2158 case gdb_sys_unlinkat:
2159 case gdb_sys_renameat:
2160 case gdb_sys_linkat:
2161 case gdb_sys_symlinkat:
b7f6bf22
HZ
2162 break;
2163
13b6d1d4 2164 case gdb_sys_readlinkat:
2c543fc4
HZ
2165 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
2166 if (tmpulongest)
2167 {
2168 ULONGEST bufsiz;
e0881a8e 2169
2c543fc4 2170 regcache_raw_read_unsigned (regcache, tdep->arg4, &bufsiz);
25ea693b
MM
2171 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2172 (int) bufsiz))
2c543fc4
HZ
2173 return -1;
2174 }
b7f6bf22
HZ
2175 break;
2176
13b6d1d4
MS
2177 case gdb_sys_fchmodat:
2178 case gdb_sys_faccessat:
b7f6bf22
HZ
2179 break;
2180
13b6d1d4 2181 case gdb_sys_pselect6:
2c543fc4 2182 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
2183 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2184 tdep->size_fd_set))
2c543fc4
HZ
2185 return -1;
2186 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
2187 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2188 tdep->size_fd_set))
2c543fc4
HZ
2189 return -1;
2190 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
2191 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2192 tdep->size_fd_set))
2c543fc4
HZ
2193 return -1;
2194 regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
25ea693b
MM
2195 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2196 tdep->size_timespec))
2c543fc4 2197 return -1;
b7f6bf22
HZ
2198 break;
2199
13b6d1d4 2200 case gdb_sys_ppoll:
2c543fc4
HZ
2201 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
2202 if (tmpulongest)
2203 {
2204 ULONGEST nfds;
e0881a8e 2205
2c543fc4 2206 regcache_raw_read_unsigned (regcache, tdep->arg2, &nfds);
25ea693b
MM
2207 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2208 tdep->size_pollfd * nfds))
2c543fc4
HZ
2209 return -1;
2210 }
2211 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
2212 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2213 tdep->size_timespec))
2c543fc4 2214 return -1;
b7f6bf22
HZ
2215 break;
2216
13b6d1d4
MS
2217 case gdb_sys_unshare:
2218 case gdb_sys_set_robust_list:
b7f6bf22
HZ
2219 break;
2220
13b6d1d4 2221 case gdb_sys_get_robust_list:
2c543fc4 2222 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
2223 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2224 tdep->size_int))
2c543fc4
HZ
2225 return -1;
2226 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
2227 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2228 tdep->size_int))
2c543fc4 2229 return -1;
b7f6bf22
HZ
2230 break;
2231
13b6d1d4 2232 case gdb_sys_splice:
2c543fc4 2233 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
2234 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2235 tdep->size_loff_t))
2c543fc4
HZ
2236 return -1;
2237 regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
25ea693b
MM
2238 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2239 tdep->size_loff_t))
2c543fc4 2240 return -1;
b7f6bf22
HZ
2241 break;
2242
13b6d1d4
MS
2243 case gdb_sys_sync_file_range:
2244 case gdb_sys_tee:
2245 case gdb_sys_vmsplice:
b7f6bf22
HZ
2246 break;
2247
13b6d1d4 2248 case gdb_sys_move_pages:
2c543fc4
HZ
2249 regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
2250 if (tmpulongest)
2251 {
2252 ULONGEST nr_pages;
e0881a8e 2253
2c543fc4 2254 regcache_raw_read_unsigned (regcache, tdep->arg2, &nr_pages);
25ea693b
MM
2255 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2256 nr_pages * tdep->size_int))
2c543fc4
HZ
2257 return -1;
2258 }
b7f6bf22
HZ
2259 break;
2260
13b6d1d4 2261 case gdb_sys_getcpu:
2c543fc4 2262 regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
25ea693b
MM
2263 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2264 tdep->size_int))
2c543fc4
HZ
2265 return -1;
2266 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
25ea693b
MM
2267 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2268 tdep->size_int))
2c543fc4
HZ
2269 return -1;
2270 regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
25ea693b
MM
2271 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
2272 tdep->size_ulong * 2))
2c543fc4 2273 return -1;
b7f6bf22
HZ
2274 break;
2275
13b6d1d4 2276 case gdb_sys_epoll_pwait:
2c543fc4
HZ
2277 regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
2278 if (tmpulongest)
2279 {
2280 ULONGEST maxevents;
e0881a8e 2281
2c543fc4
HZ
2282 regcache_raw_read_unsigned (regcache, tdep->arg3, &maxevents);
2283 tmpint = (int) maxevents * tdep->size_epoll_event;
25ea693b 2284 if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
2c543fc4
HZ
2285 return -1;
2286 }
b7f6bf22
HZ
2287 break;
2288
2289 default:
2290 printf_unfiltered (_("Process record and replay target doesn't "
13b6d1d4 2291 "support syscall number %d\n"), syscall);
b7f6bf22
HZ
2292 return -1;
2293 break;
2294 }
2295
2296 return 0;
2297}
This page took 2.38603 seconds and 4 git commands to generate.