Commit Graph

18 Commits

Author SHA1 Message Date
Yao Qi 253b4d3a09 Support more syscalls in linux-record: pipe2 epoll_create1 eventfd2 fallocate dup3 and inotify_init1
This patch adds more syscalls in linux-record.

gdb:

2016-02-29  Yao Qi  <yao.qi@linaro.org>

	* linux-record.h (enum gdb_syscall) <gdb_sys_fallocate>: New.
	<gdb_sys_eventfd2, gdb_sys_epoll_create1, gdb_sys_dup3>: New.
	<gdb_sys_pipe2, gdb_sys_inotify_init1>: New.
	* linux-record.c (record_linux_system_call): Handle them.
2016-02-29 16:44:50 +00:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Marcin Kościelnicki b80d067ff0 gdb/linux-record: Support time, waitpid, pipe syscalls
gdb/ChangeLog:

	* aarch64-linux-tdep.c (aarch64_linux_init_abi): Add size_time_t.
	* amd64-linux-tdep.c (amd64_linux_init_abi): Add size_time_t.
	(amd64_x32_linux_init_abi): Add size_time_t.
	* arm-linux-tdep.c (arm_linux_init_abi): Add size_time_t.
	* i386-linux-tdep.c (i386_linux_init_abi): Add size_time_t.
	* linux-record.c (record_linux_system_call): Add time, waitpid, pipe
	handling.
	* linux-record.h (struct linux_record_tdep): Add size_time_t.
	* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Add size_time_t.
2015-10-30 15:51:59 +00:00
Marcin Kościelnicki 72aded8673 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 15:51:58 +00:00
Marcin Kościelnicki aefb52a693 gdb/linux-record: Remove size_siginfo
It's a duplicate of size_siginfo_t.

gdb/ChangeLog:

	* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove size_siginfo.
	* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_siginfo.
	(amd64_x32_linux_init_abi): Remove size_siginfo.
	* arm-linux-tdep.c (arm_linux_init_abi): Remove size_siginfo.
	* i386-linux-tdep.c (i386_linux_init_abi): Remove size_siginfo.
	* linux-record.c (record_linux_system_call): Change size_siginfo
	to size_siginfo_t.
	* linux-record.h (struct linux_record_tdep): Remove size_siginfo.
	* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove size_siginfo.
2015-10-30 15:51:56 +00:00
Simon Marchi f486487f55 Mostly trivial enum fixes
This is a patch I extracted from Pedro's C++ branch.  It contains the
most trivial enum fixes, where an integer type/value was used instead
of the appropriate enum type/value.  It fixes many C++ errors, since
in C++ you can't mix integers and enums implicitely.

Regardless of the C++ conversion, I think this is a good cleanup to make
use of the appropriate enum types.

Regression-tested on native x86_64.

gdb/ChangeLog:

	* aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum
	type or value instead of integer.
	(aarch64_linux_insert_watchpoint): Likewise.
	(aarch64_linux_remove_watchpoint): Likewise.
	* ada-lang.c (ada_op_print_tab): Likewise.
	* amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise.
	(amd64_linux_syscall_record_common): Likewise.
	* arch-utils.c (target_byte_order_user): Likewise.
	(default_byte_order): Likewise.
	* arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise.
	(arm_linux_get_hwbp_type): Likewise.
	(arm_linux_hw_watchpoint_initialize): Likewise.
	(arm_linux_insert_watchpoint): Likewise.
	* arm-linux-tdep.c (arm_canonicalize_syscall): Likewise.
	(arm_linux_syscall_record): Likewise.
	* breakpoint.c (update_watchpoint): Likewise.
	(breakpoint_here_p): Likewise.
	(bpstat_print): Likewise.
	(enable_breakpoint_disp): Likewise.
	* c-lang.c (c_op_print_tab): Likewise.
	* cli/cli-decode.c (add_info_alias): Likewise.
	* d-lang.c (d_op_print_tab): Likewise.
	* eval.c (evaluate_subexp_standard): Likewise.
	* f-exp.y (dot_ops): Likewise.
	(f77_keywords): Likewise.
	* f-lang.c (f_op_print_tab): Likewise.
	* go-lang.c (go_op_print_tab): Likewise.
	* guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise.
	* guile/scm-cmd.c (gdbscm_make_command): Likewise.
	* guile/scm-param.c (gdbscm_make_parameter): Likewise.
	* guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise.
	* guile/scm-string.c (struct scm_to_stringn_data): Likewise.
	(struct scm_from_stringn_data): Likewise.
	* i386-linux-tdep.c (i386_canonicalize_syscall): Likewise.
	* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
	(ia64_linux_remove_watchpoint): Likewise.
	(ia64_linux_can_use_hw_breakpoint): Likewise.
	* infrun.c (print_stop_event): Likewise.
	* jv-lang.c (java_op_print_tab): Likewise.
	* linux-nat.c (linux_proc_xfer_partial): Likewise.
	* linux-nat.h (struct lwp_info): Likewise.
	* linux-thread-db.c (enable_thread_event): Likewise.
	* m2-lang.c (m2_op_print_tab): Likewise.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise.
	(mi_cmd_stack_list_variables): Likewise.
	* mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise.
	* mi/mi-out.c (mi_table_begin): Likewise.
	(mi_table_header): Likewise.
	* mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise.
	(mips_linux_insert_watchpoint): Likewise.
	(mips_linux_remove_watchpoint): Likewise.
	* nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise.
	* nat/mips-linux-watch.h (struct mips_watchpoint): Likewise.
	(mips_linux_watch_type_to_irw): Likewise.
	* nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise.
	(procfs_insert_hw_watchpoint): Likewise.
	(procfs_remove_hw_watchpoint): Likewise.
	(procfs_hw_watchpoint): Likewise.
	(procfs_can_use_hw_breakpoint): Likewise.
	(procfs_remove_hw_watchpoint): Likewise.
	(procfs_insert_hw_watchpoint): Likewise.
	* p-lang.c (pascal_op_print_tab): Likewise.
	* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise.
	* ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise.
	* ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise.
	* procfs.c (procfs_can_use_hw_breakpoint): Likewise.
	(procfs_insert_watchpoint): Likewise.
	(procfs_remove_watchpoint): Likewise.
	* psymtab.c (recursively_search_psymtabs): Likewise.
	* remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise.
	(m32r_insert_watchpoint): Likewise.
	* remote-mips.c (mips_can_use_watchpoint): Likewise.
	(mips_insert_watchpoint): Likewise.
	(mips_remove_watchpoint): Likewise.
	* remote.c (watchpoint_to_Z_packet): Likewise.
	(remote_insert_watchpoint): Likewise.
	(remote_remove_watchpoint): Likewise.
	(remote_check_watch_resources): Likewise.
	* s390-linux-nat.c (s390_insert_watchpoint): Likewise.
	(s390_remove_watchpoint): Likewise.
	(s390_can_use_hw_breakpoint): Likewise.
	* s390-linux-tdep.c (s390_gdbarch_init): Likewise.
	* spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise.
	* target.h (struct target_ops): Likewise.
	* tilegx-tdep.c (tilegx_analyze_prologue): Likewise.
	* ui-out.c (struct ui_out_hdr): Likewise.
	(append_header_to_list): Likewise.
	(get_next_header): Likewise.
	(verify_field): Likewise.
	(ui_out_begin): Likewise.
	(ui_out_field_int): Likewise.
	(ui_out_field_fmt_int): Likewise.
	(ui_out_field_skip): Likewise.
	(ui_out_field_string): Likewise.
	(ui_out_field_fmt): Likewise.
	* varobj.c (new_variable): Likewise.
	* x86-nat.c (x86_insert_watchpoint): Likewise.
	(x86_remove_watchpoint): Likewise.
	(x86_can_use_hw_breakpoint): Likewise.
	* xtensa-tdep.h (struct gdbarch_tdep): Likewise.
	* inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to
	previously anonymous enumeration type..
	* linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall
	value.
	* target-debug.h (target_debug_print_enum_target_hw_bp_type): New.
	(target_debug_print_enum_bptype): New.
	* target-delegates.c: Regenerate.
2015-07-31 13:19:53 -04:00
Omair Javaid 99afc88b39 Implements aarch64 process record and reverse debugging support
This patch adds the support of aarch64-linux process record and reverse
debugging.  The implementation is similar to ARM's counterpart.

2015-05-26  Omair Javaid  <omair.javaid@linaro.org>
	    Yao Qi  <yao.qi@linaro.org>

	* aarch64-linux-tdep.c: Include linux-record.h and
	record-full.h.
	(struct linux_record_tdep aarch64_linux_record_tdep): Declare.
	(aarch64_syscall): New enum.
	(aarch64_canonicalize_syscall): New function.
	(aarch64_all_but_pc_registers_record): New function.
	(aarch64_linux_syscall_record): New function.
	(aarch64_linux_init_abi): Install AArch64 process record
	handler.  Update to handle syscall recording.
	* aarch64-tdep.c: Include record.h and record-full.h.
	(submask, bit, bits, REG_ALLOC, MEM_ALLOC): New macros.
	(struct aarch64_mem_r): Define.
	(aarch64_record_result): New enum.
	(struct insn_decode_record): Define.
	(insn_decode_record): New typedef.
	(aarch64_record_data_proc_reg): New function.
	(aarch64_record_data_proc_imm): New function.
	(aarch64_record_branch_except_sys): New function.
	(aarch64_record_load_store): New function.
	(aarch64_record_data_proc_simd_fp): New function.
	(aarch64_record_asimd_load_store): New function.
	(aarch64_record_decode_insn_handler): New function.
	(deallocate_reg_mem): New function.
	(aarch64_process_record): New function.
	* aarch64-tdep.h (struct gdbarch_tdep) <aarch64_syscall_record>:
	New field.
	(aarch64_process_record): New extern declaration.
	* configure.tgt: Add linux-record.o to gdb_target_obs.
	* linux-record.h (struct linux_record_tdep) <arg7>: New field.
2015-05-26 12:42:07 +01:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
Two modifications:
  1. The addition of 2013 to the copyright year range for every file;
  2. The use of a single year range, instead of potentially multiple
     year ranges, as approved by the FSF.
2013-01-01 06:33:28 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Michael Snyder 13b6d1d459 2009-09-08 Michael Snyder <msnyder@vmware.com>
* amd64-linux-tdep.h (enum amd64_syscall): New enum consts,
	to replace literal consts used in amd64-linux-tdep.c
	* linux-record.h (enum gdb_syscall): New enum consts, to replace
	literal consts used in amd64-linux-tdep.c and linux-record.c.
	* amd64-linux-tdep.c (amd64_canonicalize_syscall): New function,
	translate from native amd64 Linux syscall id to internal gdb id.
	(amd64_linux_syscall_record): Switch statement abstracted out
	and replaced with a call to amd64_canonicalize_syscall.
	* linux-record.c (record_linux_system_call): Replace literal
	consts with enum consts.
	* i386-linux-tdep.c (i386_canonicalize_syscall): New function,
	trivially translate from native i386 Linux syscalls to gdb syscalls.
	(i386_linux_intx80_sysenter_record):
2009-09-08 22:50:59 +00:00
Hui Zhu 2c543fc432 2009-08-10 Hui Zhu <teawater@gmail.com>
Add process record Linux system call 64 bits support.

        * linux-record.h (linux_record_tdep): Add size_pointer,
        size_size_t, size_iovec and arg6.  Change the values of
	size_int, size_long and size_ulong to
	gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
	gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT,
	gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT.
	* i386-linux-tdep.c (i386_linux_init_abi): Ditto.
	(i386_linux_intx80_sysenter_record): Add a check for system
	call number.
        * linux-record.c (record_linux_system_call): Make this
        function support 64 bits.
2009-08-10 03:04:45 +00:00
Hui Zhu 5e31abdf71 * i386-linux-tdep.c (I386_LINUX_RECORD_SIZE_*,
I386_LINUX_RECORD_IOCTL_*,
	I386_LINUX_RECORD_FCNTL_*) Removed.
	(i386_linux_init_abi): Change size of record from macros to
	numbers.
	* i386-linux-tdep.c (i386_linux_init_abi): Remove size_char.
	* linux-record.c (record_linux_system_call): Ditto.
	* linux-record.h (linux_record_tdep): Ditto.
2009-05-24 04:42:51 +00:00
Hui Zhu 50ef67b36b Add sys_fcntl argument interfaces to linux_record_tdep.
* linux-record.h (linux_record_tdep): Add fcntl_F_GETLK,
	fcntl_F_GETLK64, fcntl_F_SETLK64 and fcntl_F_SETLKW64 to be
	interfaces.
	* i386-linux-tdep.c (I386_LINUX_RECORD_FCNTL_F_GETLK,
	I386_LINUX_RECORD_FCNTL_F_GETLK64,
	I386_LINUX_RECORD_FCNTL_F_SETLK64,
	I386_LINUX_RECORD_FCNTL_F_SETLKW64): New macros. The values
	of I386 Linux sys_fcntl arguments.
	(i386_linux_init_abi): Set macros values to linux_record_tdep.
	* linux-record.c (record_linux_system_call): Change to use
	the interface in linux_record_tdep in sys_fcntl and
	sys_fcntl64.

	* linux-record.c (record_linux_system_call): Fix the process
	record build error about type in CYGWIN.
2009-05-22 14:07:27 +00:00
Hui Zhu b7f6bf2299 Linux process record and replay support.
* Makefile.in (ALLDEPFILES): Add linux-record.c.
(ALL_TARGET_OBS): Add linux-record.o.
* configure.tgt (x86_64-*-linux*): Add linux-record.o.
(i[34567]86-*-linux*): Add linux-record.o.
* linux-record.c, linux-record.h: New file.
2009-04-30 03:04:28 +00:00