2009-04-30 11:04:28 +08:00
|
|
|
/* Process record and replay target code for GNU/Linux.
|
|
|
|
|
2016-01-01 12:33:14 +08:00
|
|
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
2009-04-30 11:04:28 +08:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "target.h"
|
2009-08-10 11:04:45 +08:00
|
|
|
#include "gdbtypes.h"
|
2009-04-30 11:04:28 +08:00
|
|
|
#include "regcache.h"
|
|
|
|
#include "record.h"
|
Split record.h into record.h and record-full.h.
Split record.c into record.c and record-full.c.
The split leaves the command part in record.c and moves the target part into
record-full.c.
gdb/
* record.h: Split into this and ...
* record-full.h: ... this.
* record.c: Split into this and ...
* record-full.c: ... this.
* target.h (target_ops): Add new fields to_info_record,
to_save_record, to_delete_record, to_record_is_replaying,
to_goto_record_begin, to_goto_record_end, to_goto_record.
(target_info_record): New.
(target_save_record): New.
(target_supports_delete_record): New.
(target_delete_record): New.
(target_record_is_replaying): New.
(target_goto_record_begin): New.
(target_goto_record_end): New.
(target_goto_record): New.
* target.c (target_info_record): New.
(target_save_record): New.
(target_supports_delete_record): New.
(target_delete_record): New.
(target_record_is_replaying): New.
(target_goto_record_begin): New.
(target_goto_record_end): New.
(target_goto_record): New.
* record.h: Declare struct cmd_list_element.
(record_cmdlist): New declaration.
(set_record_cmdlist): New declaration.
(show_record_cmdlist): New declaration.
(info_record_cmdlist): New declaration.
(cmd_record_goto): New declaration.
* record.c: Remove unnecessary includes.
Include inferior.h.
(cmd_record_goto): Remove declaration.
(record_cmdlist): Now extern. Initialize.
(set_record_cmdlist): Now extern. Initialize.
(show_record_cmdlist): Now extern. Initialize.
(info_record_cmdlist): Now extern. Initialize.
(find_record_target): New.
(require_record_target): New.
(cmd_record_start): Update.
(cmd_record_delete): Remove target-specific code.
Call target_delete_record.
(cmd_record_stop): Unpush any record target.
(set_record_insn_max_num): Move to record-full.c
(set_record_command): Add comment.
(show_record_command): Add comment.
(info_record_command): Update comment.
Remove target-specific code.
Call the record target's to_info_record.
(cmd_record_start): New.
(cmd_record_goto): Now extern.
Remove target-specific code.
Call target_goto_begin, target_goto_end, or target_goto.
(_initialize_record): Move record target ops initialization to
record-full.c.
Change "record" command help text.
Move "record restore", "record set", and "record show" commands to
record-full.c.
* Makefile.in (SFILES): Add record-full.c.
(HFILES_NO_SRCDIR): Add record-full.h.
(COMMON_OBS): Add record-full.o.
* amd64-linux-tdep.c: Include record-full.h instead of record.h.
* arm-tdep.c: Include record-full.h.
* i386-linux-tdep.c: Include record-full.h instead of record.h.
* i386-tdep.c: Include record-full.h.
* infrun.c: Include record-full.h.
* linux-record.c: Include record-full.h.
* moxie-tdep.c: Include record-full.h.
* record-full.c: Include record-full.h.
Change module comment.
(set_record_full_cmdlist): New.
(show_record_full_cmdlist): New.
(record_full_cmdlist): New.
(record_goto_insn): New declaration.
(record_save): New declaration.
(record_check_insn_num): Change query string.
(record_info): New.
(record_delete): New.
(record_is_replaying): New.
(record_goto_entry): New.
(record_goto_begin): New.
(record_goto_end): New.
(record_goto): New.
(init_record_ops): Update.
(init_record_core_ops): Update.
(cmd_record_save): Rename to record_save. Remove target and arg checks.
(cmd_record_start): New.
(set_record_insn_max_num): Moved from record.c
(set_record_full_command): New.
(show_record_full_command): New.
(_initialize_record_full): New.
2013-03-11 16:42:55 +08:00
|
|
|
#include "record-full.h"
|
2009-04-30 11:04:28 +08:00
|
|
|
#include "linux-record.h"
|
|
|
|
|
|
|
|
/* These macros are the values of the first argument of system call
|
|
|
|
"sys_ptrace". The values of these macros were obtained from Linux
|
|
|
|
Kernel source. */
|
|
|
|
|
|
|
|
#define RECORD_PTRACE_PEEKTEXT 1
|
|
|
|
#define RECORD_PTRACE_PEEKDATA 2
|
|
|
|
#define RECORD_PTRACE_PEEKUSR 3
|
|
|
|
|
|
|
|
/* These macros are the values of the first argument of system call
|
|
|
|
"sys_socketcall". The values of these macros were obtained from
|
|
|
|
Linux Kernel source. */
|
|
|
|
|
|
|
|
#define RECORD_SYS_SOCKET 1
|
|
|
|
#define RECORD_SYS_BIND 2
|
|
|
|
#define RECORD_SYS_CONNECT 3
|
|
|
|
#define RECORD_SYS_LISTEN 4
|
|
|
|
#define RECORD_SYS_ACCEPT 5
|
|
|
|
#define RECORD_SYS_GETSOCKNAME 6
|
|
|
|
#define RECORD_SYS_GETPEERNAME 7
|
|
|
|
#define RECORD_SYS_SOCKETPAIR 8
|
|
|
|
#define RECORD_SYS_SEND 9
|
|
|
|
#define RECORD_SYS_RECV 10
|
|
|
|
#define RECORD_SYS_SENDTO 11
|
|
|
|
#define RECORD_SYS_RECVFROM 12
|
|
|
|
#define RECORD_SYS_SHUTDOWN 13
|
|
|
|
#define RECORD_SYS_SETSOCKOPT 14
|
|
|
|
#define RECORD_SYS_GETSOCKOPT 15
|
|
|
|
#define RECORD_SYS_SENDMSG 16
|
|
|
|
#define RECORD_SYS_RECVMSG 17
|
|
|
|
|
|
|
|
/* These macros are the values of the first argument of system call
|
|
|
|
"sys_ipc". The values of these macros were obtained from Linux
|
|
|
|
Kernel source. */
|
|
|
|
|
|
|
|
#define RECORD_SEMOP 1
|
|
|
|
#define RECORD_SEMGET 2
|
|
|
|
#define RECORD_SEMCTL 3
|
|
|
|
#define RECORD_SEMTIMEDOP 4
|
|
|
|
#define RECORD_MSGSND 11
|
|
|
|
#define RECORD_MSGRCV 12
|
|
|
|
#define RECORD_MSGGET 13
|
|
|
|
#define RECORD_MSGCTL 14
|
|
|
|
#define RECORD_SHMAT 21
|
|
|
|
#define RECORD_SHMDT 22
|
|
|
|
#define RECORD_SHMGET 23
|
|
|
|
#define RECORD_SHMCTL 24
|
|
|
|
|
|
|
|
/* These macros are the values of the first argument of system call
|
|
|
|
"sys_quotactl". The values of these macros were obtained from Linux
|
|
|
|
Kernel source. */
|
|
|
|
|
|
|
|
#define RECORD_Q_GETFMT 0x800004
|
|
|
|
#define RECORD_Q_GETINFO 0x800005
|
|
|
|
#define RECORD_Q_GETQUOTA 0x800007
|
|
|
|
#define RECORD_Q_XGETQSTAT (('5' << 8) + 5)
|
|
|
|
#define RECORD_Q_XGETQUOTA (('3' << 8) + 3)
|
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
#define OUTPUT_REG(val, num) phex_nz ((val), \
|
|
|
|
TYPE_LENGTH (gdbarch_register_type (get_regcache_arch (regcache), (num))))
|
|
|
|
|
|
|
|
static int
|
|
|
|
record_linux_sockaddr (struct regcache *regcache,
|
|
|
|
struct linux_record_tdep *tdep, ULONGEST addr,
|
|
|
|
ULONGEST len)
|
|
|
|
{
|
|
|
|
gdb_byte *a;
|
|
|
|
int addrlen;
|
|
|
|
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
|
|
|
|
|
|
|
if (!addr)
|
|
|
|
return 0;
|
|
|
|
|
2015-09-26 02:08:06 +08:00
|
|
|
a = (gdb_byte *) alloca (tdep->size_int);
|
2009-08-10 11:04:45 +08:00
|
|
|
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) len, tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
/* Get the addrlen. */
|
|
|
|
if (target_read_memory ((CORE_ADDR) len, a, tdep->size_int))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
phex_nz (len, tdep->size_pointer),
|
|
|
|
tdep->size_int);
|
2016-01-26 03:29:54 +08:00
|
|
|
return -1;
|
2009-08-10 11:04:45 +08:00
|
|
|
}
|
|
|
|
addrlen = (int) extract_unsigned_integer (a, tdep->size_int, byte_order);
|
|
|
|
if (addrlen <= 0 || addrlen > tdep->size_sockaddr)
|
|
|
|
addrlen = tdep->size_sockaddr;
|
|
|
|
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) addr, addrlen))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
record_linux_msghdr (struct regcache *regcache,
|
|
|
|
struct linux_record_tdep *tdep, ULONGEST addr)
|
|
|
|
{
|
|
|
|
gdb_byte *a;
|
|
|
|
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
|
|
|
CORE_ADDR tmpaddr;
|
|
|
|
int tmpint;
|
|
|
|
|
|
|
|
if (!addr)
|
|
|
|
return 0;
|
|
|
|
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) addr, tdep->size_msghdr))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
|
2015-09-26 02:08:06 +08:00
|
|
|
a = (gdb_byte *) alloca (tdep->size_msghdr);
|
2009-08-10 11:04:45 +08:00
|
|
|
if (target_read_memory ((CORE_ADDR) addr, a, tdep->size_msghdr))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s "
|
|
|
|
"len = %d.\n",
|
|
|
|
phex_nz (addr, tdep->size_pointer),
|
|
|
|
tdep->size_msghdr);
|
2016-01-26 03:29:54 +08:00
|
|
|
return -1;
|
2009-08-10 11:04:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* msg_name msg_namelen */
|
|
|
|
addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
|
|
|
a += tdep->size_pointer;
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem
|
|
|
|
((CORE_ADDR) addr,
|
|
|
|
(int) extract_unsigned_integer (a,
|
|
|
|
tdep->size_int,
|
|
|
|
byte_order)))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2015-10-30 23:51:58 +08:00
|
|
|
/* We have read an int, but skip size_pointer bytes to account for alignment
|
|
|
|
of the next field on 64-bit targets. */
|
|
|
|
a += tdep->size_pointer;
|
2009-08-10 11:04:45 +08:00
|
|
|
|
|
|
|
/* msg_iov msg_iovlen */
|
|
|
|
addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
|
|
|
a += tdep->size_pointer;
|
|
|
|
if (addr)
|
|
|
|
{
|
|
|
|
ULONGEST i;
|
|
|
|
ULONGEST len = extract_unsigned_integer (a, tdep->size_size_t,
|
|
|
|
byte_order);
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *iov = (gdb_byte *) alloca (tdep->size_iovec);
|
2009-08-10 11:04:45 +08:00
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
{
|
|
|
|
if (target_read_memory ((CORE_ADDR) addr, iov, tdep->size_iovec))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error "
|
|
|
|
"reading memory at "
|
|
|
|
"addr = 0x%s "
|
|
|
|
"len = %d.\n",
|
|
|
|
phex_nz (addr,tdep->size_pointer),
|
|
|
|
tdep->size_iovec);
|
2016-01-26 03:29:54 +08:00
|
|
|
return -1;
|
2009-08-10 11:04:45 +08:00
|
|
|
}
|
|
|
|
tmpaddr = (CORE_ADDR) extract_unsigned_integer (iov,
|
|
|
|
tdep->size_pointer,
|
|
|
|
byte_order);
|
|
|
|
tmpint = (int) extract_unsigned_integer (iov + tdep->size_pointer,
|
|
|
|
tdep->size_size_t,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem (tmpaddr, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
addr += tdep->size_iovec;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
a += tdep->size_size_t;
|
|
|
|
|
|
|
|
/* msg_control msg_controllen */
|
|
|
|
addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
|
|
|
a += tdep->size_pointer;
|
|
|
|
tmpint = (int) extract_unsigned_integer (a, tdep->size_size_t, byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) addr, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-04-30 11:04:28 +08:00
|
|
|
/* When the architecture process record get a Linux syscall
|
|
|
|
instruction, it will get a Linux syscall number of this
|
|
|
|
architecture and convert it to the Linux syscall number "num" which
|
|
|
|
is internal to GDB. Most Linux syscalls across architectures in
|
|
|
|
Linux would be similar and mostly differ by sizes of types and
|
|
|
|
structures. This sizes are put to "tdep".
|
|
|
|
|
|
|
|
Record the values of the registers and memory that will be changed
|
|
|
|
in current system call.
|
|
|
|
|
|
|
|
Return -1 if something wrong. */
|
|
|
|
|
|
|
|
int
|
2009-09-09 06:50:59 +08:00
|
|
|
record_linux_system_call (enum gdb_syscall syscall,
|
|
|
|
struct regcache *regcache,
|
2009-08-10 11:04:45 +08:00
|
|
|
struct linux_record_tdep *tdep)
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
* defs.h (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter.
* utils.c (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
* ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
* ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
use it instead of current_gdbarch.
Update calls to ui_out_field_core_addr to pass architecture:
* ada-lang.c (print_one_exception): Update.
* breakpoint.c (print_one_breakpoint_location,
print_one_exception_catchpoint): Update.
* disasm.c (dump_insns): Update.
* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
* mi/mi-main.c (mi_cmd_data_read_memory): Update.
* mi/mi-symbol-cmds.c: Include "objfiles.h".
(mi_cmd_symbol_list_lines): Update.
* stack.c (print_frame_info, print_frame): Update.
Update callers of paddress to pass architecture:
* ada-tasks.c (info_task): Update.
* ada-valprint.c (ada_val_print_1): Update.
* annotate.c (annotate_source, annotate_frame_begin): Update.
* breakpoint.c (insert_bp_location, describe_other_breakpoints,
mention): Update.
* cli/cli-cmds.c (edit_command, list_command, print_disassembly):
Update.
* corefile.c (memory_error): Update.
* c-valprint.c (print_function_pointer_address, c_val_print): Update.
* disasm.c (dis_asm_print_address): Update.
* exec.c (print_section_info): Update.
* f-valprint.c (f_val_print): Update.
* infcmd.c: Include "arch-utils.h".
(jump_command, program_info): Update.
* linux-fork.c: Include "arch-utils.h".
(info_forks_command): Update.
* m2-valprint.c (print_function_pointer_address,
print_unpacked_pointer, print_variable_at_address,
m2_val_print): Update.
* m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
Update.
* printcmd.c (print_address, print_address_demangle, address_info):
Update.
* p-valprint.c (pascal_val_print): Update.
* source.c: Include "arch-utils.h".
(line_info): Update.
* stack.c (frame_info, print_block_frame_labels): Update.
* symfile.c (add_symbol_file_command, list_overlays_command): Update.
* symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
print_symbol, print_partial_symbols, maintenance_info_psymtabs,
maintenance_check_symtabs): Update.
* symtab.c (find_pc_sect_symtab): Update.
* target.c (deprecated_debug_xfer_memory): Update.
* tracepoint.c (scope_info): Update.
* tui/tui-stack.c (tui_make_status_line): Update.
* valprint.c (val_print_string): Update.
Update callers of paddr_nz to use paddress instead (keeping
user-visible output identical):
* alpha-tdep.c (alpha_heuristic_proc_start): Update.
* amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
amd64_displaced_step_fixup): Update.
* arch-utils.c (simple_displaced_step_copy_insn): Update.
* auxv.c (fprint_target_auxv): Update.
* breakpoint.c (insert_single_step_breakpoint): Update.
* buildsym.c (finish_block): Update.
* cli/cli-dump.c (restore_section_callback): Update.
* fbsd-nat.c (fbsd_find_memory_regions): Update.
* frame.c (frame_unwind_register_value): Update.
* gcore.c (gcore_create_callback): Update.
* hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
i386_record_lea_modrm_addr, i386_record_lea_modrm,
i386_process_record): Update.
* ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
* infrun.c (displaced_step_prepare, displaced_step_fixup,
handle_inferior_event, insert_step_resume_breakpoint_at_sal,
insert_longjmp_resume_breakpoint): Update.
* linux-nat.c (linux_nat_find_memory_regions): Update.
* linux-record.c (record_linux_system_call): Update.
* mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
mips_o64_push_dummy_call): Update.
* monitor.c (monitor_error, monitor_remove_breakpoint): Update.
* record.c (record_arch_list_add_mem, record_wait,
record_xfer_partial): Update.
* remote-mips.c (mips_fetch_word, mips_check_lsi_error,
mips_common_breakpoint): Update.
* remote-sim.c (gdbsim_xfer_inferior_memory): Update.
* rs6000-tdep.c (ppc_displaced_step_fixup): Update.
* solib-som.c (som_current_sos): Update.
* symfile.c (load_progress, generic_load): Update.
* symfile-mem.c (add_vsyscall_page): Update.
* valops.c (value_fetch_lazy): Update.
* windows-tdep.c (windows_xfer_shared_library): Update.
Update callers of paddr_nz to use paddress instead (changing
user-visible output to make it more correct):
* dwarf2loc.c (locexpr_describe_location): Update.
* ia64-tdep.c (ia64_memory_insert_breakpoint,
ia64_memory_remove_breakpoint): Update.
* jv-valprint.c (java_value_print): Update.
* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
* monitor.c (monitor_read_memory): Update.
Update callers of paddr to use paddress instead (changing
user-visible output to make it more correct):
* arm-tdep.c (arm_push_dummy_call): Update.
* breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
create_breakpoint): Update.
* darwin-nat-info.c (darwin_debug_regions): Update.
* dcache.c (dcache_info): Update.
* dsrec.c (load_srec, make_srec): Update.
* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
dwarf2_frame_cache): Update.
* gcore.c (gcore_copy_callback): Update.
* gnu-nat.c (gnu_xfer_memory): Update.
* mips-linux-nat.c (mips_show_dr): Update.
* monitor.c (monitor_write_memory, monitor_insert_breakpoint,
monitor_remove_breakpoint): Update.
* remote.c (compare_sections_command): Update.
* remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
m32r_remove_breakpoint, m32r_insert_watchpoint,
m32r_remove_watchpoint): Update.
* sol-thread.c (info_cb): Update.
* symfile.c (load_progress): Update.
Update callers of paddress or paddr_nz to use hex_string instead
(changes output of internal/error/debug messages only):
* dwarf2read.c (dump_die_shallow): Update.
* frame.c (fprint_field, fprint_frame, frame_pc_unwind,
get_frame_func, create_new_frame): Update.
* hppa-tdep.c (find_unwind_entry, unwind_command): Update.
* ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
ia64_get_dyn_info_list): Update.
* maint.c (maintenance_translate_address): Update.
* mi/mi-cmd-var.c (mi_cmd_var_create): Update.
* target.c (target_flash_erase): Update.
Update callers of paddr/paddr_nz to use phex/phex_nz instead,
using an appropriate address size. Remove use of strlen_paddr.
* exec.c (exec_files_info): Update.
* i386-nat.c (i386_show_dr): Update.
* remote.c (remote_flash_erase): Update.
* m32r-rom.c (m32r_load_section): Update.
* monitor.c (monitor_vsprintf, monitor_store_register): Update.
* remote.c (remote_check_symbols, remote_search_memory): Update.
* remote-mips.c (mips_request, mips_common_breakpoint): Update.
* scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
sh_dsp_show_regs): Update.
* xcoffsolib.c (sharedlibrary_command): Update.
* maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
Use hex_string_custom instead of paddr.
(print_bfd_section_info): Pass address size.
(print_objfile_section_info): Likewise.
* annotate.h (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* annotate.c (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* source.c (identify_source_line): Update call to annotate_source.
* stack.c (print_frame_info, print_frame): Update call to
annotate_frame_begin.
* breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
(create_breakpoint, create_ada_exception_breakpoint): Update call.
* stack.c (print_block_frame_labels): Add GDBARCH parameter.
(print_frame_label_vars): Update call.
* symmisc.c (print_partial_symbols): Add GDBARCH parameter.
(dump_psymtab): Update call to print_partial_symbols.
(struct print_symbol_args): Add GDBARCH member.
(dump_symtab_1): Set print_symbol_args architecture member.
(print_symbol): Use it.
* windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
parameter.
* windows-tdep.c (windows_xfer_shared_library): Likewise.
* i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
(core_process_module_section): Pass architecture from cpms_data to
windows_xfer_shared_library.
(windows_core_xfer_shared_libraries): Initialize cmps_data
architecture member.
* windows-nat.c (windows_xfer_shared_libraries): Pass architecture
to windows_xfer_shared_library.
* defs.h (print_address): Add GDBARCH parameter.
* printcmd.c (print_address): Add GDBARCH parameter.
(print_scalar_formatted, do_examine): Update call.
* findcmd.c (find_command): Update call.
* tracepoint.c: Include "arch-utils.h".
(trace_find_line_command): Update call.
* tui/tui-disasm.c (tui_disassemble): Update call.
* value.h (print_address_demangle): Add GDBARCH parameter.
* printcmd.c (print_address_demangle): Add GDBARCH parameter.
* c-valprint.c (print_function_pointer_address, c_val_print):
Update call.
* f-valprint.c (f_val_print): Update call.
* gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
* jv-valprint.c (java_val_print): Update call.
* m2-valprint.c (print_function_pointer_address, m2_val_print):
Update call.
* p-valprint.c (pascal_val_print): Update call.
* disasm.c (gdb_disassemble_info): Install architecture into
di.application_data field.
testsuite/ChangeLog:
* gdb.threads/tls-shared.exp: Update to locexpr_describe_location
change to prefix TLS offset in hex with 0x.
doc/ChangeLog:
* gdbint.texinfo (Item Output Functions): Update signature
for ui_out_field_core_addr.
2009-07-03 01:21:10 +08:00
|
|
|
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
2009-08-10 11:04:45 +08:00
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
|
|
|
ULONGEST tmpulongest;
|
|
|
|
CORE_ADDR tmpaddr;
|
|
|
|
int tmpint;
|
2009-04-30 11:04:28 +08:00
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
switch (syscall)
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_restart_syscall:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_exit:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
int q;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
target_terminal_ours ();
|
|
|
|
q = yquery (_("The next instruction is syscall exit. "
|
|
|
|
"It will make the program exit. "
|
|
|
|
"Do you want to stop the program?"));
|
|
|
|
target_terminal_inferior ();
|
|
|
|
if (q)
|
|
|
|
return 1;
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_fork:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_read:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST addr, count;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &addr);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) addr, (int) count))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_write:
|
|
|
|
case gdb_sys_open:
|
|
|
|
case gdb_sys_close:
|
2015-10-30 23:51:59 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_waitpid:
|
2015-10-30 23:51:59 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_creat:
|
|
|
|
case gdb_sys_link:
|
|
|
|
case gdb_sys_unlink:
|
|
|
|
case gdb_sys_execve:
|
|
|
|
case gdb_sys_chdir:
|
2015-10-30 23:51:59 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_time:
|
2015-10-30 23:51:59 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_time_t))
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mknod:
|
|
|
|
case gdb_sys_chmod:
|
|
|
|
case gdb_sys_lchown16:
|
|
|
|
case gdb_sys_ni_syscall17:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gdb_sys_stat:
|
|
|
|
case gdb_sys_fstat:
|
|
|
|
case gdb_sys_lstat:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size__old_kernel_stat))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_lseek:
|
|
|
|
case gdb_sys_getpid:
|
|
|
|
case gdb_sys_mount:
|
|
|
|
case gdb_sys_oldumount:
|
|
|
|
case gdb_sys_setuid16:
|
|
|
|
case gdb_sys_getuid16:
|
|
|
|
case gdb_sys_stime:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ptrace:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest == RECORD_PTRACE_PEEKTEXT
|
|
|
|
|| tmpulongest == RECORD_PTRACE_PEEKDATA
|
|
|
|
|| tmpulongest == RECORD_PTRACE_PEEKUSR)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 4))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_alarm:
|
|
|
|
case gdb_sys_pause:
|
|
|
|
case gdb_sys_utime:
|
|
|
|
case gdb_sys_ni_syscall31:
|
|
|
|
case gdb_sys_ni_syscall32:
|
|
|
|
case gdb_sys_access:
|
|
|
|
case gdb_sys_nice:
|
|
|
|
case gdb_sys_ni_syscall35:
|
|
|
|
case gdb_sys_sync:
|
|
|
|
case gdb_sys_kill:
|
|
|
|
case gdb_sys_rename:
|
|
|
|
case gdb_sys_mkdir:
|
|
|
|
case gdb_sys_rmdir:
|
|
|
|
case gdb_sys_dup:
|
2015-10-30 23:51:59 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_pipe:
|
2015-10-30 23:51:59 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int * 2))
|
2009-09-09 06:50:59 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case gdb_sys_times:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_tms))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ni_syscall44:
|
|
|
|
case gdb_sys_brk:
|
|
|
|
case gdb_sys_setgid16:
|
|
|
|
case gdb_sys_getgid16:
|
|
|
|
case gdb_sys_signal:
|
|
|
|
case gdb_sys_geteuid16:
|
|
|
|
case gdb_sys_getegid16:
|
|
|
|
case gdb_sys_acct:
|
|
|
|
case gdb_sys_umount:
|
|
|
|
case gdb_sys_ni_syscall53:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gdb_sys_ioctl:
|
2009-04-30 11:04:28 +08:00
|
|
|
/* XXX Need to add a lot of support of other ioctl requests. */
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest == tdep->ioctl_FIOCLEX
|
|
|
|
|| tmpulongest == tdep->ioctl_FIONCLEX
|
|
|
|
|| tmpulongest == tdep->ioctl_FIONBIO
|
|
|
|
|| tmpulongest == tdep->ioctl_FIOASYNC
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETS
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETSW
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETSF
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETA
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETAW
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETAF
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSBRK
|
|
|
|
|| tmpulongest == tdep->ioctl_TCXONC
|
|
|
|
|| tmpulongest == tdep->ioctl_TCFLSH
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCEXCL
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCNXCL
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSCTTY
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSPGRP
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSTI
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSWINSZ
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCMBIS
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCMBIC
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCMSET
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSSOFTCAR
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCCONS
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSSERIAL
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCPKT
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCNOTTY
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSETD
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSBRKP
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCTTYGSTRUCT
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSBRK
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCCBRK
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETS2
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETSW2
|
|
|
|
|| tmpulongest == tdep->ioctl_TCSETSF2
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSPTLCK
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSERCONFIG
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSERGWILD
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSERSWILD
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSLCKTRMIOS
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSERGETMULTI
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSERSETMULTI
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCMIWAIT
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSHAYESESP)
|
|
|
|
{
|
|
|
|
/* Nothing to do. */
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TCGETS
|
|
|
|
|| tmpulongest == tdep->ioctl_TCGETA
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCGLCKTRMIOS)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_termios))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCGPGRP
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCGSID)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_pid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCOUTQ
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCMGET
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCGSOFTCAR
|
|
|
|
|| tmpulongest == tdep->ioctl_FIONREAD
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCINQ
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCGETD
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCGPTN
|
|
|
|
|| tmpulongest == tdep->ioctl_TIOCSERGETLSR)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCGWINSZ)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_winsize))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCLINUX)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2009-09-09 06:50:59 +08:00
|
|
|
/* This syscall affects a char-size memory. */
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 1))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCGSERIAL)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_serial_struct))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TCGETS2)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_termios2))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_FIOQSIZE)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_loff_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCGICOUNT)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_serial_icounter_struct))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCGHAYESESP)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_hayes_esp_config))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest == tdep->ioctl_TIOCSERGSTRUCT)
|
|
|
|
{
|
|
|
|
printf_unfiltered (_("Process record and replay target doesn't "
|
|
|
|
"support ioctl request TIOCSERGSTRUCT\n"));
|
|
|
|
return 1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
else
|
2009-08-10 11:04:45 +08:00
|
|
|
{
|
|
|
|
printf_unfiltered (_("Process record and replay target doesn't "
|
|
|
|
"support ioctl request 0x%s.\n"),
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2));
|
|
|
|
return 1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_fcntl:
|
2009-04-30 11:04:28 +08:00
|
|
|
/* XXX */
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2009-04-30 11:04:28 +08:00
|
|
|
sys_fcntl:
|
2009-08-10 11:04:45 +08:00
|
|
|
if (tmpulongest == tdep->fcntl_F_GETLK)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_flock))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ni_syscall56:
|
|
|
|
case gdb_sys_setpgid:
|
|
|
|
case gdb_sys_ni_syscall58:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_olduname:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_oldold_utsname))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_umask:
|
|
|
|
case gdb_sys_chroot:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ustat:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_ustat))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_dup2:
|
|
|
|
case gdb_sys_getppid:
|
|
|
|
case gdb_sys_getpgrp:
|
|
|
|
case gdb_sys_setsid:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sigaction:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_sigaction))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sgetmask:
|
|
|
|
case gdb_sys_ssetmask:
|
|
|
|
case gdb_sys_setreuid16:
|
|
|
|
case gdb_sys_setregid16:
|
|
|
|
case gdb_sys_sigsuspend:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sigpending:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_sigset_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sethostname:
|
|
|
|
case gdb_sys_setrlimit:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_old_getrlimit:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_rlimit))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getrusage:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_rusage))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_gettimeofday:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timeval))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timezone))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_settimeofday:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getgroups16:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2015-10-30 23:51:59 +08:00
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST gidsetsize;
|
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1,
|
|
|
|
&gidsetsize);
|
|
|
|
tmpint = tdep->size_old_gid_t * (int) gidsetsize;
|
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
|
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_setgroups16:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_old_select:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2015-10-30 23:52:01 +08:00
|
|
|
unsigned long sz_sel_arg = tdep->size_long + tdep->size_pointer * 4;
|
|
|
|
gdb_byte *a = (gdb_byte *) alloca (sz_sel_arg);
|
|
|
|
CORE_ADDR inp, outp, exp, tvp;
|
2009-08-10 11:04:45 +08:00
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
2015-10-30 23:52:01 +08:00
|
|
|
if (target_read_memory (tmpulongest, a, sz_sel_arg))
|
2009-08-10 11:04:45 +08:00
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading memory "
|
|
|
|
"at addr = 0x%s len = %lu.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg1),
|
2015-10-30 23:52:01 +08:00
|
|
|
sz_sel_arg);
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2015-10-30 23:52:01 +08:00
|
|
|
/* Skip n. */
|
|
|
|
a += tdep->size_long;
|
|
|
|
inp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
|
|
|
a += tdep->size_pointer;
|
|
|
|
outp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
|
|
|
a += tdep->size_pointer;
|
|
|
|
exp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
|
|
|
a += tdep->size_pointer;
|
|
|
|
tvp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
|
|
|
if (inp)
|
|
|
|
if (record_full_arch_list_add_mem (inp, tdep->size_fd_set))
|
|
|
|
return -1;
|
|
|
|
if (outp)
|
|
|
|
if (record_full_arch_list_add_mem (outp, tdep->size_fd_set))
|
|
|
|
return -1;
|
|
|
|
if (exp)
|
|
|
|
if (record_full_arch_list_add_mem (exp, tdep->size_fd_set))
|
|
|
|
return -1;
|
|
|
|
if (tvp)
|
|
|
|
if (record_full_arch_list_add_mem (tvp, tdep->size_timeval))
|
|
|
|
return -1;
|
2009-08-10 11:04:45 +08:00
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_symlink:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_readlink:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST len;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, (int) len))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_uselib:
|
|
|
|
case gdb_sys_swapon:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_reboot:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
int q;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
target_terminal_ours ();
|
2010-05-15 07:41:05 +08:00
|
|
|
q = yquery (_("The next instruction is syscall reboot. "
|
|
|
|
"It will restart the computer. "
|
|
|
|
"Do you want to stop the program?"));
|
2009-08-10 11:04:45 +08:00
|
|
|
target_terminal_inferior ();
|
|
|
|
if (q)
|
|
|
|
return 1;
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_old_readdir:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
gdb/linux-record: Fix readdir and getdents handling
getdents buffer size is given in bytes, not dirent entries (which have
variable size anyway). We don't need size_dirent and size_dirent64 for
this reason.
readdir, on the other hand, needs size of old_linux_dirent, which is
a somewhat different structure. Accordingly, rename size_dirent
to size_old_dirent.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove
size_dirent{,64}, add size_old_dirent.
* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
(amd64_x32_linux_init_abi): Remove size_dirent{,64}, add
size_old_dirent.
* arm-linux-tdep.c (arm_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* i386-linux-tdep.c (i386_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* linux-record.c (record_linux_system_call): Fix handling of readdir
and getdents{,64}.
* linux-record.h (struct linux_record_tdep): Remove size_dirent{,64},
add size_old_dirent.
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove
size_dirent{,64}, add size_old_dirent.
2015-10-30 23:51:58 +08:00
|
|
|
tdep->size_old_dirent))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_old_mmap:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_munmap:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST len;
|
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1,
|
|
|
|
&tmpulongest);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &len);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_memory_query)
|
2010-06-22 10:15:46 +08:00
|
|
|
{
|
|
|
|
int q;
|
|
|
|
|
|
|
|
target_terminal_ours ();
|
|
|
|
q = yquery (_("\
|
|
|
|
The next instruction is syscall munmap.\n\
|
|
|
|
It will free the memory addr = 0x%s len = %u.\n\
|
|
|
|
It will make record target cannot record some memory change.\n\
|
|
|
|
Do you want to stop the program?"),
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg1), (int) len);
|
|
|
|
target_terminal_inferior ();
|
|
|
|
if (q)
|
|
|
|
return 1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_truncate:
|
|
|
|
case gdb_sys_ftruncate:
|
|
|
|
case gdb_sys_fchmod:
|
|
|
|
case gdb_sys_fchown16:
|
|
|
|
case gdb_sys_getpriority:
|
|
|
|
case gdb_sys_setpriority:
|
|
|
|
case gdb_sys_ni_syscall98:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gdb_sys_statfs:
|
|
|
|
case gdb_sys_fstatfs:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_statfs))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ioperm:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_socket:
|
|
|
|
case gdb_sys_sendto:
|
|
|
|
case gdb_sys_sendmsg:
|
|
|
|
case gdb_sys_shutdown:
|
|
|
|
case gdb_sys_bind:
|
|
|
|
case gdb_sys_connect:
|
|
|
|
case gdb_sys_listen:
|
|
|
|
case gdb_sys_setsockopt:
|
2009-08-10 11:04:45 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_accept:
|
|
|
|
case gdb_sys_getsockname:
|
|
|
|
case gdb_sys_getpeername:
|
2009-08-10 11:04:45 +08:00
|
|
|
{
|
|
|
|
ULONGEST len;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
|
|
|
|
if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_recvfrom:
|
2009-08-10 11:04:45 +08:00
|
|
|
{
|
|
|
|
ULONGEST len;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5, &len);
|
|
|
|
if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
|
|
|
|
return -1;
|
|
|
|
}
|
2011-03-01 02:10:30 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_recv:
|
2009-08-10 11:04:45 +08:00
|
|
|
{
|
|
|
|
ULONGEST size;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &size);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) size))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_recvmsg:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (record_linux_msghdr (regcache, tdep, tmpulongest))
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_socketpair:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getsockopt:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST optvalp;
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *optlenp = (gdb_byte *) alloca (tdep->size_int);
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, optlenp,
|
|
|
|
tdep->size_int))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s "
|
|
|
|
"len = %d.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg5),
|
|
|
|
tdep->size_int);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &optvalp);
|
|
|
|
tmpint = (int) extract_signed_integer (optlenp, tdep->size_int,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) optvalp, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_socketcall:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
switch (tmpulongest)
|
|
|
|
{
|
|
|
|
case RECORD_SYS_SOCKET:
|
|
|
|
case RECORD_SYS_BIND:
|
|
|
|
case RECORD_SYS_CONNECT:
|
|
|
|
case RECORD_SYS_LISTEN:
|
|
|
|
break;
|
|
|
|
case RECORD_SYS_ACCEPT:
|
|
|
|
case RECORD_SYS_GETSOCKNAME:
|
|
|
|
case RECORD_SYS_GETPEERNAME:
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST len;
|
|
|
|
|
|
|
|
tmpulongest += tdep->size_ulong;
|
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, a,
|
|
|
|
tdep->size_ulong * 2))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2),
|
|
|
|
tdep->size_ulong * 2);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
tmpulongest = extract_unsigned_integer (a,
|
|
|
|
tdep->size_ulong,
|
|
|
|
byte_order);
|
|
|
|
len = extract_unsigned_integer (a + tdep->size_ulong,
|
|
|
|
tdep->size_ulong, byte_order);
|
|
|
|
if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RECORD_SYS_SOCKETPAIR:
|
|
|
|
{
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong);
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
tmpulongest += tdep->size_ulong * 3;
|
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, a,
|
|
|
|
tdep->size_ulong))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2),
|
|
|
|
tdep->size_ulong);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
tmpaddr
|
|
|
|
= (CORE_ADDR) extract_unsigned_integer (a, tdep->size_ulong,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem (tmpaddr, tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RECORD_SYS_SEND:
|
|
|
|
case RECORD_SYS_SENDTO:
|
|
|
|
break;
|
|
|
|
case RECORD_SYS_RECVFROM:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST len;
|
|
|
|
|
|
|
|
tmpulongest += tdep->size_ulong * 4;
|
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, a,
|
|
|
|
tdep->size_ulong * 2))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2),
|
|
|
|
tdep->size_ulong * 2);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
tmpulongest = extract_unsigned_integer (a, tdep->size_ulong,
|
|
|
|
byte_order);
|
|
|
|
len = extract_unsigned_integer (a + tdep->size_ulong,
|
|
|
|
tdep->size_ulong, byte_order);
|
|
|
|
if (record_linux_sockaddr (regcache, tdep, tmpulongest, len))
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
case RECORD_SYS_RECV:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
|
2009-08-10 11:04:45 +08:00
|
|
|
|
|
|
|
tmpulongest += tdep->size_ulong;
|
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, a,
|
|
|
|
tdep->size_ulong))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2),
|
|
|
|
tdep->size_ulong);
|
2016-01-26 03:29:54 +08:00
|
|
|
return -1;
|
2009-08-10 11:04:45 +08:00
|
|
|
}
|
|
|
|
tmpulongest = extract_unsigned_integer (a, tdep->size_ulong,
|
|
|
|
byte_order);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
a += tdep->size_ulong;
|
|
|
|
tmpint = (int) extract_unsigned_integer (a, tdep->size_ulong,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RECORD_SYS_SHUTDOWN:
|
|
|
|
case RECORD_SYS_SETSOCKOPT:
|
|
|
|
break;
|
|
|
|
case RECORD_SYS_GETSOCKOPT:
|
|
|
|
{
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong * 2);
|
|
|
|
gdb_byte *av = (gdb_byte *) alloca (tdep->size_int);
|
2009-08-10 11:04:45 +08:00
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
tmpulongest += tdep->size_ulong * 3;
|
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, a,
|
|
|
|
tdep->size_ulong * 2))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2),
|
|
|
|
tdep->size_ulong * 2);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
tmpulongest = extract_unsigned_integer (a + tdep->size_ulong,
|
|
|
|
tdep->size_ulong,
|
|
|
|
byte_order);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, av,
|
|
|
|
tdep->size_int))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s "
|
|
|
|
"len = %d.\n",
|
|
|
|
phex_nz (tmpulongest,
|
|
|
|
tdep->size_ulong),
|
|
|
|
tdep->size_int);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
tmpaddr
|
|
|
|
= (CORE_ADDR) extract_unsigned_integer (a,
|
|
|
|
tdep->size_ulong,
|
|
|
|
byte_order);
|
|
|
|
tmpint = (int) extract_unsigned_integer (av,
|
|
|
|
tdep->size_int,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem (tmpaddr, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
a += tdep->size_ulong;
|
|
|
|
tmpaddr
|
|
|
|
= (CORE_ADDR) extract_unsigned_integer (a,
|
|
|
|
tdep->size_ulong,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem (tmpaddr,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RECORD_SYS_SENDMSG:
|
|
|
|
break;
|
|
|
|
case RECORD_SYS_RECVMSG:
|
|
|
|
{
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *a = (gdb_byte *) alloca (tdep->size_ulong);
|
2009-08-10 11:04:45 +08:00
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
tmpulongest += tdep->size_ulong;
|
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, a,
|
|
|
|
tdep->size_ulong))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2),
|
|
|
|
tdep->size_ulong);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
tmpulongest = extract_unsigned_integer (a, tdep->size_ulong,
|
|
|
|
byte_order);
|
|
|
|
if (record_linux_msghdr (regcache, tdep, tmpulongest))
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf_unfiltered (_("Process record and replay target "
|
|
|
|
"doesn't support socketcall call 0x%s\n"),
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg1));
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_syslog:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_setitimer:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_itimerval))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getitimer:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_itimerval))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_newstat:
|
|
|
|
case gdb_sys_newlstat:
|
|
|
|
case gdb_sys_newfstat:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_stat))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2015-10-30 23:52:00 +08:00
|
|
|
case gdb_sys_newfstatat:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_stat))
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_uname:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_utsname))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_iopl:
|
|
|
|
case gdb_sys_vhangup:
|
|
|
|
case gdb_sys_ni_syscall112:
|
|
|
|
case gdb_sys_vm86old:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_wait4:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_rusage))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_swapoff:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sysinfo:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_sysinfo))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_shmget:
|
|
|
|
case gdb_sys_semget:
|
|
|
|
case gdb_sys_semop:
|
|
|
|
case gdb_sys_msgget:
|
2009-08-10 11:04:45 +08:00
|
|
|
/* XXX maybe need do some record works with sys_shmdt. */
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_shmdt:
|
|
|
|
case gdb_sys_msgsnd:
|
|
|
|
case gdb_sys_semtimedop:
|
2009-08-10 11:04:45 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_shmat:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_ulong))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_shmctl:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_shmid_ds))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
/* XXX sys_semctl 525 still not supported. */
|
2009-08-10 11:04:45 +08:00
|
|
|
/* sys_semctl */
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_msgrcv:
|
2009-08-10 11:04:45 +08:00
|
|
|
{
|
|
|
|
ULONGEST msgp;
|
2013-03-08 02:29:05 +08:00
|
|
|
LONGEST l;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2013-03-08 02:29:05 +08:00
|
|
|
regcache_raw_read_signed (regcache, tdep->arg3, &l);
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &msgp);
|
2013-03-08 02:29:05 +08:00
|
|
|
tmpint = l + tdep->size_long;
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) msgp, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_msgctl:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_msqid_ds))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ipc:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
tmpulongest &= 0xffff;
|
|
|
|
switch (tmpulongest)
|
|
|
|
{
|
|
|
|
case RECORD_SEMOP:
|
|
|
|
case RECORD_SEMGET:
|
|
|
|
case RECORD_SEMTIMEDOP:
|
|
|
|
case RECORD_MSGSND:
|
|
|
|
case RECORD_MSGGET:
|
2009-09-09 06:50:59 +08:00
|
|
|
/* XXX maybe need do some record works with RECORD_SHMDT. */
|
2009-08-10 11:04:45 +08:00
|
|
|
case RECORD_SHMDT:
|
|
|
|
case RECORD_SHMGET:
|
|
|
|
break;
|
|
|
|
case RECORD_MSGRCV:
|
|
|
|
{
|
2013-03-08 02:29:05 +08:00
|
|
|
LONGEST second;
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST ptr;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_signed (regcache, tdep->arg3, &second);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5, &ptr);
|
|
|
|
tmpint = (int) second + tdep->size_long;
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) ptr, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RECORD_MSGCTL:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_msqid_ds))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
case RECORD_SHMAT:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_ulong))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
case RECORD_SHMCTL:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_shmid_ds))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
default:
|
2009-09-09 06:50:59 +08:00
|
|
|
/* XXX RECORD_SEMCTL still not supported. */
|
2009-08-10 11:04:45 +08:00
|
|
|
printf_unfiltered (_("Process record and replay target doesn't "
|
2009-09-09 06:50:59 +08:00
|
|
|
"support ipc number %s\n"),
|
|
|
|
pulongest (tmpulongest));
|
2009-08-10 11:04:45 +08:00
|
|
|
break;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_fsync:
|
|
|
|
case gdb_sys_sigreturn:
|
|
|
|
case gdb_sys_clone:
|
|
|
|
case gdb_sys_setdomainname:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_newuname:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_new_utsname))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_modify_ldt:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest == 0 || tmpulongest == 2)
|
|
|
|
{
|
|
|
|
ULONGEST ptr, bytecount;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &ptr);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &bytecount);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) ptr, (int) bytecount))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_adjtimex:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timex))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mprotect:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sigprocmask:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_sigset_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ni_syscall127:
|
|
|
|
case gdb_sys_init_module:
|
|
|
|
case gdb_sys_delete_module:
|
|
|
|
case gdb_sys_ni_syscall130:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_quotactl:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
switch (tmpulongest)
|
|
|
|
{
|
|
|
|
case RECORD_Q_GETFMT:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4,
|
|
|
|
&tmpulongest);
|
|
|
|
/* __u32 */
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 4))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
case RECORD_Q_GETINFO:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_mem_dqinfo))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
case RECORD_Q_GETQUOTA:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_if_dqblk))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
case RECORD_Q_XGETQSTAT:
|
|
|
|
case RECORD_Q_XGETQUOTA:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_fs_quota_stat))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getpgid:
|
|
|
|
case gdb_sys_fchdir:
|
|
|
|
case gdb_sys_bdflush:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sysfs:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest == 2)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2009-09-09 06:50:59 +08:00
|
|
|
/*XXX the size of memory is not very clear. */
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, 10))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_personality:
|
|
|
|
case gdb_sys_ni_syscall137:
|
|
|
|
case gdb_sys_setfsuid16:
|
|
|
|
case gdb_sys_setfsgid16:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_llseek:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_loff_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getdents:
|
gdb/linux-record: Fix readdir and getdents handling
getdents buffer size is given in bytes, not dirent entries (which have
variable size anyway). We don't need size_dirent and size_dirent64 for
this reason.
readdir, on the other hand, needs size of old_linux_dirent, which is
a somewhat different structure. Accordingly, rename size_dirent
to size_old_dirent.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove
size_dirent{,64}, add size_old_dirent.
* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
(amd64_x32_linux_init_abi): Remove size_dirent{,64}, add
size_old_dirent.
* arm-linux-tdep.c (arm_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* i386-linux-tdep.c (i386_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* linux-record.c (record_linux_system_call): Fix handling of readdir
and getdents{,64}.
* linux-record.h (struct linux_record_tdep): Remove size_dirent{,64},
add size_old_dirent.
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove
size_dirent{,64}, add size_old_dirent.
2015-10-30 23:51:58 +08:00
|
|
|
case gdb_sys_getdents64:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST count;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
|
gdb/linux-record: Fix readdir and getdents handling
getdents buffer size is given in bytes, not dirent entries (which have
variable size anyway). We don't need size_dirent and size_dirent64 for
this reason.
readdir, on the other hand, needs size of old_linux_dirent, which is
a somewhat different structure. Accordingly, rename size_dirent
to size_old_dirent.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove
size_dirent{,64}, add size_old_dirent.
* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
(amd64_x32_linux_init_abi): Remove size_dirent{,64}, add
size_old_dirent.
* arm-linux-tdep.c (arm_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* i386-linux-tdep.c (i386_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* linux-record.c (record_linux_system_call): Fix handling of readdir
and getdents{,64}.
* linux-record.h (struct linux_record_tdep): Remove size_dirent{,64},
add size_old_dirent.
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove
size_dirent{,64}, add size_old_dirent.
2015-10-30 23:51:58 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, count))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_select:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_fd_set))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_fd_set))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_fd_set))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timeval))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_flock:
|
|
|
|
case gdb_sys_msync:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_readv:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
ULONGEST vec, vlen;
|
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &vec);
|
|
|
|
if (vec)
|
|
|
|
{
|
2015-09-26 02:08:06 +08:00
|
|
|
gdb_byte *iov = (gdb_byte *) alloca (tdep->size_iovec);
|
2009-08-10 11:04:45 +08:00
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &vlen);
|
|
|
|
for (tmpulongest = 0; tmpulongest < vlen; tmpulongest++)
|
|
|
|
{
|
|
|
|
if (target_read_memory ((CORE_ADDR) vec, iov,
|
|
|
|
tdep->size_iovec))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading "
|
|
|
|
"memory at addr = 0x%s len = %d.\n",
|
|
|
|
OUTPUT_REG (vec, tdep->arg2),
|
|
|
|
tdep->size_iovec);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
tmpaddr
|
|
|
|
= (CORE_ADDR) extract_unsigned_integer (iov,
|
|
|
|
tdep->size_pointer,
|
|
|
|
byte_order);
|
|
|
|
tmpint
|
|
|
|
= (int) extract_unsigned_integer (iov + tdep->size_pointer,
|
|
|
|
tdep->size_size_t,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem (tmpaddr, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
vec += tdep->size_iovec;
|
|
|
|
}
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_writev:
|
|
|
|
case gdb_sys_getsid:
|
|
|
|
case gdb_sys_fdatasync:
|
|
|
|
case gdb_sys_sysctl:
|
|
|
|
case gdb_sys_mlock:
|
|
|
|
case gdb_sys_munlock:
|
|
|
|
case gdb_sys_mlockall:
|
|
|
|
case gdb_sys_munlockall:
|
|
|
|
case gdb_sys_sched_setparam:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gdb_sys_sched_getparam:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sched_setscheduler:
|
|
|
|
case gdb_sys_sched_getscheduler:
|
|
|
|
case gdb_sys_sched_yield:
|
|
|
|
case gdb_sys_sched_get_priority_max:
|
|
|
|
case gdb_sys_sched_get_priority_min:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sched_rr_get_interval:
|
|
|
|
case gdb_sys_nanosleep:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timespec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mremap:
|
|
|
|
case gdb_sys_setresuid16:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getresuid16:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_uid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_uid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_uid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_vm86:
|
|
|
|
case gdb_sys_ni_syscall167:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_poll:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST nfds;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &nfds);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_pollfd * nfds))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_nfsservctl:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest == 7 || tmpulongest == 8)
|
|
|
|
{
|
|
|
|
int rsize;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
if (tmpulongest == 7)
|
|
|
|
rsize = tdep->size_NFS_FHSIZE;
|
|
|
|
else
|
|
|
|
rsize = tdep->size_knfsd_fh;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, rsize))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_setresgid16:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getresgid16:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_gid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_gid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_old_gid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_prctl:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
switch (tmpulongest)
|
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_TASK_COMM_LEN))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_rt_sigreturn:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_rt_sigaction:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_sigaction))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_rt_sigprocmask:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_sigset_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_rt_sigpending:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST sigsetsize;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2,&sigsetsize);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) sigsetsize))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_rt_sigtimedwait:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_siginfo_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_rt_sigqueueinfo:
|
|
|
|
case gdb_sys_rt_sigsuspend:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_pread64:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST count;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,&count);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) count))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_pwrite64:
|
|
|
|
case gdb_sys_chown16:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getcwd:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST size;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &size);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) size))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_capget:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_cap_user_data_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_capset:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sigaltstack:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_stack_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sendfile:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_off_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ni_syscall188:
|
|
|
|
case gdb_sys_ni_syscall189:
|
|
|
|
case gdb_sys_vfork:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getrlimit:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_rlimit))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mmap2:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_truncate64:
|
|
|
|
case gdb_sys_ftruncate64:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_stat64:
|
|
|
|
case gdb_sys_lstat64:
|
|
|
|
case gdb_sys_fstat64:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_stat64))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_lchown:
|
|
|
|
case gdb_sys_getuid:
|
|
|
|
case gdb_sys_getgid:
|
|
|
|
case gdb_sys_geteuid:
|
|
|
|
case gdb_sys_getegid:
|
|
|
|
case gdb_sys_setreuid:
|
|
|
|
case gdb_sys_setregid:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getgroups:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST gidsetsize;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1,
|
|
|
|
&gidsetsize);
|
|
|
|
tmpint = tdep->size_gid_t * (int) gidsetsize;
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_setgroups:
|
|
|
|
case gdb_sys_fchown:
|
|
|
|
case gdb_sys_setresuid:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getresuid:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_uid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_uid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_uid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_setresgid:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getresgid:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_gid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_gid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_gid_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_chown:
|
|
|
|
case gdb_sys_setuid:
|
|
|
|
case gdb_sys_setgid:
|
|
|
|
case gdb_sys_setfsuid:
|
|
|
|
case gdb_sys_setfsgid:
|
|
|
|
case gdb_sys_pivot_root:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mincore:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_PAGE_SIZE))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_madvise:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_fcntl64:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest == tdep->fcntl_F_GETLK64)
|
2009-05-22 22:07:27 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_flock64))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else if (tmpulongest != tdep->fcntl_F_SETLK64
|
|
|
|
&& tmpulongest != tdep->fcntl_F_SETLKW64)
|
2009-05-22 22:07:27 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
goto sys_fcntl;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ni_syscall222:
|
|
|
|
case gdb_sys_ni_syscall223:
|
|
|
|
case gdb_sys_gettid:
|
|
|
|
case gdb_sys_readahead:
|
|
|
|
case gdb_sys_setxattr:
|
|
|
|
case gdb_sys_lsetxattr:
|
|
|
|
case gdb_sys_fsetxattr:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gdb_sys_getxattr:
|
|
|
|
case gdb_sys_lgetxattr:
|
|
|
|
case gdb_sys_fgetxattr:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST size;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &size);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) size))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_listxattr:
|
|
|
|
case gdb_sys_llistxattr:
|
|
|
|
case gdb_sys_flistxattr:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST size;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &size);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) size))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_removexattr:
|
|
|
|
case gdb_sys_lremovexattr:
|
|
|
|
case gdb_sys_fremovexattr:
|
|
|
|
case gdb_sys_tkill:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sendfile64:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_loff_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_futex:
|
|
|
|
case gdb_sys_sched_setaffinity:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sched_getaffinity:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST len;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &len);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) len))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_set_thread_area:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_get_thread_area:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_user_desc))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_io_setup:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_long))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_io_destroy:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_io_getevents:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST nr;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &nr);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
nr * tdep->size_io_event))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_io_submit:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST nr, i;
|
|
|
|
gdb_byte *iocbp;
|
|
|
|
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &nr);
|
2015-09-26 02:08:06 +08:00
|
|
|
iocbp = (gdb_byte *) alloca (nr * tdep->size_pointer);
|
2009-08-10 11:04:45 +08:00
|
|
|
if (target_read_memory ((CORE_ADDR) tmpulongest, iocbp,
|
|
|
|
nr * tdep->size_pointer))
|
|
|
|
{
|
|
|
|
if (record_debug)
|
|
|
|
fprintf_unfiltered (gdb_stdlog,
|
|
|
|
"Process record: error reading memory "
|
|
|
|
"at addr = 0x%s len = %u.\n",
|
|
|
|
OUTPUT_REG (tmpulongest, tdep->arg2),
|
|
|
|
(int) (nr * tdep->size_pointer));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
for (i = 0; i < nr; i++)
|
|
|
|
{
|
|
|
|
tmpaddr
|
|
|
|
= (CORE_ADDR) extract_unsigned_integer (iocbp,
|
|
|
|
tdep->size_pointer,
|
|
|
|
byte_order);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem (tmpaddr, tdep->size_iocb))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
iocbp += tdep->size_pointer;
|
|
|
|
}
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_io_cancel:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_io_event))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_fadvise64:
|
|
|
|
case gdb_sys_ni_syscall251:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_exit_group:
|
2009-04-30 11:04:28 +08:00
|
|
|
{
|
2009-08-10 11:04:45 +08:00
|
|
|
int q;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
target_terminal_ours ();
|
|
|
|
q = yquery (_("The next instruction is syscall exit_group. "
|
|
|
|
"It will make the program exit. "
|
|
|
|
"Do you want to stop the program?"));
|
|
|
|
target_terminal_inferior ();
|
|
|
|
if (q)
|
|
|
|
return 1;
|
2009-04-30 11:04:28 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_lookup_dcookie:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST len;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &len);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) len))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_epoll_create:
|
|
|
|
case gdb_sys_epoll_ctl:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_epoll_wait:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST maxevents;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &maxevents);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(maxevents
|
|
|
|
* tdep->size_epoll_event)))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_remap_file_pages:
|
|
|
|
case gdb_sys_set_tid_address:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_timer_create:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_timer_settime:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_itimerspec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_timer_gettime:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_itimerspec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_timer_getoverrun:
|
|
|
|
case gdb_sys_timer_delete:
|
|
|
|
case gdb_sys_clock_settime:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_clock_gettime:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timespec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_clock_getres:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timespec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_clock_nanosleep:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timespec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_statfs64:
|
|
|
|
case gdb_sys_fstatfs64:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_statfs64))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_tgkill:
|
|
|
|
case gdb_sys_utimes:
|
|
|
|
case gdb_sys_fadvise64_64:
|
|
|
|
case gdb_sys_ni_syscall273:
|
|
|
|
case gdb_sys_mbind:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_get_mempolicy:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST maxnode;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &maxnode);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
maxnode * tdep->size_long))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_set_mempolicy:
|
|
|
|
case gdb_sys_mq_open:
|
|
|
|
case gdb_sys_mq_unlink:
|
|
|
|
case gdb_sys_mq_timedsend:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mq_timedreceive:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST msg_len;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &msg_len);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) msg_len))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mq_notify:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_mq_getsetattr:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_mq_attr))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_kexec_load:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_waitid:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
2015-10-30 23:51:56 +08:00
|
|
|
tdep->size_siginfo_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_rusage))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ni_syscall285:
|
|
|
|
case gdb_sys_add_key:
|
|
|
|
case gdb_sys_request_key:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_keyctl:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest == 6 || tmpulongest == 11)
|
|
|
|
{
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3,
|
|
|
|
&tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST buflen;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &buflen);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) buflen))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ioprio_set:
|
|
|
|
case gdb_sys_ioprio_get:
|
|
|
|
case gdb_sys_inotify_init:
|
|
|
|
case gdb_sys_inotify_add_watch:
|
|
|
|
case gdb_sys_inotify_rm_watch:
|
|
|
|
case gdb_sys_migrate_pages:
|
|
|
|
case gdb_sys_openat:
|
|
|
|
case gdb_sys_mkdirat:
|
|
|
|
case gdb_sys_mknodat:
|
|
|
|
case gdb_sys_fchownat:
|
|
|
|
case gdb_sys_futimesat:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gdb_sys_fstatat64:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_stat64))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_unlinkat:
|
|
|
|
case gdb_sys_renameat:
|
|
|
|
case gdb_sys_linkat:
|
|
|
|
case gdb_sys_symlinkat:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_readlinkat:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST bufsiz;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &bufsiz);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
(int) bufsiz))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_fchmodat:
|
|
|
|
case gdb_sys_faccessat:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_pselect6:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_fd_set))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_fd_set))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_fd_set))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timespec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_ppoll:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST nfds;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &nfds);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_pollfd * nfds))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_timespec))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_unshare:
|
|
|
|
case gdb_sys_set_robust_list:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_get_robust_list:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_splice:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_loff_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg4, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_loff_t))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_sync_file_range:
|
|
|
|
case gdb_sys_tee:
|
|
|
|
case gdb_sys_vmsplice:
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_move_pages:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST nr_pages;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &nr_pages);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
nr_pages * tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_getcpu:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_int))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
|
|
|
|
tdep->size_ulong * 2))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
2009-09-09 06:50:59 +08:00
|
|
|
case gdb_sys_epoll_pwait:
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
|
|
|
|
if (tmpulongest)
|
|
|
|
{
|
|
|
|
ULONGEST maxevents;
|
2010-05-15 07:41:05 +08:00
|
|
|
|
2009-08-10 11:04:45 +08:00
|
|
|
regcache_raw_read_unsigned (regcache, tdep->arg3, &maxevents);
|
|
|
|
tmpint = (int) maxevents * tdep->size_epoll_event;
|
2013-03-11 16:45:54 +08:00
|
|
|
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
|
2009-08-10 11:04:45 +08:00
|
|
|
return -1;
|
|
|
|
}
|
2009-04-30 11:04:28 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
printf_unfiltered (_("Process record and replay target doesn't "
|
2009-09-09 06:50:59 +08:00
|
|
|
"support syscall number %d\n"), syscall);
|
2009-04-30 11:04:28 +08:00
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|