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