summaryrefslogtreecommitdiff
path: root/gdb/i386-linux-tdep.c
AgeCommit message (Collapse)Author
2018-01-02Update copyright year range in all GDB filesJoel Brobecker
gdb/ChangeLog: Update copyright year range in all GDB files
2017-10-25s/get_regcache_arch (regcache)/regcache->arch ()/gYao Qi
This patches removes get_regcache_arch, and use regache->arch () instead. The motivation of this change is that I am going to move some basic stuff into a base class of regcache. I don't need to update "client" code regcache->arch (). On the other hand, this patch shortens the code a little bit. gdb: 2017-10-25 Yao Qi <yao.qi@linaro.org> * aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use regcache->arch () instead get_regcache_arch. * aarch64-fbsd-nat.c (aarch64_fbsd_fetch_inferior_registers): Likewise. (aarch64_fbsd_store_inferior_registers): Likewise. * aarch64-linux-nat.c (fetch_gregs_from_thread): Likewise. (store_gregs_to_thread): Likewise. (fetch_fpregs_from_thread): Likewise. (store_fpregs_to_thread): Likewise. * aarch64-tdep.c (aarch64_extract_return_value): Likewise. (aarch64_store_return_value): Likewise. (aarch64_software_single_step): Likewise. * aix-thread.c (aix_thread_wait): Likewise. (supply_reg32): Likewise. (supply_sprs64): Likewise. (supply_sprs32): Likewise. (fill_gprs64): Likewise. (fill_gprs32): Likewise. (fill_sprs64): Likewise. (fill_sprs32): Likewise. (store_regs_user_thread): Likewise. (store_regs_kernel_thread): Likewise. * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers): Likewise. (alphabsd_store_inferior_registers): Likewise. * alpha-tdep.c (alpha_extract_return_value): Likewise. (alpha_store_return_value): Likewise. (alpha_deal_with_atomic_sequence): Likewise. (alpha_next_pc): Likewise. (alpha_software_single_step): Likewise. * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise. (amd64bsd_store_inferior_registers): Likewise. * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers): Likewise. (amd64_linux_store_inferior_registers): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-obsd-tdep.c (amd64obsd_supply_uthread): Likewise. (amd64obsd_collect_uthread): Likewise. * amd64-tdep.c (amd64_supply_fpregset): Likewise. (amd64_collect_fpregset): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * arc-tdep.c (arc_write_pc): Likewise. * arch-utils.c (default_skip_permanent_breakpoint): Likewise. * arm-fbsd-nat.c (arm_fbsd_fetch_inferior_registers): Likewise. (arm_fbsd_store_inferior_registers): Likewise. * arm-linux-nat.c (fetch_vfp_regs): Likewise. (store_vfp_regs): Likewise. (arm_linux_fetch_inferior_registers): Likewise. (arm_linux_store_inferior_registers): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_sigreturn_next_pc): Likewise. (arm_linux_get_next_pcs_syscall_next_pc): Likewise. * arm-nbsd-nat.c (arm_supply_gregset): Likewise. (fetch_register): Likewise. (store_register): Likewise. * arm-tdep.c (arm_is_thumb): Likewise. (displaced_in_arm_mode): Likewise. (bx_write_pc): Likewise. (arm_get_next_pcs_addr_bits_remove): Likewise. (arm_software_single_step): Likewise. (arm_extract_return_value): Likewise. (arm_store_return_value): Likewise. (arm_write_pc): Likewise. * bfin-tdep.c (bfin_extract_return_value): Likewise. * bsd-uthread.c (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * core-regset.c (fetch_core_registers): Likewise. * corelow.c (get_core_registers): Likewise. * cris-tdep.c (cris_store_return_value): Likewise. (cris_extract_return_value): Likewise. (find_step_target): Likewise. (find_step_target): Likewise. (cris_software_single_step): Likewise. * ctf.c (ctf_fetch_registers): Likewise. * darwin-nat.c (cancel_breakpoint): Likewise. * fbsd-tdep.c (fbsd_collect_thread_registers): Likewise. * frv-tdep.c (frv_extract_return_value): Likewise. * ft32-tdep.c (ft32_store_return_value): Likewise. (ft32_extract_return_value): Likewise. * go32-nat.c (fetch_register): Likewise. (go32_fetch_registers): Likewise. (go32_store_registers): Likewise. (store_register): Likewise. * h8300-tdep.c (h8300_extract_return_value): Likewise. (h8300_store_return_value): Likewise. * hppa-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (hppa_linux_fetch_inferior_registers): Likewise. (hppa_linux_store_inferior_registers): Likewise. * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers): Likewise. (i386_darwin_store_inferior_registers): Likewise. * i386-gnu-nat.c (gnu_fetch_registers): Likewise. (gnu_store_registers): Likewise. * i386-linux-nat.c (fetch_register): Likewise. (store_register): Likewise. (supply_gregset): Likewise. (fill_gregset): Likewise. (i386_linux_fetch_inferior_registers): Likewise. (i386_linux_store_inferior_registers): Likewise. (i386_linux_resume): Likewise. * i386-linux-tdep.c (i386_linux_get_syscall_number_from_regcache): Likewise. * i386-nto-tdep.c (i386nto_supply_gregset): Likewise. * i386-obsd-nat.c (i386obsd_supply_pcb): Likewise. * i386-obsd-tdep.c (i386obsd_supply_uthread): Likewise. (i386obsd_collect_uthread): Likewise. * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. (i386_mpx_bd_base): Likewise. * i386-v4-nat.c (supply_fpregset): Likewise. (fill_fpregset): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-linux-nat.c (ia64_linux_fetch_registers): Likewise. (ia64_linux_store_registers): Likewise. * ia64-tdep.c (ia64_access_rse_reg): Likewise. (ia64_extract_return_value): Likewise. (ia64_store_return_value): Likewise. (find_func_descr): Likewise. * inf-child.c (inf_child_fetch_inferior_registers): Likewise. * inf-ptrace.c (inf_ptrace_fetch_registers): Likewise. (inf_ptrace_store_registers): Likewise. * infrun.c (use_displaced_stepping): Likewise. (displaced_step_prepare_throw): Likewise. (resume): Likewise. (proceed): Likewise. (do_target_wait): Likewise. (adjust_pc_after_break): Likewise. (handle_inferior_event_1): Likewise. (handle_signal_stop): Likewise. (save_infcall_suspend_state): Likewise. (restore_infcall_suspend_state): Likewise. * iq2000-tdep.c (iq2000_extract_return_value): Likewise. * jit.c (jit_frame_prev_register): Likewise. * linux-nat.c (save_stop_reason): Likewise. (linux_nat_wait_1): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (record_linux_system_call): Likewise. * linux-tdep.c (linux_collect_thread_registers): Likewise. * lm32-tdep.c (lm32_extract_return_value): Likewise. (lm32_store_return_value): Likewise. * m32c-tdep.c (m32c_read_flg): Likewise. (m32c_pseudo_register_read): Likewise. (m32c_pseudo_register_write): Likewise. * m32r-linux-tdep.c (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_store_return_value): Likewise. (m32r_extract_return_value): Likewise. * m68k-bsd-nat.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_collect_fpregset): Likewise. * m68k-bsd-tdep.c (m68kbsd_supply_fpregset): Likewise. * m68k-linux-nat.c (fetch_register): Likewise. (old_fetch_inferior_registers): Likewise. (old_store_inferior_registers): Likewise. (store_regs): Likewise. * m68k-tdep.c (m68k_svr4_extract_return_value): Likewise. (m68k_svr4_store_return_value): Likewise. * m88k-tdep.c (m88k_store_arguments): Likewise. * mi/mi-main.c (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_write_register_values): Likewise. * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers): Likewise. (mips_fbsd_store_inferior_registers): Likewise. * mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Likewise. (mips_fbsd_supply_gregs): Likewise. (mips_fbsd_collect_fpregs): Likewise. (mips_fbsd_collect_gregs): Likewise. (mips_fbsd_supply_fpregset): Likewise. (mips_fbsd_collect_fpregset): Likewise. (mips_fbsd_supply_gregset): Likewise. (mips_fbsd_collect_gregset): Likewise. * mips-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (supply_fpregset): Likewise. (fill_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset): Likewise. (mips_fill_gregset): Likewise. (mips_supply_fpregset): Likewise. (mips_fill_fpregset): Likewise. (mips64_supply_gregset): Likewise. (micromips_linux_sigframe_validate): Likewise. * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_fetch_inferior_registers): Likewise. (mipsnbsd_store_inferior_registers): Likewise. * mips-nbsd-tdep.c (mipsnbsd_supply_fpregset): Likewise. (mipsnbsd_supply_gregset): Likewise. (mipsnbsd_iterate_over_regset_sections): Likewise. (mipsnbsd_supply_reg): Likewise. (mipsnbsd_supply_fpreg): Likewise. * mips-tdep.c (mips_in_frame_stub): Likewise. (mips_dummy_id): Likewise. (is_octeon_bbit_op): Likewise. (micromips_bc1_pc): Likewise. (extended_mips16_next_pc): Likewise. (mips16_next_pc): Likewise. (deal_with_atomic_sequence): Likewise. * moxie-tdep.c (moxie_process_readu): Likewise. * nios2-tdep.c (nios2_get_next_pc): Likewise. * nto-procfs.c (procfs_store_registers): Likewise. * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers): Likewise. (ppcfbsd_store_inferior_registers): Likewise. * ppc-linux-nat.c (fetch_vsx_register): Likewise. (fetch_altivec_register): Likewise. (get_spe_registers): Likewise. (fetch_spe_register): Likewise. (fetch_altivec_registers): Likewise. (fetch_all_gp_regs): Likewise. (fetch_all_fp_regs): Likewise. (store_vsx_register): Likewise. (store_altivec_register): Likewise. (set_spe_registers): Likewise. (store_spe_register): Likewise. (store_altivec_registers): Likewise. (store_all_gp_regs): Likewise. (store_all_fp_regs): Likewise. * ppc-linux-tdep.c (ppc_linux_supply_gregset): Likewise. (ppc_linux_collect_gregset): Likewise. (ppc_canonicalize_syscall): Likewise. (ppc_linux_record_signal): Likewise. (ppu2spu_prev_register): Likewise. * ppc-nbsd-nat.c (ppcnbsd_supply_pcb): Likewise. * ppc-obsd-nat.c (ppcobsd_fetch_registers): Likewise. (ppcobsd_store_registers): Likewise. * ppc-ravenscar-thread.c (ppc_ravenscar_generic_fetch_registers): Likewise. (ppc_ravenscar_generic_store_registers): Likewise. * procfs.c (procfs_fetch_registers): Likewise. (procfs_store_registers): Likewise. * ravenscar-thread.c (ravenscar_fetch_registers): Likewise. (ravenscar_store_registers): Likewise. (ravenscar_prepare_to_store): Likewise. * record-btrace.c (record_btrace_fetch_registers): Likewise. * record-full.c (record_full_wait_1): Likewise. (record_full_registers_change): Likewise. (record_full_store_registers): Likewise. (record_full_core_fetch_registers): Likewise. (record_full_save): Likewise. (record_full_goto_insn): Likewise. * regcache.c (regcache_register_size): Likewise. (get_regcache_arch): Remove. (regcache_read_pc): Likewise. * regcache.h (get_regcache_arch): Remove. * remote-sim.c (gdbsim_fetch_register): Likewise. (gdbsim_store_register): Likewise. * remote.c (fetch_register_using_p): Likewise. (send_g_packet): Likewise. (remote_prepare_to_store): Likewise. (store_registers_using_G): Likewise. * reverse.c (save_bookmark_command): Likewise. (goto_bookmark_command): Likewise. * rs6000-aix-tdep.c (branch_dest): Likewise. * rs6000-nat.c (rs6000_ptrace64): Likewise. (fetch_register): Likewise. * rs6000-tdep.c (ppc_supply_reg): Likewise. (ppc_collect_reg): Likewise. (ppc_collect_gregset): Likewise. (ppc_collect_fpregset): Likewise. (ppc_collect_vsxregset): Likewise. (ppc_collect_vrregset): Likewise. (ppc_displaced_step_hw_singlestep): Likewise. (rs6000_pseudo_register_read): Likewise. (rs6000_pseudo_register_write): Likewise. * s390-linux-nat.c (supply_gregset): Likewise. (fill_gregset): Likewise. (s390_linux_fetch_inferior_registers): Likewise. * s390-linux-tdep.c (s390_write_pc): Likewise. (s390_software_single_step): Likewise. (s390_all_but_pc_registers_record): Likewise. (s390_linux_syscall_record): Likewise. * sentinel-frame.c (sentinel_frame_prev_arch): Likewise. * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise. (shnbsd_store_inferior_registers): Likewise. * sh-tdep.c (sh_extract_return_value_nofpu): Likewise. (sh_extract_return_value_fpu): Likewise. (sh_store_return_value_nofpu): Likewise. (sh_corefile_supply_regset): Likewise. (sh_corefile_collect_regset): Likewise. * sh64-tdep.c (sh64_extract_return_value): Likewise. (sh64_store_return_value): Likewise. * sparc-linux-tdep.c (sparc32_linux_collect_core_fpregset): Likewise. * sparc-nat.c (sparc_fetch_inferior_registers): Likewise. (sparc_store_inferior_registers): Likewise. * sparc-ravenscar-thread.c (register_in_thread_descriptor_p): Likewise. (sparc_ravenscar_prepare_to_store): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. (sparc_analyze_control_transfer): Likewise. (sparc_step_trap): Likewise. (sparc_software_single_step): Likewise. (sparc32_gdbarch_init): Likewise. (sparc_supply_rwindow): Likewise. (sparc_collect_rwindow): Likewise. * sparc64-linux-tdep.c (sparc64_linux_collect_core_fpregset): Likewise. * sparc64-nbsd-nat.c (sparc64nbsd_supply_gregset): Likewise. (sparc64nbsd_collect_gregset): Likewise. (sparc64nbsd_supply_fpregset): Likewise. (sparc64nbsd_collect_fpregset): Likewise. * sparc64-tdep.c (sparc64_store_arguments): Likewise. (sparc64_supply_gregset): Likewise. (sparc64_collect_gregset): Likewise. (sparc64_supply_fpregset): Likewise. (sparc64_collect_fpregset): Likewise. * spu-linux-nat.c (spu_fetch_inferior_registers): Likewise. * spu-tdep.c (spu_unwind_sp): Likewise. (spu2ppu_prev_register): Likewise. (spu_memory_remove_breakpoint): Likewise. * stack.c (return_command): Likewise. * tic6x-tdep.c (tic6x_extract_signed_field): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (trace_save_ctf): Likewise. * windows-nat.c (do_windows_fetch_inferior_registers): Likewise. (do_windows_store_inferior_registers): Likewise. (windows_resume): Likewise. * xtensa-linux-nat.c (fill_gregset): Likewise. (supply_gregset_reg): Likewise. * xtensa-tdep.c (xtensa_register_write_masked): Likewise. (xtensa_register_read_masked): Likewise. (xtensa_supply_gregset): Likewise. (xtensa_extract_return_value): Likewise. (xtensa_store_return_value): Likewise.
2017-10-21Create a displaced_step_closure class hierarchySimon Marchi
displaced_step_closure is a type defined in multiple -tdep.c files. Trying to xfree it from the common code (infrun.c) is a problem when we try to poison xfree for non-POD types. Because there can be multiple of these types in the same build, this patch makes a hierarchy of classes with a virtual destructor. When the common code deletes the object through a displaced_step_closure pointer, it will invoke the right destructor. The amd64 used a last-member array with a variable size. That doesn't work with new, so I changed it for an std::vector. Other architectures which used a simple byte buffer as a closure now use a shared buf_displaced_step_closure, a closure type that only contains a gdb::byte_vector. Reg-tested on the buildbot. gdb/ChangeLog: * infrun.h: Include common/byte-vector.h. (struct displaced_step_closure): New struct. (struct buf_displaced_step_closure): New struct. * infrun.c (displaced_step_closure::~displaced_step_closure): Provide default implementation. (displaced_step_clear): Deallocate step closure with delete. * aarch64-tdep.c (displaced_step_closure): Rename to ... (aarch64_displaced_step_closure): ... this, extend displaced_step_closure. (aarch64_displaced_step_data) <dsc>: Change type to aarch64_displaced_step_closure. (aarch64_displaced_step_copy_insn): Adjust to type change, use unique_ptr. (aarch64_displaced_step_fixup): Add cast for displaced step closure. * amd64-tdep.c (displaced_step_closure): Rename to ... (amd64_displaced_step_closure): ... this, extend displaced_step_closure. <insn_buf>: Change type to std::vector<gdb_byte>. <max_len>: Remove. (fixup_riprel): Change type of DSC parameter, adjust to type change of insn_buf. (fixup_displaced_copy): Change type of DSC parameter. (amd64_displaced_step_copy_insn): Instantiate amd64_displaced_step_closure. (amd64_displaced_step_fixup): Add cast for closure type, adjust to type change of insn_buf. * arm-linux-tdep.c (arm_linux_cleanup_svc): Change type of parameter DSC. (arm_linux_copy_svc): Likewise. (cleanup_kernel_helper_return): Likewise. (arm_catch_kernel_helper_return): Likewise. (arm_linux_displaced_step_copy_insn): Instantiate arm_displaced_step_closure. * arm-tdep.c (arm_pc_is_thumb): Add cast for closure. (displaced_read_reg): Change type of parameter DSC. (branch_write_pc): Likewise. (load_write_pc): Likewise. (alu_write_pc): Likewise. (displaced_write_reg): Likewise. (arm_copy_unmodified): Likewise. (thumb_copy_unmodified_32bit): Likewise. (thumb_copy_unmodified_16bit): Likewise. (cleanup_preload): Likewise. (install_preload): Likewise. (arm_copy_preload): Likewise. (thumb2_copy_preload): Likewise. (install_preload_reg): Likewise. (arm_copy_preload_reg): Likewise. (cleanup_copro_load_store): Likewise. (install_copro_load_store): Likewise. (arm_copy_copro_load_store) Likewise. (thumb2_copy_copro_load_store): Likewise. (cleanup_branch): Likewise. (install_b_bl_blx): Likewise. (arm_copy_b_bl_blx): Likewise. (thumb2_copy_b_bl_blx): Likewise. (thumb_copy_b): Likewise. (install_bx_blx_reg): Likewise. (arm_copy_bx_blx_reg): Likewise. (thumb_copy_bx_blx_reg): Likewise. (cleanup_alu_imm): Likewise. (arm_copy_alu_imm): Likewise. (thumb2_copy_alu_imm): Likewise. (cleanup_alu_reg): Likewise. (install_alu_reg): Likewise. (arm_copy_alu_reg): Likewise. (thumb_copy_alu_reg): Likewise. (cleanup_alu_shifted_reg): Likewise. (install_alu_shifted_reg): Likewise. (arm_copy_alu_shifted_reg): Likewise. (cleanup_load): Likewise. (cleanup_store): Likewise. (arm_copy_extra_ld_st): Likewise. (install_load_store): Likewise. (thumb2_copy_load_literal): Likewise. (thumb2_copy_load_reg_imm): Likewise. (arm_copy_ldr_str_ldrb_strb): Likewise. (cleanup_block_load_all): Likewise. (cleanup_block_store_pc): Likewise. (cleanup_block_load_pc): Likewise. (arm_copy_block_xfer): Likewise. (thumb2_copy_block_xfer): Likewise. (cleanup_svc): Likewise. (install_svc): Likewise. (arm_copy_svc): Likewise. (thumb_copy_svc): Likewise. (arm_copy_undef): Likewise. (thumb_32bit_copy_undef): Likewise. (arm_copy_unpred): Likewise. (arm_decode_misc_memhint_neon): Likewise. (arm_decode_unconditional): Likewise. (arm_decode_miscellaneous): Likewise. (arm_decode_dp_misc): Likewise. (arm_decode_ld_st_word_ubyte): Likewise. (arm_decode_media): Likewise. (arm_decode_b_bl_ldmstm): Likewise. (arm_decode_ext_reg_ld_st): Likewise. (thumb2_decode_dp_shift_reg): Likewise. (thumb2_decode_ext_reg_ld_st): Likewise. (arm_decode_svc_copro): Likewise. (thumb2_decode_svc_copro): Likewise. (install_pc_relative): Likewise. (thumb_copy_pc_relative_16bit): Likewise. (thumb_decode_pc_relative_16bit): Likewise. (thumb_copy_pc_relative_32bit): Likewise. (thumb_copy_16bit_ldr_literal): Likewise. (thumb_copy_cbnz_cbz): Likewise. (thumb2_copy_table_branch): Likewise. (cleanup_pop_pc_16bit_all): Likewise. (thumb_copy_pop_pc_16bit): Likewise. (thumb_process_displaced_16bit_insn): Likewise. (decode_thumb_32bit_ld_mem_hints): Likewise. (thumb_process_displaced_32bit_insn): Likewise. (thumb_process_displaced_insn): Likewise. (arm_process_displaced_insn): Likewise. (arm_displaced_init_closure): Likewise. (arm_displaced_step_fixup): Add cast for closure. * arm-tdep.h: Include infrun.h. (displaced_step_closure): Rename to ... (arm_displaced_step_closure): ... this, extend displaced_step_closure. <u::svc::copy_svc_os>: Change type of parameter DSC. <cleanup>: Likewise. (arm_process_displaced_insn): Likewise. (arm_displaced_init_closure): Likewise. (displaced_read_reg): Likewise. (displaced_write_reg): Likewise. * i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): Adjust. * i386-tdep.h: Include infrun.h. (i386_displaced_step_closure): New typedef. * i386-tdep.c (i386_displaced_step_copy_insn): Use i386_displaced_step_closure. (i386_displaced_step_fixup): Adjust. * rs6000-tdep.c (ppc_displaced_step_closure): New typedef. (ppc_displaced_step_copy_insn): Use ppc_displaced_step_closure and unique_ptr. (ppc_displaced_step_fixup): Adjust. * s390-linux-tdep.c (s390_displaced_step_closure): New typedef. (s390_displaced_step_copy_insn): Use s390_displaced_step_closure and unique_ptr. (s390_displaced_step_fixup): Adjust.
2017-10-12Remove simple_displaced_step_copy_insnSimon Marchi
Nothing uses this function. Remove it, and adjust comments referring to it. gdb/ChangeLog: * arch-utils.h (simple_displaced_step_copy_insn): Remove. * arch-utils.c (simple_displaced_step_copy_insn): Remove. * gdbarch.sh (displaced_step_copy_insn): Adjust comment. * gdbarch.h: Regenerate. * i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): Adjust comment. * i386-tdep.c (i386_displaced_step_copy_insn): Adjust comment. (i386_displaced_step_fixup): Adjust comment. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Adjust comment.
2017-09-09Remove unnecessary function prototypes.John Baldwin
These prototypes were required when compiling GDB as C but are not required for C++. gdb/ChangeLog: * aarch64-linux-nat.c: Remove _initialize_aarch64_linux_nat prototype. * aarch64-linux-tdep.c: Remove _initialize_aarch64_linux_tdep prototype. * aarch64-newlib-tdep.c: Remove _initialize_aarch64_newlib_tdep prototype. * aarch64-tdep.c: Remove _initialize_aarch64_tdep prototype. * ada-exp.y: Remove _initialize_ada_exp prototype. * ada-lang.c: Remove _initialize_ada_language prototype. * ada-tasks.c: Remove _initialize_tasks prototype. * addrmap.c: Remove _initialize_addrmap prototype. * agent.c: Remove _initialize_agent prototype. * aix-thread.c: Remove _initialize_aix_thread prototype. * alpha-bsd-nat.c: Remove _initialize_alphabsd_nat prototype. * alpha-linux-nat.c: Remove _initialize_alpha_linux_nat prototype. * alpha-linux-tdep.c: Remove _initialize_alpha_linux_tdep prototype. * alpha-nbsd-tdep.c: Remove _initialize_alphanbsd_tdep prototype. * alpha-obsd-tdep.c: Remove _initialize_alphaobsd_tdep prototype. * alpha-tdep.c: Remove _initialize_alpha_tdep prototype. * amd64-darwin-tdep.c: Remove _initialize_amd64_darwin_tdep prototype. * amd64-dicos-tdep.c: Remove _initialize_amd64_dicos_tdep prototype. * amd64-fbsd-nat.c: Remove _initialize_amd64fbsd_nat prototype. * amd64-fbsd-tdep.c: Remove _initialize_amd64fbsd_tdep prototype. * amd64-linux-nat.c: Remove _initialize_amd64_linux_nat prototype. * amd64-linux-tdep.c: Remove _initialize_amd64_linux_tdep prototype. * amd64-nbsd-nat.c: Remove _initialize_amd64nbsd_nat prototype. * amd64-nbsd-tdep.c: Remove _initialize_amd64nbsd_tdep prototype. * amd64-obsd-nat.c: Remove _initialize_amd64obsd_nat prototype. * amd64-obsd-tdep.c: Remove _initialize_amd64obsd_tdep prototype. * amd64-sol2-tdep.c: Remove _initialize_amd64_sol2_tdep prototype. * amd64-tdep.c: Remove _initialize_amd64_tdep prototype. * amd64-windows-nat.c: Remove _initialize_amd64_windows_nat prototype. * amd64-windows-tdep.c: Remove _initialize_amd64_windows_tdep prototype. * annotate.c: Remove _initialize_annotate prototype. * arc-newlib-tdep.c: Remove _initialize_arc_newlib_tdep prototype. * arc-tdep.c: Remove _initialize_arc_tdep prototype. * arch-utils.c: Remove _initialize_gdbarch_utils prototype. * arm-linux-nat.c: Remove _initialize_arm_linux_nat prototype. * arm-linux-tdep.c: Remove _initialize_arm_linux_tdep prototype. * arm-nbsd-tdep.c: Remove _initialize_arm_netbsd_tdep prototype. * arm-obsd-tdep.c: Remove _initialize_armobsd_tdep prototype. * arm-symbian-tdep.c: Remove _initialize_arm_symbian_tdep prototype. * arm-tdep.c: Remove _initialize_arm_tdep prototype. * arm-wince-tdep.c: Remove _initialize_arm_wince_tdep prototype. * auto-load.c: Remove _initialize_auto_load prototype. * auxv.c: Remove _initialize_auxv prototype. * avr-tdep.c: Remove _initialize_avr_tdep prototype. * ax-gdb.c: Remove _initialize_ax_gdb prototype. * bfin-linux-tdep.c: Remove _initialize_bfin_linux_tdep prototype. * bfin-tdep.c: Remove _initialize_bfin_tdep prototype. * break-catch-sig.c: Remove _initialize_break_catch_sig prototype. * break-catch-syscall.c: Remove _initialize_break_catch_syscall prototype. * break-catch-throw.c: Remove _initialize_break_catch_throw prototype. * breakpoint.c: Remove _initialize_breakpoint prototype. * bsd-uthread.c: Remove _initialize_bsd_uthread prototype. * btrace.c: Remove _initialize_btrace prototype. * charset.c: Remove _initialize_charset prototype. * cli/cli-cmds.c: Remove _initialize_cli_cmds prototype. * cli/cli-dump.c: Remove _initialize_cli_dump prototype. * cli/cli-interp.c: Remove _initialize_cli_interp prototype. * cli/cli-logging.c: Remove _initialize_cli_logging prototype. * cli/cli-script.c: Remove _initialize_cli_script prototype. * coff-pe-read.c: Remove _initialize_coff_pe_read prototype. * coffread.c: Remove _initialize_coffread prototype. * compile/compile.c: Remove _initialize_compile prototype. * complaints.c: Remove _initialize_complaints prototype. * completer.c: Remove _initialize_completer prototype. * copying.awk: Remove _initialize_copying prototype. * copying.c: Regenerate. * core-regset.c: Remove _initialize_core_regset prototype. * corefile.c: Remove _initialize_core prototype. * corelow.c: Remove _initialize_corelow prototype. * cp-abi.c: Remove _initialize_cp_abi prototype. * cp-namespace.c: Remove _initialize_cp_namespace prototype. * cp-support.c: Remove _initialize_cp_support prototype. * cp-valprint.c: Remove _initialize_cp_valprint prototype. * cris-linux-tdep.c: Remove _initialize_cris_linux_tdep prototype. * cris-tdep.c: Remove _initialize_cris_tdep prototype. * ctf.c: Remove _initialize_ctf prototype. * d-lang.c: Remove _initialize_d_language prototype. * darwin-nat-info.c: Remove _initialize_darwin_info_commands prototype. * darwin-nat.c: Remove _initialize_darwin_inferior prototype. * dbxread.c: Remove _initialize_dbxread prototype. * dcache.c: Remove _initialize_dcache prototype. * demangle.c: Remove _initialize_demangler prototype. * disasm-selftests.c: Remove _initialize_disasm_selftests prototype. * disasm.c: Remove _initialize_disasm prototype. * dtrace-probe.c: Remove _initialize_dtrace_probe prototype. * dummy-frame.c: Remove _initialize_dummy_frame prototype. * dwarf2-frame-tailcall.c: Remove _initialize_tailcall_frame prototype. * dwarf2-frame.c: Remove _initialize_dwarf2_frame prototype. * dwarf2expr.c: Remove _initialize_dwarf2expr prototype. * dwarf2loc.c: Remove _initialize_dwarf2loc prototype. * dwarf2read.c: Remove _initialize_dwarf2_read prototype. * elfread.c: Remove _initialize_elfread prototype. * exec.c: Remove _initialize_exec prototype. * extension.c: Remove _initialize_extension prototype. * f-lang.c: Remove _initialize_f_language prototype. * f-valprint.c: Remove _initialize_f_valprint prototype. * fbsd-nat.c: Remove _initialize_fbsd_nat prototype. * fbsd-tdep.c: Remove _initialize_fbsd_tdep prototype. * filesystem.c: Remove _initialize_filesystem prototype. * findcmd.c: Remove _initialize_mem_search prototype. * fork-child.c: Remove _initialize_fork_child prototype. * frame-base.c: Remove _initialize_frame_base prototype. * frame-unwind.c: Remove _initialize_frame_unwind prototype. * frame.c: Remove _initialize_frame prototype. * frv-linux-tdep.c: Remove _initialize_frv_linux_tdep prototype. * frv-tdep.c: Remove _initialize_frv_tdep prototype. * ft32-tdep.c: Remove _initialize_ft32_tdep prototype. * gcore.c: Remove _initialize_gcore prototype. * gdb_bfd.c: Remove _initialize_gdb_bfd prototype. * gdbarch.c: Regenerate. * gdbarch.sh: Remove _initialize_gdbarch prototype. * gdbtypes.c: Remove _initialize_gdbtypes prototype. * gnu-nat.c: Remove _initialize_gnu_nat prototype. * gnu-v2-abi.c: Remove _initialize_gnu_v2_abi prototype. * gnu-v3-abi.c: Remove _initialize_gnu_v3_abi prototype. * go-lang.c: Remove _initialize_go_language prototype. * go32-nat.c: Remove _initialize_go32_nat prototype. * guile/guile.c: Remove _initialize_guile prototype. * h8300-tdep.c: Remove _initialize_h8300_tdep prototype. * hppa-linux-nat.c: Remove _initialize_hppa_linux_nat prototype. * hppa-linux-tdep.c: Remove _initialize_hppa_linux_tdep prototype. * hppa-nbsd-nat.c: Remove _initialize_hppanbsd_nat prototype. * hppa-nbsd-tdep.c: Remove _initialize_hppanbsd_tdep prototype. * hppa-obsd-nat.c: Remove _initialize_hppaobsd_nat prototype. * hppa-obsd-tdep.c: Remove _initialize_hppaobsd_tdep prototype. * hppa-tdep.c: Remove _initialize_hppa_tdep prototype. * i386-bsd-nat.c: Remove _initialize_i386bsd_nat prototype. * i386-cygwin-tdep.c: Remove _initialize_i386_cygwin_tdep prototype. * i386-darwin-tdep.c: Remove _initialize_i386_darwin_tdep prototype. * i386-dicos-tdep.c: Remove _initialize_i386_dicos_tdep prototype. * i386-fbsd-nat.c: Remove _initialize_i386fbsd_nat prototype. * i386-fbsd-tdep.c: Remove _initialize_i386fbsd_tdep prototype. * i386-gnu-nat.c: Remove _initialize_i386gnu_nat prototype. * i386-gnu-tdep.c: Remove _initialize_i386gnu_tdep prototype. * i386-linux-nat.c: Remove _initialize_i386_linux_nat prototype. * i386-linux-tdep.c: Remove _initialize_i386_linux_tdep prototype. * i386-nbsd-nat.c: Remove _initialize_i386nbsd_nat prototype. * i386-nbsd-tdep.c: Remove _initialize_i386nbsd_tdep prototype. * i386-nto-tdep.c: Remove _initialize_i386nto_tdep prototype. * i386-obsd-nat.c: Remove _initialize_i386obsd_nat prototype. * i386-obsd-tdep.c: Remove _initialize_i386obsd_tdep prototype. * i386-sol2-nat.c: Remove _initialize_amd64_sol2_nat prototype. * i386-sol2-tdep.c: Remove _initialize_amd64_sol2_tdep prototype. * i386-tdep.c: Remove _initialize_i386_tdep prototype. * i386-windows-nat.c: Remove _initialize_i386_windows_nat prototype. * ia64-libunwind-tdep.c: Remove _initialize_libunwind_frame prototype. * ia64-linux-nat.c: Remove _initialize_ia64_linux_nat prototype. * ia64-linux-tdep.c: Remove _initialize_ia64_linux_tdep prototype. * ia64-tdep.c: Remove _initialize_ia64_tdep prototype. * ia64-vms-tdep.c: Remove _initialize_ia64_vms_tdep prototype. * infcall.c: Remove _initialize_infcall prototype. * infcmd.c: Remove _initialize_infcmd prototype. * inferior.c: Remove _initialize_inferiors prototype. * inflow.c: Remove _initialize_inflow prototype. * infrun.c: Remove _initialize_infrun prototype. * interps.c: Remove _initialize_interpreter prototype. * iq2000-tdep.c: Remove _initialize_iq2000_tdep prototype. * jit.c: Remove _initialize_jit prototype. * language.c: Remove _initialize_language prototype. * linux-fork.c: Remove _initialize_linux_fork prototype. * linux-nat.c: Remove _initialize_linux_nat prototype. * linux-tdep.c: Remove _initialize_linux_tdep prototype. * linux-thread-db.c: Remove _initialize_thread_db prototype. * lm32-tdep.c: Remove _initialize_lm32_tdep prototype. * m2-lang.c: Remove _initialize_m2_language prototype. * m32c-tdep.c: Remove _initialize_m32c_tdep prototype. * m32r-linux-nat.c: Remove _initialize_m32r_linux_nat prototype. * m32r-linux-tdep.c: Remove _initialize_m32r_linux_tdep prototype. * m32r-tdep.c: Remove _initialize_m32r_tdep prototype. * m68hc11-tdep.c: Remove _initialize_m68hc11_tdep prototype. * m68k-bsd-nat.c: Remove _initialize_m68kbsd_nat prototype. * m68k-bsd-tdep.c: Remove _initialize_m68kbsd_tdep prototype. * m68k-linux-nat.c: Remove _initialize_m68k_linux_tdep prototype. * m68k-linux-tdep.c: Remove _initialize_m68k_linux_tdep prototype. * m68k-tdep.c: Remove _initialize_m68k_tdep prototype. * m88k-bsd-nat.c: Remove _initialize_m68kbsd_nat prototype. * m88k-tdep.c: Remove _initialize_m68kbsd_tdep prototype. * machoread.c: Remove _initialize_machoread prototype. * macrocmd.c: Remove _initialize_macrocmd prototype. * macroscope.c: Remove _initialize_macroscope prototype. * maint.c: Remove _initialize_maint_cmds prototype. * mdebugread.c: Remove _initialize_mdebugread prototype. * memattr.c: Remove _initialize_mem prototype. * mep-tdep.c: Remove _initialize_mep_tdep prototype. * mi/mi-cmd-env.c: Remove _initialize_mi_cmd_env prototype. * mi/mi-cmds.c: Remove _initialize_mi_cmds prototype. * mi/mi-interp.c: Remove _initialize_mi_interp prototype. * mi/mi-main.c: Remove _initialize_mi_main prototype. * microblaze-linux-tdep.c: Remove _initialize_microblaze_linux_tdep prototype. * microblaze-tdep.c: Remove _initialize_microblaze_tdep prototype. * mips-fbsd-nat.c: Remove _initialize_mips_fbsd_nat prototype. * mips-fbsd-tdep.c: Remove _initialize_mips_fbsd_tdep prototype. * mips-linux-nat.c: Remove _initialize_mips_linux_nat prototype. * mips-linux-tdep.c: Remove _initialize_mips_linux_tdep prototype. * mips-nbsd-nat.c: Remove _initialize_mipsnbsd_nat prototype. * mips-nbsd-tdep.c: Remove _initialize_mipsnbsd_tdep prototype. * mips-sde-tdep.c: Remove _initialize_mips_sde_tdep prototype. * mips-tdep.c: Remove _initialize_mips_tdep prototype. * mips64-obsd-nat.c: Remove _initialize_mips64obsd_nat prototype. * mips64-obsd-tdep.c: Remove _initialize_mips64obsd_tdep prototype. * mipsread.c: Remove _initialize_mipsread prototype. * mn10300-linux-tdep.c: Remove _initialize_mn10300_linux_tdep prototype. * mn10300-tdep.c: Remove _initialize_mn10300_tdep prototype. * moxie-tdep.c: Remove _initialize_moxie_tdep prototype. * msp430-tdep.c: Remove _initialize_msp430_tdep prototype. * mt-tdep.c: Remove _initialize_mt_tdep prototype. * nds32-tdep.c: Remove _initialize_nds32_tdep prototype. * nios2-linux-tdep.c: Remove _initialize_nios2_linux_tdep prototype. * nios2-tdep.c: Remove _initialize_nios2_tdep prototype. * nto-procfs.c: Remove _initialize_procfs prototype. * nto-tdep.c: Remove _initialize_nto_tdep prototype. * objc-lang.c: Remove _initialize_objc_language prototype. * objfiles.c: Remove _initialize_objfiles prototype. * observer.c: Remove observer_test_first_notification_function, observer_test_second_notification_function, observer_test_third_notification_function, and _initialize_observer prototypes. * opencl-lang.c: Remove _initialize_opencl_language prototypes. * osabi.c: Remove _initialize_gdb_osabi prototype. * osdata.c: Remove _initialize_osdata prototype. * p-valprint.c: Remove _initialize_pascal_valprint prototype. * parse.c: Remove _initialize_parse prototype. * ppc-fbsd-nat.c: Remove _initialize_ppcfbsd_nat prototype. * ppc-fbsd-tdep.c: Remove _initialize_ppcfbsd_tdep prototype. * ppc-linux-nat.c: Remove _initialize_ppc_linux_nat prototype. * ppc-linux-tdep.c: Remove _initialize_ppc_linux_tdep prototype. * ppc-nbsd-nat.c: Remove _initialize_ppcnbsd_nat prototype. * ppc-nbsd-tdep.c: Remove _initialize_ppcnbsd_tdep prototype. * ppc-obsd-nat.c: Remove _initialize_ppcobsd_nat prototype. * ppc-obsd-tdep.c: Remove _initialize_ppcobsd_tdep prototype. * printcmd.c: Remove _initialize_printcmd prototype. * probe.c: Remove _initialize_probe prototype. * proc-api.c: Remove _initialize_proc_api prototype. * proc-events.c: Remove _initialize_proc_events prototype. * proc-service.c: Remove _initialize_proc_service prototype. * procfs.c: Remove _initialize_procfs prototype. * psymtab.c: Remove _initialize_psymtab prototype. * python/python.c: Remove _initialize_python prototype. * ravenscar-thread.c: Remove _initialize_ravenscar prototype. * record-btrace.c: Remove _initialize_record_btrace prototype. * record-full.c: Remove _initialize_record_full prototype. * record.c: Remove _initialize_record prototype. * regcache.c: Remove _initialize_regcache prototype. * reggroups.c: Remove _initialize_reggroup prototype. * remote-notif.c: Remove _initialize_notif prototype. * remote-sim.c: Remove _initialize_remote_sim prototype. * remote.c: Remove _initialize_remote prototype. * reverse.c: Remove _initialize_reverse prototype. * rl78-tdep.c: Remove _initialize_rl78_tdep prototype. * rs6000-aix-tdep.c: Remove _initialize_rs6000_aix_tdep prototype. * rs6000-lynx178-tdep.c: Remove _initialize_rs6000_lynx178_tdep prototype. * rs6000-nat.c: Remove _initialize_rs6000_nat prototype. * rs6000-tdep.c: Remove _initialize_rs6000_tdep prototype. * rust-exp.y: Remove _initialize_rust_exp prototype. * rx-tdep.c: Remove _initialize_rx_tdep prototype. * s390-linux-nat.c: Remove _initialize_s390_nat prototype. * s390-linux-tdep.c: Remove _initialize_s390_tdep prototype. * score-tdep.c: Remove _initialize_score_tdep prototype. * selftest-arch.c: Remove _initialize_selftests_foreach_arch prototype. * ser-go32.c: Remove _initialize_ser_dos prototype. * ser-mingw.c: Remove _initialize_ser_windows prototype. * ser-pipe.c: Remove _initialize_ser_pipe prototype. * ser-tcp.c: Remove _initialize_ser_tcp prototype. * ser-unix.c: Remove _initialize_ser_hardwire prototype. * serial.c: Remove _initialize_serial prototype. * sh-linux-tdep.c: Remove _initialize_sh_linux_tdep prototype. * sh-nbsd-nat.c: Remove _initialize_shnbsd_nat prototype. * sh-nbsd-tdep.c: Remove _initialize_shnbsd_tdep prototype. * sh-tdep.c: Remove _initialize_sh_tdep prototype. * skip.c: Remove _initialize_step_skip prototype. * sol-thread.c: Remove _initialize_sol_thread prototype. * solib-aix.c: Remove _initialize_solib_aix prototype. * solib-darwin.c: Remove _initialize_darwin_solib prototype. * solib-dsbt.c: Remove _initialize_dsbt_solib prototype. * solib-frv.c: Remove _initialize_frv_solib prototype. * solib-spu.c: Remove _initialize_spu_solib prototype. * solib-svr4.c: Remove _initialize_svr4_solib prototype. * solib-target.c: Remove _initialize_solib_target prototype. * solib.c: Remove _initialize_solib prototype. * source.c: Remove _initialize_source prototype. * sparc-linux-nat.c: Remove _initialize_sparc_linux_nat prototype. * sparc-linux-tdep.c: Remove _initialize_sparc_linux_tdep prototype. * sparc-nat.c: Remove _initialize_sparc_nat prototype. * sparc-nbsd-nat.c: Remove _initialize_sparcnbsd_nat prototype. * sparc-nbsd-tdep.c: Remove _initialize_sparcnbsd_tdep prototype. * sparc-obsd-tdep.c: Remove _initialize_sparc32obsd_tdep prototype. * sparc-sol2-nat.c: Remove _initialize_sparc_sol2_nat prototype. * sparc-sol2-tdep.c: Remove _initialize_sparc_sol2_tdep prototype. * sparc-tdep.c: Remove _initialize_sparc_tdep prototype. * sparc64-fbsd-nat.c: Remove _initialize_sparc64fbsd_nat prototype. * sparc64-fbsd-tdep.c: Remove _initialize_sparc64fbsd_tdep prototype. * sparc64-linux-nat.c: Remove _initialize_sparc64_linux_nat prototype. * sparc64-linux-tdep.c: Remove _initialize_sparc64_linux_tdep prototype. * sparc64-nat.c: Remove _initialize_sparc64_nat prototype. * sparc64-nbsd-nat.c: Remove _initialize_sparc64nbsd_nat prototype. * sparc64-nbsd-tdep.c: Remove _initialize_sparc64nbsd_tdep prototype. * sparc64-obsd-nat.c: Remove _initialize_sparc64obsd_nat prototype. * sparc64-obsd-tdep.c: Remove _initialize_sparc64obsd_tdep prototype. * sparc64-sol2-tdep.c: Remove _initialize_sparc64_sol2_tdep prototype. * spu-linux-nat.c: Remove _initialize_spu_nat prototype. * spu-multiarch.c: Remove _initialize_spu_multiarch prototype. * spu-tdep.c: Remove _initialize_spu_tdep prototype. * stabsread.c: Remove _initialize_stabsread prototype. * stack.c: Remove _initialize_stack prototype. * stap-probe.c: Remove _initialize_stap_probe prototype. * std-regs.c: Remove _initialize_frame_reg prototype. * symfile-debug.c: Remove _initialize_symfile_debug prototype. * symfile-mem.c: Remove _initialize_symfile_mem prototype. * symfile.c: Remove _initialize_symfile prototype. * symmisc.c: Remove _initialize_symmisc prototype. * symtab.c: Remove _initialize_symtab prototype. * target-dcache.c: Remove _initialize_target_dcache prototype. * target-descriptions.c: Remove _initialize_target_descriptions prototype. * thread.c: Remove _initialize_thread prototype. * tic6x-linux-tdep.c: Remove _initialize_tic6x_linux_tdep prototype. * tic6x-tdep.c: Remove _initialize_tic6x_tdep prototype. * tilegx-linux-nat.c: Remove _initialize_tile_linux_nat prototype. * tilegx-linux-tdep.c: Remove _initialize_tilegx_linux_tdep prototype. * tilegx-tdep.c: Remove _initialize_tilegx_tdep prototype. * tracefile-tfile.c: Remove _initialize_tracefile_tfile prototype. * tracefile.c: Remove _initialize_tracefile prototype. * tracepoint.c: Remove _initialize_tracepoint prototype. * tui/tui-hooks.c: Remove _initialize_tui_hooks prototype. * tui/tui-interp.c: Remove _initialize_tui_interp prototype. * tui/tui-layout.c: Remove _initialize_tui_layout prototype. * tui/tui-regs.c: Remove _initialize_tui_regs prototype. * tui/tui-stack.c: Remove _initialize_tui_stack prototype. * tui/tui-win.c: Remove _initialize_tui_win prototype. * tui/tui.c: Remove _initialize_tui prototype. * typeprint.c: Remove _initialize_typeprint prototype. * user-regs.c: Remove _initialize_user_regs prototype. * utils.c: Remove _initialize_utils prototype. * v850-tdep.c: Remove _initialize_v850_tdep prototype. * valarith.c: Remove _initialize_valarith prototype. * valops.c: Remove _initialize_valops prototype. * valprint.c: Remove _initialize_valprint prototype. * value.c: Remove _initialize_values prototype. * varobj.c: Remove _initialize_varobj prototype. * vax-bsd-nat.c: Remove _initialize_vaxbsd_nat prototype. * vax-nbsd-tdep.c: Remove _initialize_vaxnbsd_tdep prototype. * vax-tdep.c: Remove _initialize_vax_tdep prototype. * windows-nat.c: Remove _initialize_windows_nat, _initialize_check_for_gdb_ini, and _initialize_loadable prototypes. * windows-tdep.c: Remove _initialize_windows_tdep prototype. * xcoffread.c: Remove _initialize_xcoffread prototype. * xml-support.c: Remove _initialize_xml_support prototype. * xstormy16-tdep.c: Remove _initialize_xstormy16_tdep prototype. * xtensa-linux-nat.c: Remove _initialize_xtensa_linux_nat prototype. * xtensa-linux-tdep.c: Remove _initialize_xtensa_linux_tdep prototype. * xtensa-tdep.c: Remove _initialize_xtensa_tdep prototype.
2017-09-05Convert the rest x86 target descriptionsYao Qi
This patch changes the rest of x86 target descriptions in GDB and GDBserver. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-tdep.c (amd64_target_description): Create target descriptions. (_initialize_amd64_tdep): Don't call functions initialize_tdesc_amd64_*. Add self tests. * arch/amd64.c (amd64_create_target_description): Add parameter is_linux. Call set_tdesc_osabi if is_linux is true. * arch/amd64.h (amd64_create_target_description): Update the declaration. * arch/i386.c (i386_create_target_description): Add parameter is_linux. Call set_tdesc_osabi if is_linux is true. * arch/i386.h (i386_create_target_description): Update declaration. * configure.tgt: Add i386.o to gdb_target_obs. * features/Makefile (XMLTOC): Remove i386/*.xml. * features/i386/amd64-avx-avx512.c: Remove. * features/i386/amd64-avx-mpx-avx512-pku.c: Remove. * features/i386/amd64-avx-mpx.c: Remove. * features/i386/amd64-avx.c: Remove. * features/i386/amd64-mpx.c: Remove. * features/i386/amd64.c: Remove. * features/i386/i386-avx-avx512.c: Remove. * features/i386/i386-avx-mpx-avx512-pku.c: Remove. * features/i386/i386-avx-mpx.c: Remove. * features/i386/i386-avx.c: Remove. * features/i386/i386-mmx.c: Remove. * features/i386/i386-mpx.c: Remove. * features/i386/i386.c: Remove. * i386-tdep.c: Don't include features/i386/i386*.c., include target-descriptions.h and arch/i386.h. (i386_target_description): Create target descriptions. (i386_gdbarch_init): Don't call initialize_tdesc_i386_* functions. Do self tests. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv (srv_i386_regobj): Remove. (srv_amd64_regobj): Remove. (srv_regobj): Set it to "" for x86 non-linux targets. * linux-x86-tdesc.c (i386_linux_read_description): * lynx-i386-low.c: Include x86-xstate.h and arch/i386.h. (init_registers_i386): Remove the declaration. (tdesc_i386): Remove the declaration. (lynx_i386_arch_setup): Call i386_create_target_description. * nto-x86-low.c: Likewise. * win32-i386-low.c [__x86_64__]: include arch/amd64.h. [!__x86_64__]: include arch/i386.h. (i386_arch_setup) [__x86_64__]: Call amd64_create_target_description.
2017-09-05Share i386-linux target description between GDB and GDBserverYao Qi
The code on creating i386-linux target descriptions are quite similar between GDB and GDBserver, so this patch moves them into a shared file arch/i386.c. I didn't name it as i386-linux.c, because I want to reuse it to create other i386 non-linux target descriptions later. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (ALL_TARGET_OBS): Add i386.o. (SFILES): Add arch/i386.c. (HFILES_NO_SRCDIR): Add arch/i386.h. * arch/i386.c: New file. * arch/i386.h: New file. * arch/tdesc.h (allocate_target_description): Declare. (set_tdesc_architecture): Declare. (set_tdesc_osabi): Declare. * configure.tgt (i[34567]86-*-linux*): Add i386.o. * i386-linux-tdep.c: Don't include ../features/i386/32bit-XXX.c. include arch/i386.h. (i386_linux_read_description): Remove code and call i386_create_target_description. (set_tdesc_architecture): New function. (set_tdesc_osabi): New function. * target-descriptions.h (allocate_target_description): Remove. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (arch-i386.o): New rule. * configure.srv (i[34567]86-*-linux*): Add arch-i386.o. (x86_64-*-linux*): Likewise. * linux-x86-tdesc.c: Don't include ../features/i386/32bit-XXX.c, include arch/i386.h. (i386_linux_read_description): Remove code and call i386_create_target_description. * tdesc.c (allocate_target_description): New function. * tdesc.h (set_tdesc_architecture): Remove declaration. (set_tdesc_osabi): Likewise.
2017-09-05[GDBserver] Centralize tdesc for i386-linuxYao Qi
tdesc_i386_XXX_linux is used in many places in linux-x86-low.c and this patch adds a new function i386_linux_read_description to return the right tdesc according to xcr0. i386_linux_read_description is quite similar to the counterpart in GDB, and the following patch will share the duplicated code, so this patch adds arch/tdesc.h includes the declarations of various tdesc apis which are used by the shared code. The generated c feature files can include arch/tdesc.h only. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv (srv_tgtobj): Append linux-x86-tdesc.o. (ipa_obj): Likewise. * linux-i386-ipa.c: Include common/x86-xstate.h (get_ipa_tdesc): Call i386_linux_read_description. (initialize_low_tracepoint): Don't call init_registers_XXX functions, call initialize_low_tdesc instead. * linux-x86-low.c (x86_linux_read_description): Call i386_linux_read_description. (initialize_low_arch): Don't call init_registers_i386_XXX functions, call initialize_low_tdesc. * linux-x86-tdesc.c: New file. * linux-x86-tdesc.h (x86_linux_tdesc): New X86_TDESC_LAST. (i386_get_ipa_tdesc_idx): Declare. (i386_get_ipa_tdesc): Declare. (initialize_low_tdesc): Declare. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * arch/tdesc.h: New file. * regformats/regdat.sh: Generate code using tdesc_create_reg. * target-descriptions.c: Update comments. * target-descriptions.h: Include "arch/tdesc.h". Remove the declarations. * features/i386/32bit-avx.c: Re-generated. * features/i386/32bit-avx512.c: Re-generated. * features/i386/32bit-core.c: Re-generated. * features/i386/32bit-linux.c: Re-generated. * features/i386/32bit-mpx.c: Re-generated. * features/i386/32bit-pkeys.c: Re-generated. * features/i386/32bit-sse.c: Re-generated.
2017-08-07gdbarch: Use an anonymous union for target data in `gdbarch_info'Maciej W. Rozycki
As an update to commit ede5f15146ae ("gdbarch.h: Change gdbarch_info::tdep_info's type to void *") replace the definition of the `tdep_info' member in `struct gdbarch_info' with an anonymous union, comprising the original member, with its type reverted to `struct gdbarch_tdep_info *', a `tdesc_data' member of a `struct tdesc_arch_data *' type and an `id' member of an `int *' type. Remove now unnecessary casts throughout use places then, making code easier to read an less prone to errors, which may happen with casting. gdb/ * gdbarch.sh (gdbarch_info): Replace the `tdep_info' member with a union of `tdep_info', `tdesc_data' and `id'. * aarch64-tdep.c (aarch64_gdbarch_init): Use `info.tdesc_data' rather than `info.tdep_info'. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_gdbarch_init): Likewise. * mips-linux-tdep.c (mips_linux_init_abi): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * nds32-tdep.c (nds32_gdbarch_init): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * ppc-linux-tdep.c (ppu2spu_sniffer): Use `info.id' rather than `info.tdep_info'. (ppc_linux_init_abi): Use `info.tdesc_data' rather than `info.tdep_info'. * sparc-tdep.c (sparc32_gdbarch_init): Likewise. * spu-multiarch.c (spu_gdbarch): Use `info.id' rather than `info.tdep_info'. * spu-tdep.c (spu_gdbarch_init): Likewise. * gdbarch.h: Regenerate.
2017-07-26Add "maint check xml-descriptions" to test builtin xml target descriptionsYao Qi
Now, GDB is able to dynamically create i386-linux target descriptions from features, instead of using pre-generated target descriptions. These pre-generated target descriptions are no longer used by GDB (note that they are still used by GDBserver). This patch add a new maint command "maint check xml-descriptions" to test dynamically generated tdesc are identical to these generated from xml files. gdb: 2017-07-26 Yao Qi <yao.qi@linaro.org> * cli/cli-cmds.c (maintenancechecklist): New variable. * gdbcmd.h (maintenancechecklist): Declare it. * i386-linux-tdep.c (_initialize_i386_linux_tdep) [GDB_SELF_TEST]: Call i386_linux_read_description with different masks. * maint.c (maintenance_check_command): New function. (_initialize_maint_cmds): Call add_prefix_cmd. * target-descriptions.c (tdesc_reg): override operator != and ==. (tdesc_type): Likewise. (tdesc_feature): Likewise. (target_desc): Likewise. [GDB_SELF_TEST] (selftests::record_xml_tdesc): New function. (maintenance_check_xml_descriptions): New function. (_initialize_target_descriptions) Add command "xml-descriptions". * target-descriptions.h (selftests::record_xml_tdesc): Declare. gdb/testsuite: 2017-07-26 Yao Qi <yao.qi@linaro.org> * gdb.gdb/unittest.exp: Invoke command "maintenance check xml-descriptions". gdb/doc: 2017-07-26 Yao Qi <yao.qi@linaro.org> * gdb.texinfo (Maintenance Commands): Document command "maint check xml-descriptions".
2017-07-26Lazily and dynamically create i386-linux target descriptionsYao Qi
Instead of using pre-generated target descriptions, this patch changes GDB to lazily and dynamically create target descriptions according to the target hardware capability (xcr0 in i386). This support any combination of target features. Some reg in target description has "regnum" attribute, so its register number is got from the attribute value instead from sequential allocation. <reg name="xmm0" bitsize="128" type="vec128" regnum="32"/> when target description is created, it should match the regnum, so this patch adds a new field m_next_regnum to track it, if attribute number is greater than the m_next_regnum, print the code to set register number explicitly. gdb: 2017-07-26 Yao Qi <yao.qi@linaro.org> * i386-linux-tdep.c: Don't include features/i386/i386-*linux.c. Include features/i386/32bit-*.c. (i386_linux_read_description): Generate target description if it doesn't exist. (_initialize_i386_linux_tdep): Don't call _initialize_tdesc_i386 functions. * features/i386/32bit-linux.c: Re-generated. * features/i386/32bit-sse.c: Likewise. * target-descriptions.c (print_c_feature::visit): Print code to set register number if needed. (print_c_feature) <m_next_regnum>: New field.
2017-07-26Centralize i386 linux target descriptionsYao Qi
This patch moves all the tdesc_i386*_linux target descriptions to a function i386_linux_read_description, which returns the right target description according to xcr0. This also remove the duplication in getting target descriptions in corefile and native target. gdb: 2017-07-26 Yao Qi <yao.qi@linaro.org> * i386-linux-tdep.c (i386_linux_read_description): New function. (i386_linux_core_read_description): Call i386_linux_read_description. * i386-linux-tdep.h (i386_linux_read_description): Declare. (tdesc_i386_linux, tdesc_i386_mmx_linux): Remove declarations. (tdesc_i386_avx_linux, tdesc_i386_mpx_linux): Likewise (tdesc_i386_avx_mpx_linux, tdesc_i386_avx_avx512_linux): Likewise. (tdesc_i386_avx_mpx_avx512_pku_linux): Likewise. * x86-linux-nat.c (x86_linux_read_description): Call i386_linux_read_description.
2017-06-10gdbarch: Remove displaced_step_free_closureSimon Marchi
The displaced_step_free_closure gdbarch hook allows architectures to free data they might have allocated to complete a displaced step. However, all architectures using that hook use the simple_displaced_step_free_closure provided in arch-utils.{c,h}, which does a simple xfree. We can remove it and do an xfree directly instead of calling the hook. gdb/ChangeLog: * gdbarch.sh (displaced_step_free_closure): Remove. * gdbarch.h, gdbarch.c: Re-generate. * aarch64-linux-tdep.c (aarch64_linux_init_abi): Don't set displaced_step_free_closure. * amd64-linux-tdep.c (amd64_linux_init_abi_common): Likewise. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * rs6000-aix-tdep.c (rs6000_aix_init_osabi): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * arch-utils.h (simple_displaced_step_free_closure): Remove. * arch-utils.c (simple_displaced_step_free_closure): Remove. * infrun.c (displaced_step_clear): Call xfree instead of gdbarch_displaced_step_free_closure.
2017-02-17Add support for Intel PKRU register to GDB and GDBserver.Michael Sturm
This patch adds support for the registers added by the Memory Protection Keys for Userspace (PKU aka PKEYs) feature. Native and remote debugging are covered by this patch. The XSAVE area is extended with a new state containing the 32-bit wide PKRU register. The new register is added to amd64-avx-mpx_avx512-* tdesc, thus it is renamed accordingly. Also, respective xstate mask X86_XSTATE_AVX_MPX_AVX512_MASK is renamed to X86_XSTATE_AVX_MPX_AVX512_PKU_MASK to reflect the new feature set it supports. For more information, please refer to the Intel(R) 64 and IA-32 Architectures Software Developer's Manual - Septemper 2015 http://www.intel.com/content/dam/www/public/us/en/documents/ manuals/64-ia-32-architectures-software-developer-manual-325462.pdf gdb/Changelog: 2015-12-08 Michael Sturm <michael.sturm@intel.com> * NEWS: Mention addition of PKU feature. * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add PKRU register. * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-avx512-linux.c): Rename to... (features/i386/amd64-avx-mpx-avx512-pku-linux.c): ...this. (amd64_linux_gregset_reg_offset): Add PKRU register. (amd64_linux_core_read_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512_pku_linux. (_initialize_amd64_linux_tdep): Rename initialize_tdesc_amd64_avx_mpx_avx512_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (tdesc_amd64_avx_mpx_avx512_linux): Rename to... (tdesc_amd64_avx_mpx_avx512_pku_linux): ...this. * amd64-tdep.c (features/i386/amd64-avx-mpx-avx512-pku.c): Rename to... (features/i386/amd64-avx-mpx-avx512-pku.c): ...this. (amd64_pkeys_names): New register name for raw register PKRU. (amd64_init_abi): Add code to initialize PKRU tdep variables if feature is present. (amd64_target_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512. (_initialize_amd64_tdep): Rename initialize_tdesc_amd64_avx_mpx_avx512. * amd64-tdep.h (enum amd64_regnum): Add PKRU register. (AMD64_NUM_REGS): Adjust regnum calculation. * i386-linux.nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by PKRU register. * common/x86-xstate.h (X86_XSTATE_PKRU): New macro. (X86_XSTATE_AVX_MPX_AVX512_MASK): Add PKRU and renamed mask. (X86_XSTATE_ALL_MASK): Rename X86_XSTATE_AVX_MPX_AVX512_MASK. (X86_XSTATE_PKRU_SIZE): New macro. (X86_XSTATE_MAX_SIZE): Adjust size. (HAS_PKRU(XCR0)): New macro. (X86_XSTATE_SIZE): Add checkfor PKRU. * features/Makefile (WHICH): Rename i386/i386-avx-mpx-avx512, i386/i386-avx-mpx-avx512-linux, i386/amd64-avx-mpx-avx512, i386/amd64-avx-mpx-avx512-linux. (i386/i386-avx-mpx-avx512-expedite): Rename expedite. (i386/i386-avx-mpx-avx512-linux-expedite): Likewise. (i386/amd64-avx-mpx-avx512-expedite): Likewise. (i386/amd64-avx-mpx-avx512-linux-expedite): Likewise. (XMLTOC): Rename i386/amd64-avx-mpx-avx512-linux.xml, i386/amd64-avx-mpx-avx512.xml, i386/i386-avx-mpx-avx512-linux.xml, i386/i386-avx-mpx-avx512.xml. ((outdir)/i386/i386-avx-mpx-avx512.dat): Rename rule, add i386/32bit-pkeys.xml. ((outdir)/i386/i386-avx-mpx-avx512-pku-linux.dat): Likewise. ((outdir)/i386/amd64-avx-mpx-avx512.dat): Rename rule, add i386/64bit-pkeys.xml. ((outdir)/i386/amd64-avx-mpx-avx512-linux.dat): Likewise. * features/i386/32bit-pkeys.xml: New file. * features/i386/64bit-pkeys.xml: Likewise. * features/i386/amd64-avx-mpx-avx512-linux-pku.c: Regenerate from renamed XML file. * features/i386/amd64-avx-mpx-avx512-linux.xml: Rename to amd64-avx-mpx-avx512-pku-linux.xml, add 64bit-pkeys.xml * features/i386/amd64-avx-mpx-avx512.c: Regenerate from renamed XML file. * features/i386/amd64-avx-mpx-avx512.xml: Rename to amd64-avx-mpx-avx512-pku.xml, add 64bit-pkeys.xml. * features/i386/i386-avx-mpx-avx512-linux.c: Regenerate from renamed XML file. * features/i386/i386-avx-mpx-avx512-linux.xml: Rename to i386-avx-mpx-avx512-pku-linux.xml, add 32bit-pkeys.xml. * features/i386/i386-avx-mpx-avx512.c: Regenerate from renamed XML file. * features/i386/i386-avx-mpx-avx512.xml: Rename to i386-avx-mpx-avx512-pku.xml, add 32bit-pkeys.xml. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Change to use I386_PKEYS_NUM_REGS. * i386-linux-tdep.c (features/i386/i386-avx-mpx-avx512-linux.c): Rename include. (i386_linux_gregset_reg_offset): Add PKRU register. (i386_linux_core_read_description): Rename xstate mask and returned tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK. (_initialize_i386_linux_tdep): Rename initialize_tdesc_i386_avx_mpx_avx512_linux. * i386-linux-tdep.h (I386_LINUX_ORIG_EAX_REGNUM): Adjuste regnum calculation. (tdesc_i386_avx_mpx_avx512_linux): Rename prototype. (/* Format of XSAVE...): Add pkru register. * i386-tdep.c (i386-avx-mpx-avx512.c): Rename include. (i386_pkeys_names): New register name for raw register PKRU. (i386_pkru_regnum_p): Add function to look up register number of PKRU raw register. (i386_register_reggroup_p): Add code to exclude PKRU from general register group. (i386_validate_tdesc_p): Add code to handle PKRU feature, add PKRU registers if feature is present in xcr0. (i386_gdbarch_init): Adjust number of registers in architecture. Add code to initialize PKRU feature variables in tdep structure. (i386_target_description): Rename xstate mask and returned tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK. (_initialize_i386_tdep): Rename initialize_tdesc_i386_avx_mpx_avx512. * i386-tdep.h (struct gdbarch_tdep): Add feature variables to tdep structure. (enum i386_regnum): Add PKRU register. (I386_PKEYS_NUM_REGS): New define for number of registers in PKRU feature. (i386_pkru_regnum_p): New prototype. * i387-tdep.c (xsave_pkeys_offset): New table for PKRU offsets in XSAVE buffer. (XSAVE_PKEYS_ADDR): New macro. (i387_supply_xsave): Add code to handle PKRU register. (i387_collect_xsave): Likewise. * i387-tdep.h (I387_NUM_PKEYS_REGS): New define for number of registers in PKRU feature. (I387_PKRU_REGNUM): New macro. (I387_PKEYSEND_REGNUM): Likewise. * regformats/i386/amd64_avx_mpx_avx512_pku_linux.dat: Regenerate from renamed XML file. * regformats/i386/amd64_avx_mpx_avx512_pku.dat: Likewise. * regformats/i386/i386/amd64-avx-mpx-avx512-pku.dat: Likewise. * regformats/i386/i386_avx_mpx_avx512_pku_linux.dat: Likewise. testsuite/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * gdb.arch/i386-pkru.c: New file. * gdb.arch/i386-pkru.exp: Likewise. gdbserver/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * Makefile.in (clean): Rename i386-avx-mpx-avx512.c, i386-avx-mpx-avx512-linux.c, amd64-avx-mpx-avx512.c, amd64-avx-mpx-avx512-linux.c. (i386-avx-mpx-avx512-linux-ipa.o:): Rename rule and source file. (amd64-avx-mpx-avx512-linux-ipa.o:): Likewise. (i386-avx-mpx-avx512.c :): Rename rule, source files and dat files. (i386-avx-mpx-avx512-linux.c :): Likewise. (amd64-avx-mpx-avx512.c :): Likewise. (amd64-avx-mpx-avx512-linux.c :): Likewise. * configure.srv (srv_i386_regobj): Rename i386-avx-mpx-avx512.o. (srv_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux.o. (srv_amd64_regobj): Rename amd64-avx-mpx-avx512.o. (srv_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-linux.o. (ipa_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux-ipa.o. (ipa_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-pku-linux-ipa.o. (srv_i386_32bit_xmlfiles): Add 32bit-pkeys.xml. (srv_i386_64bit_xmlfiles): Add 64bit-pkeys.xml. (srv_i386_xmlfiles): Rename i386/i386-avx-mpx-avx512.xml. (srv_amd64_xmlfiles): Rename i386/amd64-avx-mpx-avx512.xml. (srv_i386_linux_xmlfiles): Rename i386/i386-avx-mpx-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Rename di386/amd64-avx-mpx-avx512-linux.xml. * i387-fp.c (num_pkeys_registers): New variable. (struct i387_xsave): Add space for pkru values. (i387_cache_to_fsave): Add code to handle PKRU register. (i387_xsave_to_cache): Likewise. * linux-amd64-ipa.c (get_ipa_tdesc): Rename tdesc_amd64_avx_mpx_avx512_linux. (initialize_low_tracepoint): Rename init_registers_amd64_avx_mpx_avx512_linux. * linux-i386-ipa.c (get_ipa_desc): Rename tdesc_i386_avx_mpx_avx512_linux. (initialize_low_tracepoint): Rename init_registers_i386_avx_mpx_avx512_linux. * linux-x86-low.c (x86_64_regmap[]): Add PKRU register. (x86_linux_read_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512_linux, rename tdesc_i386_avx_mpx_avx512_linux. (x86_get_ipa_tdesc_idx): Rename tdesc_amd64_avx_mpx_avx512_linux, rename tdesc_i386_avx_mpx_avx512_linux. (initialize_low_arch): Rename init_registers_amd64_avx_mpx_avx512_linux, rename init_registers_i386_avx_mpx_avx512_linux. * linux-x86-tdesc.h (init_registers_amd64_avx_mpx_avx512_linux): Renamed prototype. (tdesc_amd64_avx_mpx_avx512_linux): Likewise. (init_registers_i386_avx_mpx_avx512_linux): Likewise. (tdesc_i386_avx_mpx_avx512_linux): Likewise. doc/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * gdb.texinfo (i386 Features): Add description of PKRU register. Change-Id: If75ce5aba7dfd33fdbe3d8b47f04ef3f550c52be Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17Add target description for avx-avx512.Michael Sturm
Add a dedicated target description for the feature combination avx-avx512 as implemented by certain IA CPU models. The corresponding X86_XSTATE_AVX_AVX512_MASK already exists, but shared the tdesc with X86_XSTATE_AVX_MPX_AVX512_MASK. This caused MPX registers displayed as undefined on CPUs that only implemented X86_XSTATE_AVX_AVX512_MASK, which is undesired. This patch solves this issue. This patch also corrects the wrong usage of x32-avx-mpx-avx512, which is replaced by x32-avx-avx512. The MPX feature is not implemented in x32 mode. gdb/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * amd64-linux-tdep.c (features/i386/amd64-avx-avx512-linux.c): New include. (features/i386/x32-avx-mpx-avx512-linux.c): Rename to... (features/i386/x32-avx-avx512-linux.c): ...this. (amd64_linux_core_read_description): Add dedicated cases for X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc. (_initialize_amd64_linux_tdep): Add calls to initialize_tdesc_amd64_avx_avx512_linux and initialize_tdesc_x32_avx_avx512_linux. * amd64-linux.tdep.h (tdesc_amd64_avx_avx512_linux): New prototype. (tdesc_x32_avx_mpx_avx512_linux): Rename to... (tdesc_x32_avx_avx512_linu): ...this. * amd64-tdep.c (features/i386/amd64-avx-avx512.c): New include. (features/i386/x32-avx-mpx-avx512.c): Rename to... (features/i386/x32-avx-avx512.c): ...this. (amd64_target_description): Add dedicated case for X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc. (_initialize_amd64_tdep): Add call to initialize_tdesc_amd64_avx_avx512. (initialize_tdesc_x32_avx_mpx_avx512): Rename to... (initialize_tdesc_x32_avx_avx512): ...this. * features/Makefile (WHICH): New tdescs i386/i386-avx-avx512, i386/i386-avx-avx512-linux, i386/amd64-avx-avx512, i386/amd64-avx-avx512-linux. (i386/x32-avx-mpx-avx512): Rename to... (i386/x32-avx-avx512): ...this. (i386/x32-avx-mpx-avx512-linux): Rename to... (i386/x32-avx-avx512-linux): ...this. (i386/i386-avx-avx512-expedite, i386/i386-avx-avx512-linux-expedite, i386/amd64-avx-avx512-expedite, i386/amd64-avx-avx512-linux-expedite): New expedites. (i386/x32-avx-mpx-avx512-expedite): Rename to... (i386/x32-avx-avx512-expedite): ...this. (i386/x32-avx-mpx-avx512-linux-expedite): Rename to... (i386/x32-avx-avx512-linux-expedite): ...this. (XMLTOC): New XML files i386/amd64-avx-avx512-linux.xml, i386/amd64-avx-avx512.xml, i386/i386-avx-avx512-linux.xml, i386/i386-avx-avx512.xml. (i386/x32-avx-mpx-avx512-linux.xml): Rename to... (i386/x32-avx-avx512-linux.xml): ...this. (i386/x32-avx-mpx-avx512.xml): Rename to... (i386/x32-avx-avx512.xml): ...this. ($(outdir)/i386/i386-avx-avx512.dat): New rule. ($(outdir)/i386/i386-avx-avx512-linux.dat): Likewise. ($(outdir)/i386/amd64-avx-avx512.dat): Likewise. ($(outdir)/i386/amd64-avx-avx512-linux.dat): Likewise. ($(outdir)/i386/x32-avx-mpx-avx512.dat): Rename to... ($(outdir)/i386/x32-avx-avx512.dat): ...this. ($(outdir)/i386/x32-avx-mpx-avx512-linux.dat): Rename to... ($(outdir)/i386/x32-avx-avx512-linux.dat): ...this. * features/i386/amd64-avx-avx512-linux.c: New file. * features/i386/amd64-avx-avx512-linux.xml: Likewise. * features/i386/amd64-avx-avx512.c: Likewise. * features/i386/amd64-avx-avx512.xml: Likewise. * features/i386/i386-avx-avx512-linux.c: Likewise. * features/i386/i386-avx-avx512-linux.xml: Likewise. * features/i386/i386-avx-avx512.c: Likewise. * features/i386/i386-avx-avx512.xml: Likewise. * features/i386/x32-avx-mpx-avx512-linux.c: Deleted. * features/i386/x32-avx-avx512-linux.c: New file. * features/i386/x32-avx-mpx-avx512-linux.xml: Deleted. * features/i386/x32-avx-avx512-linux.xml: New file. * features/i386/x32-avx-mpx-avx512.c: Deleted. * features/i386/x32-avx-avx512.c: New file. * features/i386/x32-avx-mpx-avx512.xml: Deleted. * features/i386/x32-avx-avx512.xml: New file. * i386-linux-tdep.c (features/i386/i386-avx-avx512-linux.c): New include. (i386_linux_core_read_description): Add dedicated case for X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc. (_initialize_i386_linux_tdep): Add call to initialize_tdesc_i386_avx_avx512_linux. * i386-linux-tdep.h (tdesc_i386_avx_avx512_linux): New prototype. * i386-tdep.c (features/i386/i386-avx-avx512.c): New include. (i386_validate_tdesc_p): Correct XSTATE mask used for feature_avx512. (i386_target_description): Add dedicated case for X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc. (_initialize_i386_tdep): Add call to initialize_tdesc_i386_avx_avx512. * regformats/i386/amd64-avx-avx512-linux.dat: New file * regformats/i386/amd64-avx-avx512.dat: Likewise. * regformats/i386/i386-avx-avx512-linux.dat: Likewise. * regformats/i386/i386-avx-avx512.dat: Likewise. * regformats/i386/x32-avx-mpx-avx512-linux.dat: Deleted. * regformats/i386/x32-avx-avx512-linux.dat: New file. * regformats/i386/x32-avx-mpx-avx512.dat: Deleted. * regformats/i386/x32-avx-avx512.dat: New file. * x86-linux-nat.c (x86_linux_read_description): Add dedidated case for X86_XSTATE_AVX_AVX512_MASK and return appropriate description. gdbserver/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * Makefile.in (clean): Add handling of new source files i386-avx-avx512.c, i386-avx-avx512-linux.c, amd64-avx-avx512.c, amd64-avx-avx512-linux.c. (x32-avx-mpx-avx512.c): Rename to... (x32-avx-avx512.c): ...this. (x32-avx-mpx-avx512-linux.c): Rename to... (x32-avx-avx512-linux.c): ...this. (i386-avx-avx512-linux-ipa.o): New rule. (amd64-avx-avx512-linux-ipa.o): Likewise. (i386-avx-avx512.c): Likewise. (i386-avx-avx512-linux.c): Likewise. (amd64-avx-avx512.c): Likewise. (amd64-avx-avx512-linux.c): Likewise. (x32-avx-avx512.c): Rename rule, source files, dat files from x32-avx-mpx-avx512.*) to this. (x32-avx-avx512-linux.c): Rename rule, source files, dat files from x32-avx-mpx-avx512-linux.*) to this. * configure.srv (srv_i386_regobj): Add i386-avx-avx512.o. (srv_i386_linux_regobj): Add i386-avx-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx-avx512.o, rename x32-avx-mpx-avx512.o to x32-avx-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx-avx512-linux.o, rename x32-avx-mpx-avx512-linux.o to x32-avx-avx512-linux.o. (ipa_i386_linux_regobj): Add i386-avx-avx512-linux-ipa.o. (ipa_amd64_linux_regobj): Add amd64-avx-avx512-linux-ipa.o. (srv_i386_xmlfiles): Add i386/i386-avx-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx-avx512.xml, rename x32-avx-mpx-avx512.xml to x32-avx-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-avx512-linux.xml, rename x32-avx-mpx-avx512-linux.xml to x32-avx-avx512-linux.xml. * linux-amd64-ipa.c (get_ipa_tdesc): Add dedicated case for X86_TDESC_AVX_AVX512 and return appropriate tdesc. (initialize_low_tracepoint): Add init_registers_amd64_avx_avx512_linux. * linux-i386-ipa.c (get_ipa_tdesc): Add dedicated case for X86_TDESC_AVX_AVX512 and return appropriate tdesc. (initialize_low_tracepoint): Add init_registers_i386_avx_avx512_linux. * linux-x86-low.c (x86_linux_read_description): Add dedicated cases for X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc. (x86_get_ipa_tdesc_idx): Rename tdesc_x32_avx_mpx_avx512_linux to tdesc_x32_avx_avx512_linux, add dedicated if-clause for tdesc_amd64_avx_avx512_linux and return appropriate mask. Add dedicated clause for tdesc_i386_avx_avx512_linux and return appropriate mask. (initialize_low_arch): Add init_registers_amd64_avx_avx512_linux, rename init_registers_x32_avx_mpx_avx512_linux, add init_registers_i386_avx_avx512_linux. * linux-x86-tdesc.h (enum x86_linux_tdesc): Add new value for X86_TDESC_AVX_AVX512. (init_registers_amd64_avx_avx512_linux): New prototype. (tdesc_amd64_avx_avx512_linux): Likewise. (init_registers_x32_avx_mpx_avx512_linux): Rename to... (init_registers_x32_avx_avx512_linux): ...this. (tdesc_x32_avx_mpx_avx512_linux): Rename to... (tdesc_x32_avx_avx512_linux): ...this. (init_registers_i386_avx_avx512_linux): New prototype. (tdesc_i386_avx_avx512_linux): Likewise. Change-Id: I01359fab56c961a39568df50af39714ec7b31706 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17Rename target descriptions to reflect actual content of description.Michael Sturm
To better reflect the actual feature set covered by the IA target descriptions, the existing descriptions are renamed. Each feature of the extended state is added to the name of a description or xstate mask starting from AVX. For example, amd64-mpx-avx512-linux becomes amd64-avx-mpx-avx512-linux, while amd64-avx-linux remains unchanged. Likewise, the corresponding xstate masks are changed, e.g. from X86_XSTATE_MPX_AVX512_MASK to X86_XSTATE_AVX_MPX_AVX512_MASK. gdb/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * amd64-linux-tdep.c (features/i386/amd64-avx512-linux.c): Rename include to... (features/i386/amd64-avx-mpx-avx512-linux.c): ...this. (features/i386/x32-avx512-linux.c): Rename include to... (features/i386/x32-avx-mpx-avx512-linux.c): ...this. (amd64_linux_core_read_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, desc_x32_avx512_linux, tdesc_amd64_avx512_linux. (_initialize_amd64_linux_tdep): Rename initialize_tdesc_amd64_avx512_linux, initialize_tdesc_x32_avx512_linux. * amd64-linux-tdep.h (tdesc_amd64_avx512_linux): Rename to... (tdesc_amd64_avx_mpx_avx512_linux): ...this. (tdesc_x32_avx512_linux): Rename to... (tdesc_x32_avx_mpx_avx512_linux): ...this. * amd64-tdep.c (features/i386/amd64-avx512.c): Rename include to... (features/i386/amd64-avx-mpx-avx512.c): ...this. (features/i386/x32-avx512.c): Rename include to... (features/i386/x32-avx-mpx-avx512.c): ...this. (amd64_target_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, tdesc_amd64_avx512. (_initialize_amd64_tdep): Rename initialize_tdesc_amd64_avx512. Rename initialize_tdesc_x32_avx512. * common/x86-xstate.h (X86_XSTATE_AVX512_MASK): Rename to... (X86_XSTATE_AVX_AVX512_MASK): ...this. (86_XSTATE_MPX_AVX512_MASK): Rename to... (X86_XSTATE_AVX_MPX_AVX512_MASK): ...this. (X86_XSTATE_ALL_MASK): Rename X86_XSTATE_MPX_AVX512_MASK to X86_XSTATE_AVX_MPX_AVX512_MASK. * features/Makefile (WHICH): Rename i386/i386-avx512, i386/i386-avx512-linux, i386/amd64-avx512, i386/amd64-avx512-linux, i386/x32-avx512, i386/x32-avx512-linux. (i386/i386-avx512-expedite, i386/i386-avx512-linux-expedite, i386/amd64-avx512-expedite, i386/amd64-avx512-linux-expedite, i386/x32-avx512-expedite, i386/x32-avx512-linux-expedite): Rename expedites. (XMLTOC): Rename i386/amd64-avx512-linux.xml, i386/amd64-avx512.xml, i386/i386-avx512-linux.xml, i386/i386-avx512.xml, i386/x32-avx512-linux.xml, i386/x32-avx512.xml. ($(outdir)/i386/i386-avx512.dat): Rename dat file in rule. ($(outdir)/i386/i386-avx512-linux.dat): Likewise. ($(outdir)/i386/amd64-avx512.dat): Likewise. ($(outdir)/i386/amd64-avx512-linux.dat): Likewise. ($(outdir)/i386/x32-avx512.dat): Likewise. ($(outdir)/i386/x32-avx512-linux.dat): Likewise. * features/i386/amd64-avx512-linux.c: Regenerate from renamed XML file. * features/i386/amd64-avx512-linux.xml: Rename XML file. * features/i386/amd64-avx512.c: Regenerate from renamed XML file. * features/i386/amd64-avx512.xml: Rename XML file. * features/i386/i386-avx512-linux.c: Regenerate from renamed XML file. * features/i386/i386-avx512-linux.xml: Rename XML file. * features/i386/i386-avx512.c: Regenerate from renamed XML file. * features/i386/i386-avx512.xml: Rename XML file. * features/i386/x32-avx512-linux.c: Regenerate from renamed XML file. * features/i386/x32-avx512-linux.xml: Rename XML file. * features/i386/x32-avx512.c: Regenerate from renamed XML file. * features/i386/x32-avx512.xml: Rename XML file. * i386-linux-tdep.c (features/i386/i386-avx512-linux.c): Rename to... (features/i386/i386-avx-mpx-avx512-linux.c): ...this. (i386_linux_core_read_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, tdesc_i386_avx512_linux. (_initialize_i386_linux_tdep): Rename initialize_tdesc_i386_avx512_linux. * i386-linux-tdep.h (tdesc_i386_avx512_linux): Rename to... (tdesc_i386_avx_mpx_avx512_linux): ...this. * i386-tdep.c (features/i386/i386-avx512.c): Rename to... (features/i386/i386-avx-mpx-avx512.c): ...this. (i386_register_reggroup_p): Rename X86_XSTATE_AVX512_MASK. (i386_validate_tdesc_p): Likewise. (i386_target_description): Rename X86_XSTATE_MPX_AVX512_MASK, tdesc_i386_avx512. (_initialize_i386_tdep): Rename initialize_tdesc_i386_avx512. * regformats/i386/amd64-avx512-linux.dat: Regenerate from renamed XML file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * x86-Linux-nat.c (x86_linux_read_description): Rename X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK, tdesc_x32_avx512_linux, tdesc_amd64_avx512_linux, tdesc_i386_avx512_linux. gdbserver/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * Makefile.in (clean): Rename i386-avx512.c, i386-avx512-linux.c, amd64-avx512.c, amd64-avx512-linux.c, x32-avx512.c, x32-avx512-linux.c. (i386-avx512-linux-ipa.o): Rename rule and source files. (amd64-avx512-linux-ipa.o): Likewise. (i386-avx512.c): Rename rule, source fils and dat files. (i386-avx512-linux.c): Likewise. (amd64-avx512.c): Likewise. (amd64-avx512-linux.c): Likewise. (x32-avx512.c): Likewise. (x32-avx512-linux.c): Likewise. * configfure.srv (srv_i386_regobj): Rename i386-avx512.o. (i386_linux_regobj): Rename i386-avx512-linux.o. (srv_amd64_regobj): Rename amd64-avx512.o, x32-avx512.o. (srv_amd64_linux_regobj): Rename amd64-avx512-linux.o, x32-avx512-linux.o. (ipa_i386_linux_regobj): Rename i386-avx512-linux-ipa.o. (ipa_amd64_linux_regobj): Rename amd64-avx512-linux-ipa.o. (srv_i386_xmlfiles): Rename i386/i386-avx512.xml. (srv_amd64_xmlfiles): Rename i386/amd64-avx512.xml, i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Rename i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Rename i386/amd64-avx512-linux.xml, i386/x32-avx512-linux.xml). * linux-amd64-ipa.c (get_ipa_tdesc): Rename X86_TDESC_AVX512 and returned tdesc for that case. (initialize_low_tracepoint): Rename init_registers_amd64_avx512_linux. * linux-i386-ipa.c (get_ipa_tdesc): Rename X86_TDESC_AVX512 and tdesc returned for that case. (initialize_low_tracepoint): Rename init_registers_i386_avx512_linux. * linux-x86-low.c (x86_linux_read_description): Rename X86_XSTATE_AVX512_MASK and tdesc returned for that case. (x86_get_ipa_tdesc_idx): Rename tdesc_amd64_avx512_linux, tdesc_x32_avx512_linux and mask returned for these descriptions. Rename tdesc_i386_avx512_linux and mask returned for that description. (initialize_low_arch): Rename init_registers_amd64_avx512_linux, init_registers_x32_avx512_linux, init_registers_i386_avx512_linux. * linux-x86-tdesc.h (enum x86_linux_tdesc): Rename X86_TDESC_AVX512. (init_registers_amd64_avx512_linux): Rename to... (init_registers_amd64_avx_mpx_avx512_linux): ...this. (tdesc_amd64_avx512_linux): Rename to... (tdesc_amd64_avx_mpx_avx512_linux): ...this. (init_registers_x32_avx512_linux): Rename to... (init_registers_x32_avx_mpx_avx512_linux): ...this. (tdesc_x32_avx512_linux): Rename to... (tdesc_x32_avx_mpx_avx512_linux): ...this. (init_registers_i386_avx512_linux): Rename to... (init_registers_i386_avx_mpx_avx512_linux): ...this. (tdesc_i386_avx512_linux): Rename to... (tdesc_i386_avx_mpx_avx512_linux): ...this. Change-Id: Idb83be3b3b72d5487542d4b568193df2777a3d9d Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-01-01update copyright year range in GDB filesJoel Brobecker
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-12-22Class-ify ui_outSimon Marchi
This patch finalizes the C++ conversion of the ui-out subsystem, by turning the ui_out and ui_out_impl structures into a single class hierarchy. ui_out functions are turned into virtual methods of that new class, so as a result there are a lot of call sites to update. In the previous version of the patchset, there were separate ui_out and ui_out_impl classes, but it wasn't really useful and added boilerplate. In this version there is simply an ui_out base class that is extended for CLI, TUI and MI. It's a bit hard to maintain a ChangeLog for such a big patch, I did my best but I'm sure there are some missing or outdated info in there... gdb/ChangeLog: * ui-out.h (ui_out_begin, ui_out_end, ui_out_table_header, ui_out_table_body, ui_out_field_int, ui_out_field_fmt_int, ui_out_field_core_addr, ui_out_field_string, ui_out_field_stream, ui_out_field_fmt, ui_out_field_skip, ui_out_spaces, ui_out_text, ui_out_message, ui_out_wrap_hint, ui_out_flush, ui_out_test_flags, ui_out_query_field, ui_out_is_mi_like_p, ui_out_redirect): Remove, replace with a method in class ui_out. (table_begin_ftype): Remove, replace with pure virtual method in class ui_out. (table_body_ftype): Likewise. (table_end_ftype): Likewise. (table_header_ftype): Likewise. (ui_out_begin_ftype): Likewise. (ui_out_end_ftype): Likewise. (field_int_ftype): Likewise. (field_skip_ftype): Likewise. (field_string_ftype): Likewise. (field_fmt_ftype): Likewise. (spaces_ftype): Likewise. (text_ftype): Likewise. (message_ftype): Likewise. (wrap_hint_ftype): Likewise. (flush_ftype): Likewise. (redirect_ftype): Likewise. (data_destroy_ftype): Likewise. (struct ui_out_impl): Remove, replace with class ui_out. (ui_out_new): Remove. (class ui_out): New class. * ui-out.c (struct ui_out): Remove, replaced with class ui_out. (current_level): Remove, replace with ui_out method. (push_level): Likewise. (pop_level): Likewise. (uo_table_begin, uo_table_body, uo_table_end, uo_table_header, uo_begin, uo_end, uo_field_int, uo_field_skip, uo_field_fmt, uo_spaces, uo_text, uo_message, uo_wrap_hint, uo_flush, uo_redirect, uo_field_string): Remove. (ui_out_table_begin): Replace with ... (ui_out::table_begin): ... this. (ui_out_table_body): Replace with ... (ui_out::table_body): ... this. (ui_out_table_end): Replace with ... (ui_out::table_end): ... this. (ui_out_table_header): Replace with ... (ui_out::table_header): ... this. (ui_out_begin): Replace with ... (ui_out::begin): ... this. (ui_out_end): Replace with ... (ui_out::end): ... this. (ui_out_field_int): Replace with ... (ui_out::field_int): ... this. (ui_out_field_fmt_int): Replace with ... (ui_out::field_fmt_int): ... this. (ui_out_field_core_addr): Replace with ... (ui_out::field_core_addr): ... this. (ui_out_field_stream): Replace with ... (ui_out::field_stream): ... this. (ui_out_field_skip): Replace with ... (ui_out::field_skip): ... this. (ui_out_field_string): Replace with ... (ui_out::field_string): ... this. (ui_out_field_fmt): Replace with ... (ui_out::field_fmt): ... this. (ui_out_spaces): Replace with ... (ui_out::spaces): ... this. (ui_out_text): Replace with ... (ui_out::text): ... this. (ui_out_message): Replace with ... (ui_out::message): ... this. (ui_out_wrap_hint): Replace with ... (ui_out::wrap_hint): ... this. (ui_out_flush): Replace with ... (ui_out::flush): ... this. (ui_out_redirect): Replace with ... (ui_out::redirect): ... this. (ui_out_test_flags): Replace with ... (ui_out::test_flags): ... this. (ui_out_is_mi_like_p): Replace with ... (ui_out::is_mi_like_p): ... this. (verify_field): Replace with ... (ui_out::verify_field): ... this. (ui_out_query_field): Replace with ... (ui_out::query_table_field): ... this. (ui_out_data): Remove. (ui_out_new): Remove, replace with ... (ui_out::ui_out): ... this constructor. (do_cleanup_table_end, make_cleanup_ui_out_tuple_begin_end, do_cleanup_end, make_cleanup_ui_out_tuple_begin_end, make_cleanup_ui_out_list_begin_end): Update fallouts of struct ui_out -> class ui_out change. * cli-out.c (cli_out_data): Remove. (cli_uiout_dtor): Remove. (cli_table_begin): Replace with ... (cli_ui_out::do_table_begin): ... this new method. (cli_table_body): Replace with ... (cli_ui_out::do_table_body): ... this new method. (cli_table_end): Replace with ... (cli_ui_out::do_table_end): ... this new method. (cli_table_header): Replace with ... (cli_ui_out::do_table_header): ... this new method. (cli_begin): Replace with ... (cli_ui_out::do_begin): ... this new method. (cli_end): Replace with ... (cli_ui_out::do_end): ... this new method. (cli_field_int): Replace with ... (cli_ui_out::do_field_int): ... this new method. (cli_field_skip): Replace with ... (cli_ui_out::do_field_skip): ... this new method. (cli_field_string): Replace with ... (cli_ui_out::do_field_string): ... this new method. (cli_field_fmt): Replace with ... (cli_ui_out::do_field_fmt): ... this new method. (cli_spaces): Replace with ... (cli_ui_out::do_spaces): ... this new method. (cli_text): Replace with ... (cli_ui_out::do_text): ... this new method. (cli_message): Replace with ... (cli_ui_out::do_message): ... this new method. (cli_wrap_hint): Replace with ... (cli_ui_out::do_wrap_hint): ... this new method. (cli_flush): Replace with ... (cli_ui_out::do_flush): ... this new method. (cli_redirect): Replace with ... (cli_ui_out::do_redirect): ... this new method. (out_field_fmt): Replace with ... (cli_ui_out::out_field_fmt): ... this new method. (field_separator): Replace with ... (cli_ui_out::field_separator): ... this new method. (cli_out_set_stream): Replace with ... (cli_ui_out::set_stream): ... this new method. (cli_ui_out_impl): Remove. (cli_out_data_ctor): Remove. (cli_ui_out_impl::cli_ui_out_impl): New constructor. (cli_ui_out_impl::~cli_ui_out_impl): New destructor. (cli_out_new): Change return type to cli_ui_out *, instantiate a cli_ui_out. * cli-out.h (cli_ui_out_data): Remove, replace with class cli_ui_out. (class cli_ui_out): New class. (cli_ui_out_impl): Remove. (cli_out_data_ctor): Remove. (cli_out_new): Change return type to cli_ui_out*. (cli_out_set_stream): Remove. * cli/cli-interp.c (struct cli_interp) <cli_uiout>: Change type to cli_ui_out*. (cli_interpreter_resume): Adapt. (cli_interpreter_exec): Adapt. * mi/mi-out.c (mi_ui_out_data, mi_out_data): Remove. (mi_ui_out_impl): Remove. (mi_table_begin): Replace with ... (mi_ui_out::do_table_begin): ... this. (mi_table_body): Replace with ... (mi_ui_out::do_table_body): ... this. (mi_table_end): Replace with ... (mi_ui_out::do_table_end): ... this. (mi_table_header): Replace with ... (mi_ui_out::do_table_header): ... this. (mi_begin): Replace with ... (mi_ui_out::do_begin): ... this. (mi_end): Replace with ... (mi_ui_out::do_end): ... this. (mi_field_int): Replace with ... (mi_ui_out::do_field_int): ... this. (mi_field_skip): Replace with ... (mi_ui_out::do_field_skip): ... this. (mi_field_string): Replace with ... (mi_ui_out::do_field_string): ... this. (mi_field_fmt): Replace with ... (mi_ui_out::do_field_fmt): ... this. (mi_spaces): Replace with ... (mi_ui_out::do_spaces): ... this. (mi_text): Replace with ... (mi_ui_out::do_text): ... this. (mi_message): Replace with ... (mi_ui_out::do_message): ... this. (mi_wrap_hint): Replace with ... (mi_ui_out::do_wrap_hint): ... this. (mi_flush): Replace with ... (mi_ui_out::do_flush): ... this. (mi_redirect): Replace with ... (mi_ui_out::do_redirect): (field_separator): Replace with ... (mi_ui_out::field_separator): (mi_open): Replace with ... (mi_ui_out::open): ... this. (mi_close): Replace with ... (mi_ui_out::close): ... this. (mi_out_rewind): Replace with ... (mi_ui_out::rewind): ... this. (mi_out_put): Replace with ... (mi_ui_out::put): ... this. (mi_version): Replace with ... (mi_ui_out::version): ... this. (mi_out_data_ctor): Replace with ... (mi_ui_out::mi_ui_out): ... this. (mi_out_data_dtor): Replace with ... (mi_ui_out::~mi_ui_out): ... this. (mi_out_new): Change return type to mi_ui_out*, instantiate an mi_ui_out object. (as_mi_ui_out): New function. (mi_version): Update fallouts of struct ui_out to class ui_out transition. (mi_out_put): Likewise. (mi_out_rewind): Likewise. * mi/mi-out.h (mi_out_new): Change return type to mi_ui_out*. * tui/tui-out.c (tui_ui_out_data, tui_out_data, tui_ui_out_impl): Remove. (tui_field_int): Replace with ... (tui_ui_out::do_field_int): ... this. (tui_field_string): Replace with ... (tui_ui_out::do_field_string): ... this. (tui_field_fmt): Replace with ... (tui_ui_out::do_field_fmt): ... this. (tui_text): Replace with ... (tui_ui_out::do_text): ... this. (tui_out_new): Change return type to tui_ui_out*, instantiate tui_ui_out object. (tui_ui_out::tui_ui_out): New. * tui/tui-out.h: New file. * tui/tui.h (tui_out_new): Move declaration to tui/tui-out.h. * tui/tui-io.c: Include tui/tui-out.h. (tui_old_uiout): Change type to cli_ui_out*. (tui_setup_io): Use dynamic_cast. * tui/tui-io.h (tui_old_uiout): Change type to cli_ui_out*. * tui/tui-interp.c (tui_resume): Adapt. * ada-lang.c (print_it_exception): Update fallouts of struct ui_out to class ui_out transition. (print_one_exception): Likewise. (print_mention_exception): Likewise. * ada-tasks.c (print_ada_task_info): Likewise. (info_task): Likewise. (task_command): Likewise. * auto-load.c (print_script): Likewise. (auto_load_info_scripts): Likewise. (info_auto_load_cmd): Likewise. * break-catch-sig.c (signal_catchpoint_print_one): Likewise. * break-catch-syscall.c (print_it_catch_syscall): Likewise. (print_one_catch_syscall): Likewise. * break-catch-throw.c (print_it_exception_catchpoint): Likewise. (print_one_exception_catchpoint): Likewise. (print_one_detail_exception_catchpoint): Likewise. (print_mention_exception_catchpoint): Likewise. * breakpoint.c (maybe_print_thread_hit_breakpoint): Likewise. (print_solib_event): Likewise. (watchpoint_check): Likewise. (wrap_indent_at_field): Likewise. (print_breakpoint_location): Likewise. (output_thread_groups): Likewise. (print_one_breakpoint_location): Likewise. (breakpoint_1): Likewise. (default_collect_info): Likewise. (watchpoints_info): Likewise. (print_it_catch_fork): Likewise. (print_one_catch_fork): Likewise. (print_it_catch_vfork): Likewise. (print_one_catch_vfork): Likewise. (print_it_catch_solib): Likewise. (print_one_catch_solib): Likewise. (print_it_catch_exec): Likewise. (print_one_catch_exec): Likewise. (mention): Likewise. (print_it_ranged_breakpoint): Likewise. (print_one_ranged_breakpoint): Likewise. (print_one_detail_ranged_breakpoint): Likewise. (print_mention_ranged_breakpoint): Likewise. (print_it_watchpoint): Likewise. (print_mention_watchpoint): Likewise. (print_it_masked_watchpoint): Likewise. (print_one_detail_masked_watchpoint): Likewise. (print_mention_masked_watchpoint): Likewise. (bkpt_print_it): Likewise. (tracepoint_print_one_detail): Likewise. (tracepoint_print_mention): Likewise. (update_static_tracepoint): Likewise. (tracepoints_info): Likewise. (save_breakpoints): Likewise. * cli/cli-cmds.c (complete_command): Likewise. * cli/cli-logging.c (set_logging_redirect): Likewise. (pop_output_files): Likewise. (handle_redirections): Likewise. * cli/cli-script.c (print_command_lines): Likewise. * cli/cli-setshow.c (do_show_command): Likewise. (cmd_show_list): Likewise. * cp-abi.c (list_cp_abis): Likewise. (show_cp_abi_cmd): Likewise. * darwin-nat-info.c (darwin_debug_regions_recurse): Likewise. * disasm.c (gdb_pretty_print_insn): Likewise. (do_mixed_source_and_assembly_deprecated): Likewise. (do_mixed_source_and_assembly): Likewise. * gdb_bfd.c (print_one_bfd): Likewise. (maintenance_info_bfds): Likewise. * guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Likewise. * guile/scm-ports.c (ioscm_with_output_to_port_worker): Likewise. * i386-linux-tdep.c (i386_linux_handle_segmentation_fault): Likewise. * i386-tdep.c (i386_mpx_print_bounds): Likewise. * infcmd.c (run_command_1): Likewise. (print_return_value_1): Likewise. * inferior.c (print_selected_inferior): Likewise. (print_inferior): Likewise. * infrun.c (print_end_stepping_range_reason): Likewise. (print_signal_exited_reason): Likewise. (print_exited_reason): Likewise. (print_signal_received_reason): Likewise. (print_no_history_reason): Likewise. * interps.c (interp_set): Likewise. * linespec.c (decode_line_full): Likewise. * linux-thread-db.c (info_auto_load_libthread_db): Likewise. * mi/mi-cmd-env.c (mi_cmd_env_pwd): Likewise. (mi_cmd_env_path): Likewise. (mi_cmd_env_dir): Likewise. (mi_cmd_inferior_tty_show): Likewise. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Likewise. (print_partial_file_name): Likewise. (mi_cmd_file_list_exec_source_files): Likewise. * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions): Likewise. (mi_cmd_info_gdb_mi_command): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_info_depth): Likewise. (mi_cmd_stack_list_args): Likewise. (list_arg_or_local): Likewise. * mi/mi-cmd-var.c (print_varobj): Likewise. (mi_cmd_var_create): Likewise. (mi_cmd_var_delete): Likewise. (mi_cmd_var_set_format): Likewise. (mi_cmd_var_show_format): Likewise. (mi_cmd_var_info_num_children): Likewise. (mi_cmd_var_list_children): Likewise. (mi_cmd_var_info_type): Likewise. (mi_cmd_var_info_path_expression): Likewise. (mi_cmd_var_info_expression): Likewise. (mi_cmd_var_show_attributes): Likewise. (mi_cmd_var_evaluate_expression): Likewise. (mi_cmd_var_assign): Likewise. (varobj_update_one): Likewise. * mi/mi-interp.c (as_mi_interp): Likewise. (mi_on_normal_stop_1): Likewise. (mi_tsv_modified): Likewise. (mi_breakpoint_created): Likewise. (mi_breakpoint_modified): Likewise. (mi_solib_loaded): Likewise. (mi_solib_unloaded): Likewise. (mi_command_param_changed): Likewise. (mi_memory_changed): Likewise. (mi_user_selected_context_changed): Likewise. * mi/mi-main.c (print_one_inferior): Likewise. (output_cores): Likewise. (list_available_thread_groups): Likewise. (mi_cmd_data_list_register_names): Likewise. (mi_cmd_data_list_changed_registers): Likewise. (output_register): Likewise. (mi_cmd_data_evaluate_expression): Likewise. (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_list_features): Likewise. (mi_cmd_list_target_features): Likewise. (mi_cmd_add_inferior): Likewise. (mi_execute_command): Likewise. (mi_load_progress): Likewise. (print_variable_or_computed): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Likewise. * osdata.c (info_osdata_command): Likewise. * probe.c (gen_ui_out_table_header_info): Likewise. (print_ui_out_not_applicables): Likewise. (print_ui_out_info): Likewise. (info_probes_for_ops): Likewise. (enable_probes_command): Likewise. (disable_probes_command): Likewise. * progspace.c (print_program_space): Likewise. * python/py-breakpoint.c (bppy_get_commands): Likewise. * python/py-framefilter.c (py_print_type): Likewise. (py_print_value): Likewise. (py_print_single_arg): Likewise. (enumerate_args): Likewise. (enumerate_locals): Likewise. (py_print_args): Likewise. (py_print_frame): Likewise. * record-btrace.c (btrace_ui_out_decode_error): Likewise. (btrace_call_history_insn_range): Likewise. (btrace_call_history_src_line): Likewise. (btrace_call_history): Likewise. * remote.c (show_remote_cmd): Likewise. * skip.c (skip_info): Likewise. * solib.c (info_sharedlibrary_command): Likewise. * source.c (print_source_lines_base): Likewise. * spu-tdep.c (info_spu_event_command): Likewise. (info_spu_signal_command): Likewise. (info_spu_mailbox_list): Likewise. (info_spu_dma_cmdlist): Likewise. (info_spu_dma_command): Likewise. (info_spu_proxydma_command): Likewise. * stack.c (print_stack_frame): Likewise. (print_frame_arg): Likewise. (read_frame_arg): Likewise. (print_frame_args): Likewise. (print_frame_info): Likewise. (print_frame): Likewise. * symfile.c (load_progress): Likewise. (generic_load): Likewise. (print_transfer_performance): Likewise. * thread.c (do_captured_list_thread_ids): Likewise. (print_thread_info_1): Likewise. (restore_selected_frame): Likewise. (do_captured_thread_select): Likewise. (print_selected_thread_frame): Likewise. * top.c (execute_command_to_string): Likewise. * tracepoint.c (tvariables_info_1): Likewise. (trace_status_mi): Likewise. (tfind_1): Likewise. (print_one_static_tracepoint_marker): Likewise. (info_static_tracepoint_markers_command): Likewise. * utils.c (do_ui_out_redirect_pop): Likewise. (fputs_maybe_filtered): Likewise.
2016-04-19Add target descriptions for AVX + MPXWalfred Tedeschi
The current MPX target descriptions assume that MPX is always combined with AVX, however that's not correct. We can have machines with MPX and without AVX; or machines with AVX and without MPX. This patch adds new target descriptions for machines that support both MPX and AVX, as duplicates of the existing MPX descriptions. The following commit will remove AVX from the MPX-only descriptions. 2016-04-16 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-linux.c): New include. (amd64_linux_core_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_mpx_linux. * amd64-linux-tdep.h (tdesc_amd64_avx_mpx_linux): New definition. * amd64-tdep.c (features/i386/amd64-avx-mpx.c): New include. (amd64_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. (_initialize_amd64_tdep): Call initialize_tdesc_amd64_avx_mpx. * common/x86-xstate.h (X86_XSTATE_MPX_MASK): Remove AVX bits. (X86_XSTATE_AVX_MPX_MASK): New case. * features/Makefile (i386/i386-avx-mpx, i386/i386-avx-mpx-linux) (i386/amd64-avx-mpx, i386/amd64-avx-mpx-linux): New rules. (i386/i386-avx-mpx-expedite, i386/i386-avx-mpx-linux-expedite) (i386/amd64-avx-mpx-expedite, i386/amd64-avx-mpx-linux-expedite): New expedites. * i386-linux-tdep.c (features/i386/i386-avx-mpx-linux.c): New include. (i386_linux_core_read_description): Add case X86_XSTATE_AVX_MPX_MASK. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_avx_mpx_linux. * i386-linux-tdep.h (tdesc_i386_avx_mpx_linux): New include. * i386-tdep.c (features/i386/i386-avx-mpx.c): New include. (i386_target_description): Add case for X86_XSTATE_AVX_MPX_MASK. * x86-linux-nat.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. * features/i386/amd64-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx-linux.xml: New file. * features/i386/i386-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx.xml: New file. * features/i386/amd64-avx-mpx-linux.c: Generated. * features/i386/amd64-avx-mpx.c: Generated. * features/i386/i386-avx-mpx-linux.c: Generated. * features/i386/i386-avx-mpx.c: Generated. * regformats/i386/amd64-avx-mpx-linux.dat: Generated. * regformats/i386/amd64-avx-mpx.dat: Generated. * regformats/i386/i386-avx-mpx-linux.dat: Generated. * regformats/i386/i386-avx-mpx.dat: Generated. gdb/gdbserver/ChangeLog: * Makefile.in (clean): Add removal for i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c. (i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c) (amd64-avx-mpx-linux.c): New rules. (amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule. * configure.srv (srv_i386_regobj): Add i386-avx-mpx.o. (srv_i386_linux_regobj): Add i386-avx-mpx-linux.o. (srv_amd64_regobj): Add amd64-avx-mpx.o. (srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o. (srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml. (ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o. (ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o. * linux-x86-low.c (x86_linux_read_description): Add case for X86_XSTATE_AVX_MPX_MASK. (x86_get_ipa_tdesc_idx): Add cases for avx_mpx. (initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and init_registers_i386_avx_mpx_linux. * linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_i386_avx_mpx_linux. * linux-amd64-ipa.c (get_ipa_tdesc): Add case for avx_mpx. (initialize_low_tracepoint): Call init_registers_amd64_avx_mpx_linux. * linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value. (init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux) (init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New declarations.
2016-02-25Initialize variables in i386_linux_handle_segmentation_faultSimon Marchi
We see this error when building with gcc 4.3. ../../gdb/i386-linux-tdep.c: In function ‘i386_linux_handle_segmentation_fault’: ../../gdb/i386-linux-tdep.c:399: error: ‘access’ may be used uninitialized in this function ../../gdb/i386-linux-tdep.c:399: error: ‘upper_bound’ may be used uninitialized in this function ../../gdb/i386-linux-tdep.c:399: error: ‘lower_bound’ may be used uninitialized in this function It's a false positive, since the variables will always get initialized in the TRY clause, and the CATCH returns. gdb/ChangeLog: * i386-linux-tdep.c (i386_linux_handle_segmentation_fault): Initialize variables.
2016-02-18Intel MPX bound violation handlingWalfred Tedeschi
With Intel Memory Protection Extensions it was introduced the concept of boundary violation. A boundary violations is presented to the inferior as a segmentation fault having SIGCODE 3. This patch adds a handler for a boundary violation extending the information displayed when a bound violation is presented to the inferior. In the stop mode case the debugger will also display the kind of violation: "upper" or "lower", bounds and the address accessed. On no stop mode the information will still remain unchanged. Additional information about bound violations are not meaningful in that case user does not know the line in which violation occurred as well. When the segmentation fault handler is stop mode the out puts will be changed as exemplified below. The usual output of a segfault is: Program received signal SIGSEGV, Segmentation fault 0x0000000000400d7c in upper (p=0x603010, a=0x603030, b=0x603050, c=0x603070, d=0x603090, len=7) at i386-mpx-sigsegv.c:68 68 value = *(p + len); In case it is a bound violation it will be presented as: Program received signal SIGSEGV, Segmentation fault Upper bound violation while accessing address 0x7fffffffc3b3 Bounds: [lower = 0x7fffffffc390, upper = 0x7fffffffc3a3] 0x0000000000400d7c in upper (p=0x603010, a=0x603030, b=0x603050, c=0x603070, d=0x603090, len=7) at i386-mpx-sigsegv.c:68 68 value = *(p + len); In mi mode the output of a segfault is: *stopped,reason="signal-received",signal-name="SIGSEGV", signal-meaning="Segmentation fault", frame={addr="0x0000000000400d7c", func="upper",args=[{name="p", value="0x603010"},{name="a",value="0x603030"} ,{name="b",value="0x603050"}, {name="c",value="0x603070"}, {name="d",value="0x603090"},{name="len",value="7"}], file="i386-mpx-sigsegv.c",fullname="i386-mpx-sigsegv.c",line="68"}, thread-id="1",stopped-threads="all",core="6" in the case of a bound violation: *stopped,reason="signal-received",signal-name="SIGSEGV", signal-meaning="Segmentation fault", sigcode-meaning="Upper bound violation", lower-bound="0x603010",upper-bound="0x603023",bound-access="0x60302f", frame={addr="0x0000000000400d7c",func="upper",args=[{name="p", value="0x603010"},{name="a",value="0x603030"},{name="b",value="0x603050"}, {name="c",value="0x603070"},{name="d",value="0x603090"}, {name="len",value="7"}],file="i386-mpx-sigsegv.c", fullname="i386-mpx-sigsegv.c",line="68"},thread-id="1", stopped-threads="all",core="6" 2016-02-18 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * NEWS: Add entry for bound violation. * amd64-linux-tdep.c (amd64_linux_init_abi_common): Add handler for segmentation fault. * gdbarch.sh (handle_segmentation_fault): New. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-linux-tdep.c (i386_linux_handle_segmentation_fault): New. (SIG_CODE_BONDARY_FAULT): New define. (i386_linux_init_abi): Use i386_mpx_bound_violation_handler. * i386-linux-tdep.h (i386_linux_handle_segmentation_fault) New. * i386-tdep.c (i386_mpx_enabled): Add as external. * i386-tdep.c (i386_mpx_enabled): Add as external. * infrun.c (handle_segmentation_fault): New function. (print_signal_received_reason): Use handle_segmentation_fault. gdb/testsuite/ChangeLog: * gdb.arch/i386-mpx-sigsegv.c: New file. * gdb.arch/i386-mpx-sigsegv.exp: New file. * gdb.arch/i386-mpx-simple_segv.c: New file. * gdb.arch/i386-mpx-simple_segv.exp: New file. gdb/doc/ChangeLog: * gdb.texinfo (Signals): Add bound violation display hints for a SIGSEGV.
2016-02-02Use linux_get_siginfo_type_with_fields for x86Walfred Tedeschi
Use linux_get_siginfo_type_with_fields for adding bound fields on segmentation fault for i386/amd64 siginfo. 2016-02-02 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * linux-tdep.h (linux_get_siginfo_type_with_fields): Make extern. * linux-tdep.c (linux_get_siginfo_type_with_fields): Make extern. * i386-linux-tdep.h (x86_linux_get_siginfo_type): New function. * amd64-linux-tdep.c (amd64_linux_init_abi_common): Add x86_linux_get_siginfo_type for the amd64 abi. * i386-linux-tdep.c (x86_linux_get_siginfo_type): New function. (i386_linux_init_abi): Add new function at the i386 ABI initialization.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-10-30gdb/linux-record: Support time, waitpid, pipe syscallsMarcin Kościelnicki
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-30gdb/linux-record: Fix readdir and getdents handlingMarcin Kościelnicki
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-30gdb/linux-record: Fix sizes of sigaction and sigset_tMarcin Kościelnicki
The values were mistakenly set to size of glibc's sigset_t (128 bytes) and sigaction (140 or 152 bytes) instead of the kernel ones. The kernel has 4 or 8 byte old_sigset_t, 8 byte sigset_t, 16 or 32 byte old_sigaction, 20 or 32 byte sigaction. gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_linux_init_abi): Fix size_sigaction, size_sigset_t, size_old_sigaction, size_old_sigset_t. * amd64-linux-tdep.c (amd64_linux_init_abi): Fix size_sigaction, size_sigset_t, size_old_sigaction, size_old_sigset_t. (amd64_x32_linux_init_abi): Fix size_sigaction, size_sigset_t, size_old_sigaction, size_old_sigset_t. * arm-linux-tdep.c (arm_linux_init_abi): Fix size_sigaction, size_old_sigaction, size_old_sigset_t. * i386-linux-tdep.c (i386_linux_init_abi): Fix size_sigaction, size_old_sigaction, size_old_sigset_t. * ppc-linux-tdep.c (ppc_init_linux_record_tdep): Fix size_sigaction, size_sigset_t, size_old_sigaction, size_old_sigset_t.
2015-10-30gdb/linux-record: Fix size_[ug]id valuesMarcin Kościelnicki
i386 and arm wrongly set them to 2, when it should be 4. size_[ug]id is used by getgroups32 etc syscalls, while size_old_[ug]id is used for getgroups16 and friends. gdb/ChangeLog: * arm-linux-tdep.c (arm_linux_init_abi): Fix size_[ug]id. * i386-linux-tdep.c (i386_linux_init_abi): Fix size_[ug]id.
2015-10-30gdb/linux-record: Remove size_siginfoMarcin Kościelnicki
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-09-25Add some more casts (1/2)Simon Marchi
Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-08-06Add casts for legitimate integer to enum conversionsSimon Marchi
This patch is mostly extracted from Pedro's C++ branch. It adds explicit casts from integer to enum types, where it is really the intention to do so. This could be because we are ... * iterating on enum values (we need to iterate on an equivalent integer) * converting from a value read from bytes (dwarf attribute, agent expression opcode) to the equivalent enum * reading the equivalent integer value from another language (Python/Guile) An exception to that is the casts in regcache.c. It seems to me like struct regcache's register_status field could be a pointer to an array of enum register_status. Doing so would waste a bit of memory (4 bytes used by the enum vs 1 byte used by the current signed char, for each register). If we switch to C++11 one day, we can define the underlying type of an enum type, so we could have the best of both worlds. gdb/ChangeLog: * arm-tdep.c (set_fp_model_sfunc): Add cast from integer to enum. (arm_set_abi): Likewise. * ax-general.c (ax_print): Likewise. * c-exp.y (exp : string_exp): Likewise. * compile/compile-loc2c.c (compute_stack_depth_worker): Likewise. (do_compile_dwarf_expr_to_c): Likewise. * cp-name-parser.y (demangler_special : DEMANGLER_SPECIAL start): Likewise. * dwarf2expr.c (execute_stack_op): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. (disassemble_dwarf_expression): Likewise. * dwarf2read.c (dwarf2_add_member_fn): Likewise. (read_array_order): Likewise. (abbrev_table_read_table): Likewise. (read_attribute_value): Likewise. (skip_unknown_opcode): Likewise. (dwarf_decode_macro_bytes): Likewise. (dwarf_decode_macros): Likewise. * eval.c (value_f90_subarray): Likewise. * guile/scm-param.c (gdbscm_make_parameter): Likewise. * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise. * infrun.c (handle_command): Likewise. * memory-map.c (memory_map_start_memory): Likewise. * osabi.c (set_osabi): Likewise. * parse.c (operator_length_standard): Likewise. * ppc-linux-tdep.c (ppc_canonicalize_syscall): Likewise, and use single return point. * python/py-frame.c (gdbpy_frame_stop_reason_string): Likewise. * python/py-symbol.c (gdbpy_lookup_symbol): Likewise. (gdbpy_lookup_global_symbol): Likewise. * record-full.c (record_full_restore): Likewise. * regcache.c (regcache_register_status): Likewise. (regcache_raw_read): Likewise. (regcache_cooked_read): Likewise. * rs6000-tdep.c (powerpc_set_vector_abi): Likewise. * symtab.c (initialize_ordinary_address_classes): Likewise. * target-debug.h (target_debug_print_signals): Likewise. * utils.c (do_restore_current_language): Likewise.
2015-07-31Mostly trivial enum fixesSimon Marchi
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-06-24Call set_gdbarch_get_siginfo_type in linux_init_abiYao Qi
linux_get_siginfo_type is installed to many linux gdbarch. This patch is to move this to a common area linux-tdep.c:linux_init_abi, so that linux_get_siginfo_type is installed to every linux gdbarch. If some linux gdbarch needs its own version, please override it in $ARCH_linux_init_abi. In the testsuite, we enable siginfo related tests for all linux targets. gdb: 2015-06-24 Yao Qi <yao.qi@linaro.org> * aarch64-linux-tdep.c (aarch64_linux_init_abi): Don't call set_gdbarch_get_siginfo_type. * amd64-linux-tdep.c (amd64_linux_init_abi_common): Likewise. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * m68klinux-tdep.c (m68k_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * tilegx-linux-tdep.c (tilegx_linux_init_abi): Likewise. * linux-tdep.c (linux_get_siginfo_type): Change it to static. (linux_init_abi): Call set_gdbarch_get_siginfo_type. * linux-tdep.h (linux_get_siginfo_type): Remove the declaration. gdb/testsuite: 2015-06-24 Yao Qi <yao.qi@linaro.org> * lib/gdb.exp (supports_get_siginfo_type): Return 1 for all linux targets.
2015-06-24Remove redundant include directives.Gary Benson
stdint.h was added to common-defs.h some months ago and should no longer be included directly by any file. gdb_assert.h was added to common-defs.h nearly a year ago, but three includes have crept in since then. This commit removes all such redundant include directives. gdb/ChangeLog: * common/buffer.c (stdint.h): Do not include. * common/print-utils.c (stdint.h): Likewise. * compile/compile-c-symbols.c (gdb_assert.h): Likewise. * compile/compile-c-types.c (gdb_assert.h): Likewise. * ft32-tdep.c (gdb_assert.h): Likewise. * guile/scm-utils.c (stdint.h): Likewise. * i386-linux-tdep.c (stdint.h): Likewise. * i386-tdep.c (stdint.h): Likewise. * nat/linux-btrace.c (stdint.h): Likewise. * nat/linux-btrace.h (stdint.h): Likewise. * nat/linux-ptrace.c (stdint.h): Likewise. * nat/mips-linux-watch.h (stdint.h): Likewise. * ppc-linux-nat.c (stdint.h): Likewise. * python/python-internal.h (stdint.h): Likewise. * stub-termcap.c (stdlib.h): Likewise. * target/target.h (stdint.h): Likewise. * xtensa-linux-nat.c (stdint.h): Likewise. gdb/gdbserver/ChangeLog: * linux-i386-ipa.c (stdint.h): Do not include. * lynx-i386-low.c (stdint.h): Likewise. * lynx-ppc-low.c (stdint.h): Likewise. * mem-break.c (stdint.h): Likewise. * thread-db.c (stdint.h): Likewise. * tracepoint.c (stdint.h): Likewise. * win32-low.c (stdint.h): Likewise.
2015-04-10PR13858 - Can't do displaced stepping with no symbolsPedro Alves
Running break-interp.exp with the target always in non-stop mode trips on PR13858, as enabling non-stop also enables displaced stepping. The problem is that when GDB doesn't know where the entry point is, it doesn't know where to put the displaced stepping scratch pad. The test added by this commit exercises this. Without the fix, we get: (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: break *$pc set displaced-stepping on (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: set displaced-stepping on stepi 0x00000000004005be in ?? () Entry point address is not known. (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: stepi p /x $pc $2 = 0x4005be (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: get after PC FAIL: gdb.base/step-over-no-symbols.exp: displaced=on: advanced The fix switches all GNU/Linux ports to get the entry point from AT_ENTRY in the target auxiliary vector instead of from symbols. This is currently only done by PPC when Cell debugging is enabled, but I think all archs should be able to do the same. Note that ppc_linux_displaced_step_location cached the result, I'm guessing to avoid constantly re-fetching the auxv out of remote targets, but that's no longer necessary nowadays, as the auxv blob is itself cached in the inferior object. The ppc_linux_entry_point_addr global is obviously bad for multi-process too nowadays. Tested on x86-64 (-m64/-m32), PPC64 (-m64/-m32) and S/390 GNU/Linux. Yao tested the new test on ARM as well. gdb/ChangeLog: 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/13858 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Install linux_displaced_step_location as gdbarch_displaced_step_location hook. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * linux-tdep.c (linux_displaced_step_location): New function, based on ppc_linux_displaced_step_location. * linux-tdep.h (linux_displaced_step_location): New declaration. * ppc-linux-tdep.c (ppc_linux_entry_point_addr): Delete. (ppc_linux_inferior_created, ppc_linux_displaced_step_location): Delete. (ppc_linux_init_abi): Install linux_displaced_step_location as gdbarch_displaced_step_location hook, even without Cell/B.E.. (_initialize_ppc_linux_tdep): Don't install ppc_linux_inferior_created as inferior_created observer. * s390-linux-tdep.c (s390_gdbarch_init): Install linux_displaced_step_location as gdbarch_displaced_step_location hook. gdb/testsuite/ 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/13858 * gdb.base/step-over-no-symbols.exp: New file.
2015-02-04x86: Use correct .reg-xstate section sizeAndreas Arnez
When reading the XSAVE extended state from an i386 or AMD64 core file, the respective regset iterator requests a minimum section size of zero. Since the respective regset supply function does not check the size either, this may lead to accessing data out of range if the section is too short. In write mode, the iterator always uses the maximum supported size for the XSAVE extended state. This is now changed such that the iterator always requests the expected size of this section based on xcr0, both for reading and writing. gdb/ChangeLog: * amd64-linux-tdep.c (amd64_linux_iterate_over_regset_sections): For ".reg-xstate", explicitly specify the requested section size via X86_XSTATE_SIZE instead of just 0 on input and X86_XSTATE_MAX_SIZE on output. * i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-11-20Partial fix for PR breakpoints/10737: Make syscall info be per-arch instead ↵Sergio Durigan Junior
of global This patch intends to partially fix PR breakpoints/10737, which is about making the syscall information (for the "catch syscall" command) be per-arch, instead of global. This is not a full fix because of the other issues pointed by Pedro here: <https://sourceware.org/bugzilla/show_bug.cgi?id=10737#c5> However, I consider it a good step towards the real fix. It will also help me fix <https://sourceware.org/bugzilla/show_bug.cgi?id=17402>. What this patch does, basically, is move the "syscalls_info" struct to gdbarch. Currently, the syscall information is stored in a global variable inside gdb/xml-syscall.c, which means that there is no easy way to correlate this info with the current target or architecture being used, for example. This causes strange behaviors, because the syscall info is not re-read when the arch changes. For example, if you put a syscall catchpoint in syscall 5 on i386 (syscall open), and then load a x86_64 program on GDB and put the same syscall 5 there (fstat on x86_64), you will still see that GDB tells you that it is catching "open", even though it is not. With this patch, GDB correctly says that it will be catching fstat syscalls. (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'open' [5]) But with the patch: (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'fstat' [5]) As I said, there are still some problems on the "catch syscall" mechanism, because (for example) the user should be able to "catch syscall open" on i386, and then expect "open" to be caught also on x86_64. Currently, it doesn't work. I intend to work on this later. gdb/ 2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/10737 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Adjust call to set_xml_syscall_file_name to provide gdbarch. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * bfin-linux-tdep.c (bfin_linux_init_abi): Likewise. * breakpoint.c (print_it_catch_syscall): Adjust call to get_syscall_by_number to provide gdbarch. (print_one_catch_syscall): Likewise. (print_mention_catch_syscall): Likewise. (print_recreate_catch_syscall): Likewise. (catch_syscall_split_args): Adjust calls to get_syscall_by_number and get_syscall_by_name to provide gdbarch. (catch_syscall_completer): Adjust call to get_syscall_names to provide gdbarch. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * gdbarch.sh: Forward declare "struct syscalls_info". (xml_syscall_file): New variable. (syscalls_info): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Adjust call to set_xml_syscall_file_name to provide gdbarch. * mips-linux-tdep.c (mips_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise. * sparc64-linux-tdep.c (sparc64_linux_init_abi): Likewise. * xml-syscall.c: Include gdbarch.h. (set_xml_syscall_file_name): Accept gdbarch parameter. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. (my_gdb_datadir): Delete global variable. (struct syscalls_info) <my_gdb_datadir>: New variable. (struct syscalls_info) <sysinfo>: Rename variable to "syscalls_info". (sysinfo): Delete global variable. (have_initialized_sysinfo): Likewise. (xml_syscall_file): Likewise. (sysinfo_free_syscalls_desc): Rename to... (syscalls_info_free_syscalls_desc): ... this. (free_syscalls_info): Rename "sysinfo" to "syscalls_info". Adjust code to the new layout of "struct syscalls_info". (make_cleanup_free_syscalls_info): Rename parameter "sysinfo" to "syscalls_info". (syscall_create_syscall_desc): Likewise. (syscall_start_syscall): Likewise. (syscall_parse_xml): Likewise. (xml_init_syscalls_info): Likewise. Drop "const" from return value. (init_sysinfo): Rename to... (init_syscalls_info): ...this. Add gdbarch as a parameter. Adjust function to deal with gdbarch. (xml_get_syscall_number): Delete parameter sysinfo. Accept gdbarch as a parameter. Adjust code. (xml_get_syscall_name): Likewise. (xml_list_of_syscalls): Likewise. (set_xml_syscall_file_name): Accept gdbarch as parameter. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. * xml-syscall.h (set_xml_syscall_file_name): Likewise. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. gdb/testsuite/ 2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/10737 * gdb.base/catch-syscall.exp (do_syscall_tests): Call test_catch_syscall_multi_arch. (test_catch_syscall_multi_arch): New function.
2014-09-30Add 'regset' parameter to 'iterate_over_regset_sections_cb'Andreas Arnez
This adds the 'regset' parameter to the iterator callback. Consequently the 'regset_from_core_section' method is dropped for all targets that provide the iterator method. This change prepares for replacing regset_from_core_section everywhere, thereby eliminating one gdbarch interface. Since the iterator is usually no more complex than regset_from_core_section alone, targets that previously didn't define core_regset_sections will then gain multi-arch capable core file generation support without increased complexity. gdb/ChangeLog: * gdbarch.sh (iterate_over_regset_sections_cb): Add regset parameter. * gdbarch.h: Regenerate. * corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset iterator. (get_core_register_section): Add parameter 'regset' and use it, if set. Add parameter 'min_size' and verify the bfd section size against it. (get_core_registers_cb): Add parameter 'regset' and pass it to get_core_register section. For the "standard" register sections ".reg" and ".reg2", set an appropriate default for human_name. (get_core_registers): Don't abort when the gdbarch has an iterator but no regset_from_core_section. Add NULL/0 for parameters 'regset'/'min_size' in calls to get_core_register_section. * linux-tdep.c (linux_collect_regset_section_cb): Add parameter 'regset' and use it instead of calling the regset_from_core_section gdbarch method. * i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'. * i386-tdep.c (i386_supply_xstateregset) (i386_collect_xstateregset, i386_xstateregset): Moved to i386-linux-tdep.c. (i386_regset_from_core_section): Drop handling for .reg-xfp and .reg-xstate. (i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic core file support only if the regset iterator hasn't been set. * i386-linux-tdep.c (i386_linux_supply_xstateregset) (i386_linux_collect_xstateregset, i386_linux_xstateregset): New. Moved from i386-tdep.c and renamed to *_linux*. (i386_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * amd64-tdep.c (amd64_supply_xstateregset) (amd64_collect_xstateregset, amd64_xstateregset): Moved to amd64-linux-tdep.c. (amd64_regset_from_core_section): Remove. (amd64_init_abi): Set new tdep field 'fpregset'. No longer install an amd64-specific regset_from_core_section gdbarch method. * amd64-linux-tdep.c (amd64_linux_supply_xstateregset) (amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New. Moved from amd64-tdep.c and renamed to *_linux*. (amd64_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove. (arm_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (arm_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove. (ppc_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (ppc_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields gregset, sizeof_gregset, fpregset, and sizeof_fpregset. (s390_regset_from_core_section): Remove. (s390_iterate_over_regset_sections): Add regset parameter to each callback invocation. (s390_gdbarch_init): No longer set the regset_from_core_section gdbarch method. Drop initialization of deleted tdep fields.
2014-09-30Replace 'core_regset_sections' by iterator methodAndreas Arnez
The core_regset_sections list in gdbarch (needed for multi-arch capable core file generation support) is replaced by an iterator method. Overall, this reduces the code a bit, and it allows for more flexibility. gdb/ChangeLog: * amd64-linux-tdep.c (amd64_linux_regset_sections): Remove. (amd64_linux_iterate_over_regset_sections): New. (amd64_linux_init_abi_common): Don't install the regset section list, but the new iterator in gdbarch. * arm-linux-tdep.c (arm_linux_fpa_regset_sections) (arm_linux_vfp_regset_sections): Remove. Move combined logic... (arm_linux_iterate_over_regset_sections): ...here. New function. (arm_linux_init_abi): Set iterator instead of section list. * corelow.c (get_core_registers_cb): New function, logic moved from... (get_core_registers): ...loop body here. Use new iterator method instead of walking through the regset section list. * gdbarch.sh: Remove 'core_regset_sections'. New method 'iterate_over_regset_sections'. New typedef 'iterate_over_regset_sections_cb'. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * i386-linux-tdep.c (i386_linux_regset_sections) (i386_linux_sse_regset_sections, i386_linux_avx_regset_sections): Remove. (i386_linux_iterate_over_regset_sections): New. (i386_linux_init_abi): Don't choose a regset section list, but install new iterator in gdbarch. * linux-tdep.c (struct linux_collect_regset_section_cb_data): New. (linux_collect_regset_section_cb): New function, logic moved from... (linux_collect_thread_registers): ...loop body here. Use iterator method instead of walking through list. (linux_make_corefile_notes_1): Check for presence of iterator method instead of regset section list. * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections) (ppc_linux_vmx_regset_sections, ppc_linux_fp_regset_sections) (ppc64_linux_vsx_regset_sections, ppc64_linux_vmx_regset_sections) (ppc64_linux_fp_regset_sections): Remove. Move combined logic... (ppc_linux_iterate_over_regset_sections): ...here. New function. (ppc_linux_init_abi): Don't choose from above regset section lists, but install new iterator in gdbarch. * regset.h (struct core_regset_section): Remove. * s390-linux-tdep.c (struct gdbarch_tdep): Add new fields have_linux_v1, have_linux_v2, and have_tdb. (s390_linux32_regset_sections, s390_linux32v1_regset_sections) (s390_linux32v2_regset_sections, s390_linux64_regset_sections) (s390_linux64v1_regset_sections, s390_linux64v2_regset_sections) (s390x_linux64_regset_sections, s390x_linux64v1_regset_sections) (s390x_linux64v2_regset_sections): Remove. Move combined logic... (s390_iterate_over_regset_sections): ...here. New function. Use new tdep fields. (s390_gdbarch_init): Set new tdep fields. Don't choose from above regset section lists, but install new iterator.
2014-09-02Rename 32- and 64-bit Intel files from "i386" to "x86"Gary Benson
This commit renames nine files that contain code used by both 32- and 64-bit Intel ports such that their names are prefixed with "x86" rather than "i386". All types, functions and variables within these files are likewise renamed such that their names are prefixed with "x86" rather than "i386". This makes GDB follow the convention used by gdbserver such that 32-bit Intel code lives in files called "i386-*", 64-bit Intel code lives in files called "amd64-*", and code for both 32- and 64-bit Intel lives in files called "x86-*". This commit only renames OS-independent files. The Linux ports of both GDB and gdbserver now follow the i386/amd64/x86 convention fully. Some ports still use the old convention where "i386" in file/function/ type/variable names can mean "32-bit only" or "32- and 64-bit" but I don't want to touch ports I can't fully test except where absolutely necessary. gdb/ChangeLog: * i386-nat.h: Renamed as... * x86-nat.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * i386-nat.c: Renamed as... * x86-nat.c: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * common/i386-xstate.h: Renamed as... * common/x86-xstate.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-cpuid.h: Renamed as... * nat/x86-cpuid.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-gcc-cpuid.h: Renamed as... * nat/x86-gcc-cpuid.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-dregs.h: Renamed as... * nat/x86-dregs.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * nat/i386-dregs.c: Renamed as... * nat/x86-dregs.c: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. gdb/gdbserver/ChangeLog: * i386-low.h: Renamed as... * x86-low.h: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated. * i386-low.c: Renamed as... * x86-low.c: New file. All type, function and variable name prefixes changed from "i386_" to "x86_". All references updated.
2014-08-07Include string.h in common-defs.hGary Benson
This commit includes string.h in common-defs.h and removes all other inclusions. gdb/ 2014-08-07 Gary Benson <gbenson@redhat.com> * common/common-defs.h: Include string.h. * aarch64-tdep.c: Do not include string.h. * ada-exp.y: Likewise. * ada-lang.c: Likewise. * ada-lex.l: Likewise. * ada-typeprint.c: Likewise. * ada-valprint.c: Likewise. * aix-thread.c: Likewise. * alpha-linux-tdep.c: Likewise. * alpha-mdebug-tdep.c: Likewise. * alpha-nat.c: Likewise. * alpha-osf1-tdep.c: Likewise. * alpha-tdep.c: Likewise. * alphanbsd-tdep.c: Likewise. * amd64-dicos-tdep.c: Likewise. * amd64-linux-tdep.c: Likewise. * amd64-nat.c: Likewise. * amd64-sol2-tdep.c: Likewise. * amd64fbsd-tdep.c: Likewise. * amd64obsd-tdep.c: Likewise. * arch-utils.c: Likewise. * arm-linux-nat.c: Likewise. * arm-linux-tdep.c: Likewise. * arm-tdep.c: Likewise. * arm-wince-tdep.c: Likewise. * armbsd-tdep.c: Likewise. * armnbsd-nat.c: Likewise. * armnbsd-tdep.c: Likewise. * armobsd-tdep.c: Likewise. * avr-tdep.c: Likewise. * ax-gdb.c: Likewise. * ax-general.c: Likewise. * bcache.c: Likewise. * bfin-tdep.c: Likewise. * breakpoint.c: Likewise. * build-id.c: Likewise. * buildsym.c: Likewise. * c-exp.y: Likewise. * c-lang.c: Likewise. * c-typeprint.c: Likewise. * c-valprint.c: Likewise. * charset.c: Likewise. * cli-out.c: Likewise. * cli/cli-cmds.c: Likewise. * cli/cli-decode.c: Likewise. * cli/cli-dump.c: Likewise. * cli/cli-interp.c: Likewise. * cli/cli-logging.c: Likewise. * cli/cli-script.c: Likewise. * cli/cli-setshow.c: Likewise. * cli/cli-utils.c: Likewise. * coffread.c: Likewise. * common/agent.c: Likewise. * common/buffer.c: Likewise. * common/buffer.h: Likewise. * common/common-utils.c: Likewise. * common/filestuff.c: Likewise. * common/filestuff.c: Likewise. * common/format.c: Likewise. * common/print-utils.c: Likewise. * common/rsp-low.c: Likewise. * common/signals.c: Likewise. * common/vec.h: Likewise. * common/xml-utils.c: Likewise. * core-regset.c: Likewise. * corefile.c: Likewise. * corelow.c: Likewise. * cp-abi.c: Likewise. * cp-name-parser.y: Likewise. * cp-support.c: Likewise. * cp-valprint.c: Likewise. * cris-tdep.c: Likewise. * d-exp.y: Likewise. * darwin-nat.c: Likewise. * dbxread.c: Likewise. * dcache.c: Likewise. * demangle.c: Likewise. * dicos-tdep.c: Likewise. * disasm.c: Likewise. * doublest.c: Likewise. * dsrec.c: Likewise. * dummy-frame.c: Likewise. * dwarf2-frame.c: Likewise. * dwarf2loc.c: Likewise. * dwarf2read.c: Likewise. * elfread.c: Likewise. * environ.c: Likewise. * eval.c: Likewise. * event-loop.c: Likewise. * exceptions.c: Likewise. * exec.c: Likewise. * expprint.c: Likewise. * f-exp.y: Likewise. * f-lang.c: Likewise. * f-typeprint.c: Likewise. * f-valprint.c: Likewise. * fbsd-nat.c: Likewise. * findcmd.c: Likewise. * findvar.c: Likewise. * fork-child.c: Likewise. * frame.c: Likewise. * frv-linux-tdep.c: Likewise. * frv-tdep.c: Likewise. * gdb.c: Likewise. * gdb_bfd.c: Likewise. * gdbarch.c: Likewise. * gdbarch.sh: Likewise. * gdbtypes.c: Likewise. * gnu-nat.c: Likewise. * gnu-v2-abi.c: Likewise. * gnu-v3-abi.c: Likewise. * go-exp.y: Likewise. * go-lang.c: Likewise. * go32-nat.c: Likewise. * guile/guile.c: Likewise. * guile/scm-auto-load.c: Likewise. * hppa-hpux-tdep.c: Likewise. * hppa-linux-nat.c: Likewise. * hppanbsd-tdep.c: Likewise. * hppaobsd-tdep.c: Likewise. * i386-cygwin-tdep.c: Likewise. * i386-dicos-tdep.c: Likewise. * i386-linux-tdep.c: Likewise. * i386-nto-tdep.c: Likewise. * i386-sol2-tdep.c: Likewise. * i386-tdep.c: Likewise. * i386bsd-tdep.c: Likewise. * i386gnu-nat.c: Likewise. * i386nbsd-tdep.c: Likewise. * i386obsd-tdep.c: Likewise. * i387-tdep.c: Likewise. * ia64-libunwind-tdep.c: Likewise. * ia64-linux-nat.c: Likewise. * inf-child.c: Likewise. * inf-ptrace.c: Likewise. * inf-ttrace.c: Likewise. * infcall.c: Likewise. * infcmd.c: Likewise. * inflow.c: Likewise. * infrun.c: Likewise. * interps.c: Likewise. * iq2000-tdep.c: Likewise. * irix5-nat.c: Likewise. * jv-exp.y: Likewise. * jv-lang.c: Likewise. * jv-typeprint.c: Likewise. * jv-valprint.c: Likewise. * language.c: Likewise. * linux-fork.c: Likewise. * linux-nat.c: Likewise. * lm32-tdep.c: Likewise. * m2-exp.y: Likewise. * m2-typeprint.c: Likewise. * m32c-tdep.c: Likewise. * m32r-linux-nat.c: Likewise. * m32r-linux-tdep.c: Likewise. * m32r-rom.c: Likewise. * m32r-tdep.c: Likewise. * m68hc11-tdep.c: Likewise. * m68k-tdep.c: Likewise. * m68kbsd-tdep.c: Likewise. * m68klinux-nat.c: Likewise. * m68klinux-tdep.c: Likewise. * m88k-tdep.c: Likewise. * machoread.c: Likewise. * macrocmd.c: Likewise. * main.c: Likewise. * mdebugread.c: Likewise. * mem-break.c: Likewise. * memattr.c: Likewise. * memory-map.c: Likewise. * mep-tdep.c: Likewise. * mi/mi-cmd-break.c: Likewise. * mi/mi-cmd-disas.c: Likewise. * mi/mi-cmd-env.c: Likewise. * mi/mi-cmd-stack.c: Likewise. * mi/mi-cmd-var.c: Likewise. * mi/mi-cmds.c: Likewise. * mi/mi-console.c: Likewise. * mi/mi-getopt.c: Likewise. * mi/mi-interp.c: Likewise. * mi/mi-main.c: Likewise. * mi/mi-parse.c: Likewise. * microblaze-rom.c: Likewise. * microblaze-tdep.c: Likewise. * mingw-hdep.c: Likewise. * minidebug.c: Likewise. * minsyms.c: Likewise. * mips-irix-tdep.c: Likewise. * mips-linux-tdep.c: Likewise. * mips-tdep.c: Likewise. * mips64obsd-tdep.c: Likewise. * mipsnbsd-tdep.c: Likewise. * mipsread.c: Likewise. * mn10300-linux-tdep.c: Likewise. * mn10300-tdep.c: Likewise. * monitor.c: Likewise. * moxie-tdep.c: Likewise. * mt-tdep.c: Likewise. * nat/linux-btrace.c: Likewise. * nat/linux-osdata.c: Likewise. * nat/linux-procfs.c: Likewise. * nat/linux-ptrace.c: Likewise. * nat/linux-waitpid.c: Likewise. * nbsd-tdep.c: Likewise. * nios2-linux-tdep.c: Likewise. * nto-procfs.c: Likewise. * nto-tdep.c: Likewise. * objc-lang.c: Likewise. * objfiles.c: Likewise. * opencl-lang.c: Likewise. * osabi.c: Likewise. * osdata.c: Likewise. * p-exp.y: Likewise. * p-lang.c: Likewise. * p-typeprint.c: Likewise. * parse.c: Likewise. * posix-hdep.c: Likewise. * ppc-linux-nat.c: Likewise. * ppc-sysv-tdep.c: Likewise. * ppcfbsd-tdep.c: Likewise. * ppcnbsd-tdep.c: Likewise. * ppcobsd-tdep.c: Likewise. * printcmd.c: Likewise. * procfs.c: Likewise. * prologue-value.c: Likewise. * python/py-auto-load.c: Likewise. * python/py-gdb-readline.c: Likewise. * ravenscar-thread.c: Likewise. * regcache.c: Likewise. * registry.c: Likewise. * remote-fileio.c: Likewise. * remote-m32r-sdi.c: Likewise. * remote-mips.c: Likewise. * remote-notif.c: Likewise. * remote-sim.c: Likewise. * remote.c: Likewise. * reverse.c: Likewise. * rs6000-aix-tdep.c: Likewise. * ser-base.c: Likewise. * ser-go32.c: Likewise. * ser-mingw.c: Likewise. * ser-pipe.c: Likewise. * ser-tcp.c: Likewise. * ser-unix.c: Likewise. * serial.c: Likewise. * sh-tdep.c: Likewise. * sh64-tdep.c: Likewise. * shnbsd-tdep.c: Likewise. * skip.c: Likewise. * sol-thread.c: Likewise. * solib-dsbt.c: Likewise. * solib-frv.c: Likewise. * solib-osf.c: Likewise. * solib-som.c: Likewise. * solib-spu.c: Likewise. * solib-target.c: Likewise. * solib.c: Likewise. * somread.c: Likewise. * source.c: Likewise. * sparc-nat.c: Likewise. * sparc-sol2-tdep.c: Likewise. * sparc-tdep.c: Likewise. * sparc64-tdep.c: Likewise. * sparc64fbsd-tdep.c: Likewise. * sparc64nbsd-tdep.c: Likewise. * sparcnbsd-tdep.c: Likewise. * spu-linux-nat.c: Likewise. * spu-multiarch.c: Likewise. * spu-tdep.c: Likewise. * stabsread.c: Likewise. * stack.c: Likewise. * std-regs.c: Likewise. * symfile.c: Likewise. * symmisc.c: Likewise. * symtab.c: Likewise. * target.c: Likewise. * thread.c: Likewise. * tilegx-linux-nat.c: Likewise. * tilegx-tdep.c: Likewise. * top.c: Likewise. * tracepoint.c: Likewise. * tui/tui-command.c: Likewise. * tui/tui-data.c: Likewise. * tui/tui-disasm.c: Likewise. * tui/tui-file.c: Likewise. * tui/tui-layout.c: Likewise. * tui/tui-out.c: Likewise. * tui/tui-regs.c: Likewise. * tui/tui-source.c: Likewise. * tui/tui-stack.c: Likewise. * tui/tui-win.c: Likewise. * tui/tui-windata.c: Likewise. * tui/tui-winsource.c: Likewise. * typeprint.c: Likewise. * ui-file.c: Likewise. * ui-out.c: Likewise. * user-regs.c: Likewise. * utils.c: Likewise. * v850-tdep.c: Likewise. * valarith.c: Likewise. * valops.c: Likewise. * valprint.c: Likewise. * value.c: Likewise. * varobj.c: Likewise. * vax-tdep.c: Likewise. * vaxnbsd-tdep.c: Likewise. * vaxobsd-tdep.c: Likewise. * windows-nat.c: Likewise. * xcoffread.c: Likewise. * xml-support.c: Likewise. * xstormy16-tdep.c: Likewise. * xtensa-linux-nat.c: Likewise. gdb/gdbserver/ 2014-08-07 Gary Benson <gbenson@redhat.com> * server.h: Do not include string.h. * event-loop.c: Likewise. * linux-low.c: Likewise. * regcache.c: Likewise. * remote-utils.c: Likewise. * spu-low.c: Likewise. * utils.c: Likewise.
2014-04-24Add AVX512 registers support to GDB and GDBserver.Michael Sturm
This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker
2013-11-20Add MPX support for i386Walfred Tedeschi
2013-11-20 Walfred Tedeschi <walfred.tedeschi@intel.com> * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Add MPX registers on the range of registers to be read from xsave buffer. (i386_linux_read_description): Add case for MPX. * i386-linux-tdep.c: Include features/i386/i386-mpx-linux.c. (i386_linux_gregset_reg_offset): Add MPX registers. (i386_linux_core_read_description): Initialize also MPX. (_initialize_i386_linux_tdep): Add mpx initialization. * i386-tdep.h (gdbarch_tdep): Add fields bnd0r_regnum, bnd0_regnum, mpx_register_names. (i386_regnum): Add MPX registers. (I386_MPX_NUM_REGS): New macro. (i386_bnd_regnum_p): New function. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be the number of BNDSTATUS. (tdesc_i386_mpx_linux): Add description for MPX Linux registers. * i386-tdep.c: Include features/i386/i386-mpx.c. (i386_mpx_names): Add MPX register names array. (i386_bnd_names): Add bnd pseudo register names array. (i386_bndr_regnum_p): Lookup register numbers for bnd raw registers. (i386_bndr_regnum_p): Lookup register numbers for bnd raw registers. (386_mpx_ctrl_regnum_p): Lookup register numbers for MPX control registers. (i386_bnd_type): New function. (i386_pseudo_register_type): Use i386_bnd_type for bnd pseudo register types. (i386_pseudo_register_read_into_value): Add bnd case. (i386_pseudo_register_write): Add bnd pseudo registers. (i386_register_reggroup_p): Add MPX register to the group all. (i386_validate_tdesc_p): Add MPX to the target description validation. (i386_pseudo_register_name): Add bnd pseudo registers. (i386_gdbarch_init): Add MPX for architecture initialization. (_initia_initialize_i386_tdep): Add mpx initialization. * i387-tdep.c (xsave_mpx_offset): New vector for MPX offsets on XSAVE buffer. (XSAVE_MPX_ADDR): New macro. (i387_supply_xsave): Add MPX case. (i387_collect_xsave): Add MPX case. * i387-tdep.h (I387_BND0R_REGNUM): New macro. (I387_BNDCFGU_REGNUM): New macro. (I387_NUM_MPX_REGS): New macro. (I387_NUM_BND_REGS): New macro. (I387_NUM_MPX_CTRL_REGS): New macro. (I387_MPXEND_REGNUM): New macro. * common/i386-xstate.h (I386_XSTATE_BNDREGS): New macro. (I386_XSTATE_BNDCFG): Likewise. (I386_XSTATE_MPX_MASK): Likewise. (I386_XSTATE_ALL_MASK): New macro represents flags for all states. (I386_XSTATE_BNDREGS_SIZE): New macro. (I386_XSTATE_BNDCFG_SIZE): Likewise. (I386_XSTATE_SIZE): Adapt for MPX. (I386_XSTATE_MAX_SIZE): Likewise. Change-Id: I9ddb7d49434d86fa18eb6b99515203d7c567aefd Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com> Conflicts: gdb/ChangeLog
2013-11-18remove gdb_string.hTom Tromey
This removes gdb_string.h. This patch is purely mechanical. I created it by running the two commands: git rm common/gdb_string.h perl -pi -e's/"gdb_string.h"/<string.h>/;' *.[chyl] */*.[chyl] 2013-11-18 Tom Tromey <tromey@redhat.com> * common/gdb_string.h: Remove. * aarch64-tdep.c: Use string.h, not gdb_string.h. * ada-exp.y: Use string.h, not gdb_string.h. * ada-lang.c: Use string.h, not gdb_string.h. * ada-lex.l: Use string.h, not gdb_string.h. * ada-typeprint.c: Use string.h, not gdb_string.h. * ada-valprint.c: Use string.h, not gdb_string.h. * aix-thread.c: Use string.h, not gdb_string.h. * alpha-linux-tdep.c: Use string.h, not gdb_string.h. * alpha-mdebug-tdep.c: Use string.h, not gdb_string.h. * alpha-nat.c: Use string.h, not gdb_string.h. * alpha-osf1-tdep.c: Use string.h, not gdb_string.h. * alpha-tdep.c: Use string.h, not gdb_string.h. * alphanbsd-tdep.c: Use string.h, not gdb_string.h. * amd64-dicos-tdep.c: Use string.h, not gdb_string.h. * amd64-linux-nat.c: Use string.h, not gdb_string.h. * amd64-linux-tdep.c: Use string.h, not gdb_string.h. * amd64-nat.c: Use string.h, not gdb_string.h. * amd64-sol2-tdep.c: Use string.h, not gdb_string.h. * amd64fbsd-tdep.c: Use string.h, not gdb_string.h. * amd64obsd-tdep.c: Use string.h, not gdb_string.h. * arch-utils.c: Use string.h, not gdb_string.h. * arm-linux-nat.c: Use string.h, not gdb_string.h. * arm-linux-tdep.c: Use string.h, not gdb_string.h. * arm-tdep.c: Use string.h, not gdb_string.h. * arm-wince-tdep.c: Use string.h, not gdb_string.h. * armbsd-tdep.c: Use string.h, not gdb_string.h. * armnbsd-nat.c: Use string.h, not gdb_string.h. * armnbsd-tdep.c: Use string.h, not gdb_string.h. * armobsd-tdep.c: Use string.h, not gdb_string.h. * avr-tdep.c: Use string.h, not gdb_string.h. * ax-gdb.c: Use string.h, not gdb_string.h. * ax-general.c: Use string.h, not gdb_string.h. * bcache.c: Use string.h, not gdb_string.h. * bfin-tdep.c: Use string.h, not gdb_string.h. * breakpoint.c: Use string.h, not gdb_string.h. * build-id.c: Use string.h, not gdb_string.h. * buildsym.c: Use string.h, not gdb_string.h. * c-exp.y: Use string.h, not gdb_string.h. * c-lang.c: Use string.h, not gdb_string.h. * c-typeprint.c: Use string.h, not gdb_string.h. * c-valprint.c: Use string.h, not gdb_string.h. * charset.c: Use string.h, not gdb_string.h. * cli-out.c: Use string.h, not gdb_string.h. * cli/cli-cmds.c: Use string.h, not gdb_string.h. * cli/cli-decode.c: Use string.h, not gdb_string.h. * cli/cli-dump.c: Use string.h, not gdb_string.h. * cli/cli-interp.c: Use string.h, not gdb_string.h. * cli/cli-logging.c: Use string.h, not gdb_string.h. * cli/cli-script.c: Use string.h, not gdb_string.h. * cli/cli-setshow.c: Use string.h, not gdb_string.h. * cli/cli-utils.c: Use string.h, not gdb_string.h. * coffread.c: Use string.h, not gdb_string.h. * common/common-utils.c: Use string.h, not gdb_string.h. * common/filestuff.c: Use string.h, not gdb_string.h. * common/linux-procfs.c: Use string.h, not gdb_string.h. * common/linux-ptrace.c: Use string.h, not gdb_string.h. * common/signals.c: Use string.h, not gdb_string.h. * common/vec.h: Use string.h, not gdb_string.h. * core-regset.c: Use string.h, not gdb_string.h. * corefile.c: Use string.h, not gdb_string.h. * corelow.c: Use string.h, not gdb_string.h. * cp-abi.c: Use string.h, not gdb_string.h. * cp-support.c: Use string.h, not gdb_string.h. * cp-valprint.c: Use string.h, not gdb_string.h. * cris-tdep.c: Use string.h, not gdb_string.h. * d-lang.c: Use string.h, not gdb_string.h. * dbxread.c: Use string.h, not gdb_string.h. * dcache.c: Use string.h, not gdb_string.h. * demangle.c: Use string.h, not gdb_string.h. * dicos-tdep.c: Use string.h, not gdb_string.h. * disasm.c: Use string.h, not gdb_string.h. * doublest.c: Use string.h, not gdb_string.h. * dsrec.c: Use string.h, not gdb_string.h. * dummy-frame.c: Use string.h, not gdb_string.h. * dwarf2-frame.c: Use string.h, not gdb_string.h. * dwarf2loc.c: Use string.h, not gdb_string.h. * dwarf2read.c: Use string.h, not gdb_string.h. * elfread.c: Use string.h, not gdb_string.h. * environ.c: Use string.h, not gdb_string.h. * eval.c: Use string.h, not gdb_string.h. * event-loop.c: Use string.h, not gdb_string.h. * exceptions.c: Use string.h, not gdb_string.h. * exec.c: Use string.h, not gdb_string.h. * expprint.c: Use string.h, not gdb_string.h. * f-exp.y: Use string.h, not gdb_string.h. * f-lang.c: Use string.h, not gdb_string.h. * f-typeprint.c: Use string.h, not gdb_string.h. * f-valprint.c: Use string.h, not gdb_string.h. * fbsd-nat.c: Use string.h, not gdb_string.h. * findcmd.c: Use string.h, not gdb_string.h. * findvar.c: Use string.h, not gdb_string.h. * fork-child.c: Use string.h, not gdb_string.h. * frame.c: Use string.h, not gdb_string.h. * frv-linux-tdep.c: Use string.h, not gdb_string.h. * frv-tdep.c: Use string.h, not gdb_string.h. * gdb.c: Use string.h, not gdb_string.h. * gdb_bfd.c: Use string.h, not gdb_string.h. * gdbarch.c: Use string.h, not gdb_string.h. * gdbtypes.c: Use string.h, not gdb_string.h. * gnu-nat.c: Use string.h, not gdb_string.h. * gnu-v2-abi.c: Use string.h, not gdb_string.h. * gnu-v3-abi.c: Use string.h, not gdb_string.h. * go-exp.y: Use string.h, not gdb_string.h. * go-lang.c: Use string.h, not gdb_string.h. * go32-nat.c: Use string.h, not gdb_string.h. * hppa-hpux-tdep.c: Use string.h, not gdb_string.h. * hppa-linux-nat.c: Use string.h, not gdb_string.h. * hppanbsd-tdep.c: Use string.h, not gdb_string.h. * hppaobsd-tdep.c: Use string.h, not gdb_string.h. * i386-cygwin-tdep.c: Use string.h, not gdb_string.h. * i386-dicos-tdep.c: Use string.h, not gdb_string.h. * i386-linux-nat.c: Use string.h, not gdb_string.h. * i386-linux-tdep.c: Use string.h, not gdb_string.h. * i386-nto-tdep.c: Use string.h, not gdb_string.h. * i386-sol2-tdep.c: Use string.h, not gdb_string.h. * i386-tdep.c: Use string.h, not gdb_string.h. * i386bsd-tdep.c: Use string.h, not gdb_string.h. * i386gnu-nat.c: Use string.h, not gdb_string.h. * i386nbsd-tdep.c: Use string.h, not gdb_string.h. * i386obsd-tdep.c: Use string.h, not gdb_string.h. * i387-tdep.c: Use string.h, not gdb_string.h. * ia64-libunwind-tdep.c: Use string.h, not gdb_string.h. * ia64-linux-nat.c: Use string.h, not gdb_string.h. * inf-child.c: Use string.h, not gdb_string.h. * inf-ptrace.c: Use string.h, not gdb_string.h. * inf-ttrace.c: Use string.h, not gdb_string.h. * infcall.c: Use string.h, not gdb_string.h. * infcmd.c: Use string.h, not gdb_string.h. * inflow.c: Use string.h, not gdb_string.h. * infrun.c: Use string.h, not gdb_string.h. * interps.c: Use string.h, not gdb_string.h. * iq2000-tdep.c: Use string.h, not gdb_string.h. * irix5-nat.c: Use string.h, not gdb_string.h. * jv-exp.y: Use string.h, not gdb_string.h. * jv-lang.c: Use string.h, not gdb_string.h. * jv-typeprint.c: Use string.h, not gdb_string.h. * jv-valprint.c: Use string.h, not gdb_string.h. * language.c: Use string.h, not gdb_string.h. * linux-fork.c: Use string.h, not gdb_string.h. * linux-nat.c: Use string.h, not gdb_string.h. * lm32-tdep.c: Use string.h, not gdb_string.h. * m2-exp.y: Use string.h, not gdb_string.h. * m2-typeprint.c: Use string.h, not gdb_string.h. * m32c-tdep.c: Use string.h, not gdb_string.h. * m32r-linux-nat.c: Use string.h, not gdb_string.h. * m32r-linux-tdep.c: Use string.h, not gdb_string.h. * m32r-rom.c: Use string.h, not gdb_string.h. * m32r-tdep.c: Use string.h, not gdb_string.h. * m68hc11-tdep.c: Use string.h, not gdb_string.h. * m68k-tdep.c: Use string.h, not gdb_string.h. * m68kbsd-tdep.c: Use string.h, not gdb_string.h. * m68klinux-nat.c: Use string.h, not gdb_string.h. * m68klinux-tdep.c: Use string.h, not gdb_string.h. * m88k-tdep.c: Use string.h, not gdb_string.h. * macrocmd.c: Use string.h, not gdb_string.h. * main.c: Use string.h, not gdb_string.h. * mdebugread.c: Use string.h, not gdb_string.h. * mem-break.c: Use string.h, not gdb_string.h. * memattr.c: Use string.h, not gdb_string.h. * memory-map.c: Use string.h, not gdb_string.h. * mep-tdep.c: Use string.h, not gdb_string.h. * mi/mi-cmd-break.c: Use string.h, not gdb_string.h. * mi/mi-cmd-disas.c: Use string.h, not gdb_string.h. * mi/mi-cmd-env.c: Use string.h, not gdb_string.h. * mi/mi-cmd-stack.c: Use string.h, not gdb_string.h. * mi/mi-cmd-var.c: Use string.h, not gdb_string.h. * mi/mi-cmds.c: Use string.h, not gdb_string.h. * mi/mi-console.c: Use string.h, not gdb_string.h. * mi/mi-getopt.c: Use string.h, not gdb_string.h. * mi/mi-interp.c: Use string.h, not gdb_string.h. * mi/mi-main.c: Use string.h, not gdb_string.h. * mi/mi-parse.c: Use string.h, not gdb_string.h. * microblaze-rom.c: Use string.h, not gdb_string.h. * microblaze-tdep.c: Use string.h, not gdb_string.h. * mingw-hdep.c: Use string.h, not gdb_string.h. * minidebug.c: Use string.h, not gdb_string.h. * minsyms.c: Use string.h, not gdb_string.h. * mips-irix-tdep.c: Use string.h, not gdb_string.h. * mips-linux-tdep.c: Use string.h, not gdb_string.h. * mips-tdep.c: Use string.h, not gdb_string.h. * mips64obsd-tdep.c: Use string.h, not gdb_string.h. * mipsnbsd-tdep.c: Use string.h, not gdb_string.h. * mipsread.c: Use string.h, not gdb_string.h. * mn10300-linux-tdep.c: Use string.h, not gdb_string.h. * mn10300-tdep.c: Use string.h, not gdb_string.h. * monitor.c: Use string.h, not gdb_string.h. * moxie-tdep.c: Use string.h, not gdb_string.h. * mt-tdep.c: Use string.h, not gdb_string.h. * nbsd-tdep.c: Use string.h, not gdb_string.h. * nios2-linux-tdep.c: Use string.h, not gdb_string.h. * nto-procfs.c: Use string.h, not gdb_string.h. * nto-tdep.c: Use string.h, not gdb_string.h. * objc-lang.c: Use string.h, not gdb_string.h. * objfiles.c: Use string.h, not gdb_string.h. * opencl-lang.c: Use string.h, not gdb_string.h. * osabi.c: Use string.h, not gdb_string.h. * osdata.c: Use string.h, not gdb_string.h. * p-exp.y: Use string.h, not gdb_string.h. * p-lang.c: Use string.h, not gdb_string.h. * p-typeprint.c: Use string.h, not gdb_string.h. * parse.c: Use string.h, not gdb_string.h. * posix-hdep.c: Use string.h, not gdb_string.h. * ppc-linux-nat.c: Use string.h, not gdb_string.h. * ppc-sysv-tdep.c: Use string.h, not gdb_string.h. * ppcfbsd-tdep.c: Use string.h, not gdb_string.h. * ppcnbsd-tdep.c: Use string.h, not gdb_string.h. * ppcobsd-tdep.c: Use string.h, not gdb_string.h. * printcmd.c: Use string.h, not gdb_string.h. * procfs.c: Use string.h, not gdb_string.h. * prologue-value.c: Use string.h, not gdb_string.h. * python/py-auto-load.c: Use string.h, not gdb_string.h. * python/py-gdb-readline.c: Use string.h, not gdb_string.h. * ravenscar-thread.c: Use string.h, not gdb_string.h. * regcache.c: Use string.h, not gdb_string.h. * registry.c: Use string.h, not gdb_string.h. * remote-fileio.c: Use string.h, not gdb_string.h. * remote-m32r-sdi.c: Use string.h, not gdb_string.h. * remote-mips.c: Use string.h, not gdb_string.h. * remote-sim.c: Use string.h, not gdb_string.h. * remote.c: Use string.h, not gdb_string.h. * reverse.c: Use string.h, not gdb_string.h. * rs6000-aix-tdep.c: Use string.h, not gdb_string.h. * ser-base.c: Use string.h, not gdb_string.h. * ser-go32.c: Use string.h, not gdb_string.h. * ser-mingw.c: Use string.h, not gdb_string.h. * ser-pipe.c: Use string.h, not gdb_string.h. * ser-tcp.c: Use string.h, not gdb_string.h. * ser-unix.c: Use string.h, not gdb_string.h. * serial.c: Use string.h, not gdb_string.h. * sh-tdep.c: Use string.h, not gdb_string.h. * sh64-tdep.c: Use string.h, not gdb_string.h. * shnbsd-tdep.c: Use string.h, not gdb_string.h. * skip.c: Use string.h, not gdb_string.h. * sol-thread.c: Use string.h, not gdb_string.h. * solib-dsbt.c: Use string.h, not gdb_string.h. * solib-frv.c: Use string.h, not gdb_string.h. * solib-osf.c: Use string.h, not gdb_string.h. * solib-spu.c: Use string.h, not gdb_string.h. * solib-target.c: Use string.h, not gdb_string.h. * solib.c: Use string.h, not gdb_string.h. * somread.c: Use string.h, not gdb_string.h. * source.c: Use string.h, not gdb_string.h. * sparc-nat.c: Use string.h, not gdb_string.h. * sparc-sol2-tdep.c: Use string.h, not gdb_string.h. * sparc-tdep.c: Use string.h, not gdb_string.h. * sparc64-tdep.c: Use string.h, not gdb_string.h. * sparc64fbsd-tdep.c: Use string.h, not gdb_string.h. * sparc64nbsd-tdep.c: Use string.h, not gdb_string.h. * sparcnbsd-tdep.c: Use string.h, not gdb_string.h. * spu-linux-nat.c: Use string.h, not gdb_string.h. * spu-multiarch.c: Use string.h, not gdb_string.h. * spu-tdep.c: Use string.h, not gdb_string.h. * stabsread.c: Use string.h, not gdb_string.h. * stack.c: Use string.h, not gdb_string.h. * std-regs.c: Use string.h, not gdb_string.h. * symfile.c: Use string.h, not gdb_string.h. * symmisc.c: Use string.h, not gdb_string.h. * symtab.c: Use string.h, not gdb_string.h. * target.c: Use string.h, not gdb_string.h. * thread.c: Use string.h, not gdb_string.h. * tilegx-linux-nat.c: Use string.h, not gdb_string.h. * tilegx-tdep.c: Use string.h, not gdb_string.h. * top.c: Use string.h, not gdb_string.h. * tracepoint.c: Use string.h, not gdb_string.h. * tui/tui-command.c: Use string.h, not gdb_string.h. * tui/tui-data.c: Use string.h, not gdb_string.h. * tui/tui-disasm.c: Use string.h, not gdb_string.h. * tui/tui-file.c: Use string.h, not gdb_string.h. * tui/tui-layout.c: Use string.h, not gdb_string.h. * tui/tui-out.c: Use string.h, not gdb_string.h. * tui/tui-regs.c: Use string.h, not gdb_string.h. * tui/tui-source.c: Use string.h, not gdb_string.h. * tui/tui-stack.c: Use string.h, not gdb_string.h. * tui/tui-win.c: Use string.h, not gdb_string.h. * tui/tui-windata.c: Use string.h, not gdb_string.h. * tui/tui-winsource.c: Use string.h, not gdb_string.h. * typeprint.c: Use string.h, not gdb_string.h. * ui-file.c: Use string.h, not gdb_string.h. * ui-out.c: Use string.h, not gdb_string.h. * user-regs.c: Use string.h, not gdb_string.h. * utils.c: Use string.h, not gdb_string.h. * v850-tdep.c: Use string.h, not gdb_string.h. * valarith.c: Use string.h, not gdb_string.h. * valops.c: Use string.h, not gdb_string.h. * valprint.c: Use string.h, not gdb_string.h. * value.c: Use string.h, not gdb_string.h. * varobj.c: Use string.h, not gdb_string.h. * vax-tdep.c: Use string.h, not gdb_string.h. * vaxnbsd-tdep.c: Use string.h, not gdb_string.h. * vaxobsd-tdep.c: Use string.h, not gdb_string.h. * windows-nat.c: Use string.h, not gdb_string.h. * xcoffread.c: Use string.h, not gdb_string.h. * xml-support.c: Use string.h, not gdb_string.h. * xstormy16-tdep.c: Use string.h, not gdb_string.h. * xtensa-linux-nat.c: Use string.h, not gdb_string.h.
2013-07-23gdb/Yao Qi
* i386-tdep.c (i386_in_stack_tramp_p): Remove unused parameter 'gdbarch'. (i386_stack_tramp_frame_sniffer): Caller update. * i386-linux-tdep.c (i386_linux_core_read_xcr0): Remove parameter 'gdbarch' and 'target'. (i386_linux_core_read_description): Caller update. * amd64-linux-tdep.c (amd64_linux_core_read_description): Likewise. * i386-linux-tdep.h (i386_linux_core_read_xcr0): Update declaration.
2013-03-11Rename record_ prefixes in record-full.h into record_full_.Markus Metzger
gdb/ * record-full.h, record-full.c (record_memory_query): Rename to ... (record_full_memory_query): ...this. Update all users. (record_arch_list_add_reg): Rename to ... (record_full_arch_list_add_reg): ...this. Update all users. (record_arch_list_add_mem): Rename to ... (record_full_arch_list_add_mem): ...this. Update all users. (record_arch_list_add_end): Rename to ... (record_full_arch_list_add_end): ...this. Update all users. (record_gdb_operation_disable_set): Rename to ... (record_full_gdb_operation_disable_set): ...this. Update all users.
2013-03-11Split record.h into record.h and record-full.h.Markus Metzger
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-01-01Update years in copyright notice for the GDB files.Joel Brobecker
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.
2012-05-24gdb/Pedro Alves
2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace target_signal with gdb_signal throughout. gdb/gdbserver/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace target_signal with gdb_signal throughout. include/gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace target_signal with gdb_signal throughout. sim/common/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace target_signal with gdb_signal throughout.