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