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