summaryrefslogtreecommitdiff
path: root/gdb
Commit message (Collapse)AuthorAgeFilesLines
* Use ui_out_emit_list and ui_out_emit_tuple with gdb::optionalTom Tromey2017-09-092-11/+19
| | | | | | | | | | | | | This changes a few spots to use ui_out_emit_list and/or ui_out_emit_tuple with gdb::optional, to preserve existing behavior. This allows for the removal of a few more cleanups. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * mi/mi-cmd-var.c (mi_cmd_var_list_children): Use gdb::optional, ui_out_emit_list, ui_out_emit_tuple. (mi_cmd_var_update): Likewise.
* Remove make_cleanup_ui_out_redirect_popTom Tromey2017-09-097-50/+67
| | | | | | | | | | | | | | | | | | This patch introduces ui_out_redirect_pop. All uses of make_cleanup_ui_out_redirect_pop are replaced with this new class. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * mi/mi-interp.c (mi_user_selected_context_changed): Use ui_out_redirect_pop. * guile/scm-ports.c (ioscm_with_output_to_port_worker): Use ui_out_redirect_pop. * utils.c (do_ui_out_redirect_pop) (make_cleanup_ui_out_redirect_pop): Remove. * top.c (execute_command_to_string): Use ui_out_redirect_pop. * utils.h (make_cleanup_ui_out_redirect_pop): Remove. * ui-out.h (ui_out_redirect_pop): New class.
* Use ui_out_emit_list in more placesTom Tromey2017-09-092-44/+46
| | | | | | | | | | | | | | This changes various spots to use ui_out_emit_list, removing some cleanups. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * mi/mi-main.c (output_cores): Use ui_out_emit_list. (list_available_thread_groups, mi_cmd_list_thread_groups) (mi_cmd_data_list_changed_registers, mi_cmd_data_read_memory) (mi_cmd_data_read_memory_bytes, mi_cmd_trace_frame_collected): Likewise.
* Use ui_out_emit_tuple in disasm.cTom Tromey2017-09-092-82/+87
| | | | | | | | | | | This changes one spot in disasm.c to use ui_out_emit_tuple. This patch required a large reindentation, so I've separated it out. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Use ui_out_emit_tuple.
* Use ui_out_emit_tuple in more placesTom Tromey2017-09-097-138/+119
| | | | | | | | | | | | | | | | | | This changes more places to use ui_out_emit_tuple, removing cleanups. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * target.c (flash_erase_command): Use ui_out_emit_tuple. * stack.c (print_frame): Use ui_out_emit_tuple. * spu-tdep.c (info_spu_event_command): Use ui_out_emit_tuple. (info_spu_mailbox_command, info_spu_dma_command) (info_spu_proxydma_command): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Use ui_out_emit_tuple, gdb::byte_vector, bin2hex. * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use ui_out_emit_tuple. * breakpoint.c (print_it_watchpoint): Use ui_out_emit_tuple.
* Remove make_cleanup_ui_out_table_begin_endTom Tromey2017-09-096-181/+164
| | | | | | | | | | | | | | | | | | | This changes the few remaining uses of make_cleanup_ui_out_table_begin_end to use ui_out_emit_table instead, and then removes the cleanup. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * ui-out.h (make_cleanup_ui_out_table_begin_end): Remove. (class ui_out_emit_table): Update comment. * ui-out.c (do_cleanup_table_end) (make_cleanup_ui_out_table_begin_end): Remove. * spu-tdep.c (info_spu_mailbox_list): Use ui_out_emit_table. (info_spu_dma_cmdlist): Likewise. * probe.c (info_probes_for_ops): Use ui_out_emit_table. * darwin-nat-info.c (darwin_debug_regions_recurse): Use ui_out_emit_table.
* Use ui_out_emit_table and ui_out_emit_list in print_thread_info_1Tom Tromey2017-09-092-46/+51
| | | | | | | | | | | | This changes print_thread_info_1 to use ui_out_emit_table and ui_out_emit_list. Which one is used depends on whether the ui-out is mi-like; so the emitters are wrapped in gdb::optional. ChangeLog 2017-09-09 Tom Tromey <tom@tromey.com> * thread.c (print_thread_info_1): Use ui_out_emit_table, ui_out_emit_list, gdb::optional.
* Remove unnecessary function prototypes.John Baldwin2017-09-09347-1013/+396
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unused field field_info.fnfieldsKeith Seitz2017-09-082-4/+5
| | | | | | | | | | Since at least 7.3 the "fnfields" field in struct field_info has been unused. This patch simply removes it. gdb/ChangeLog: * dwarf2read.c (struct field_info) <fnfields>: Remove unused field.
* Remove C/C++ relevant code in Fortran specific file.Christoph Weinmann2017-09-085-16/+74
| | | | | | Remove code relevant for printing C/C++ Integer values in a Fortran specific file to unify printing of Fortran values. This does not change the output.
* fortran: Testsuite, fix typos in vla-value.Bernhard Heckel2017-09-083-4/+9
|
* Fortran: Testsuite, fix differences in type naming.Bernhard Heckel2017-09-084-15/+31
|
* Fix indentation for printing Fortran types with pointersFrank Penczek2017-09-085-4/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | Printing the prefix "PTR TO -> (" resp. "REF TO ->(" ignored the active indentation level. This caused inconsistent appearance of user-defined Fortran types containing pointers. Fix by using "fprintfi_filtered" with the current indentation level for outputting the prefix string. Add test case ptr-indentation. Example using 'ptype' on object of type: type TypeWithPointer integer i integer, pointer:: p end type TypeWithPointer Before: type = Type typewithpointer integer(kind=4) :: i PTR TO -> ( integer(kind=4) :: p) End Type typewithpointer After: type = Type typewithpointer integer(kind=4) :: i PTR TO -> ( integer(kind=4) :: p) End Type typewithpointer
* Document the GDB 8.0.1 release in gdb/ChangeLogJoel Brobecker2017-09-071-0/+4
| | | | | | gdb/ChangeLog: GDB 8.0.1 released.
* remove QStartupWithShell entry from NEWS::Changes in GDB 7.11Joel Brobecker2017-09-072-3/+4
| | | | | | | | | | | | | | | | | | | This entry was added twice within the same commit, back in Dec 2017 by the following change: commit aefd8b33d97bded58e51d75271f99e1eaec9fb28 Date: Thu Dec 22 22:14:02 2016 -0500 Subject: Implement proper "startup-with-shell" support on gdbserver I think the second entry is just a rebase/merge oversight, and it wasn't meant to be added there, particularly since the 7.11 branch was no longer active at that time anymore. This patch just removes the entry. gdb/ChangeLog: * NEWS (Changes in GDB 7.11): Remove entry for QStartupWithShell.
* Change funcall_chain to be a std::vectorTom Tromey2017-09-062-39/+14
| | | | | | | | | | | | | | | | | This simplifies the handling of funcall_chain, by changing it to be a std::vector<int> and then fixing the users. This allows the removal of a cleanup. It would be even cleaner to replace this with better logic in the parsers; but a baby step seemed ok. gdb/ChangeLog 2017-09-05 Tom Tromey <tom@tromey.com> * parse.c (funcall_chain): Now a std::vector. (start_arglist, end_arglist): Simplify. (free_funcalls): Remove. (parse_exp_in_context_1): Remove cleanup.
* Remove last cleanups from go-exp.yTom Tromey2017-09-062-10/+5
| | | | | | | | | This removes the last remaining cleanups from go-exp.y. 2017-09-05 Tom Tromey <tom@tromey.com> * go-exp.y (go_parse): Don't create a cleanup.
* Remove last cleanups from d-exp.yTom Tromey2017-09-062-17/+13
| | | | | | | | | This removes the last remaining cleanups from d-exp.y. 2017-09-05 Tom Tromey <tom@tromey.com> * d-exp.y (PrimaryExpression): Use std::string. (d_parse): Don't create a cleanup.
* Remove make_cleanup_clear_parser_stateTom Tromey2017-09-0610-50/+23
| | | | | | | | | | | | | | | | | This removes make_cleanup_clear_parser_state in favor of scoped_restore. 2017-09-05 Tom Tromey <tom@tromey.com> * utils.c (do_clear_parser_state): Remove. (make_cleanup_clear_parser_state): Remove. * p-exp.y (pascal_parse): Use scoped_restore. * m2-exp.y (m2_parse): Use scoped_restore. * f-exp.y (f_parse): Use scoped_restore. * d-exp.y (d_parse): Use scoped_restore. * c-exp.y (c_parse): Use scoped_restore. * ada-exp.y (ada_parse): Use scoped_restore. * utils.h (make_cleanup_clear_parser_state): Remove.
* Introduce dw2_linkage_name and dw2_linkage_name_attr.Keith Seitz2017-09-062-26/+46
| | | | | | | | | | | | | | | | | | | | | | | | | The DWARF reader is littered with the following idiom to read a linkage name from the debug info: mangled = dwarf2_string_attr (die, DW_AT_linkage_name, cu); if (mangled == NULL) mangled = dwarf2_string_attr (die, DW_AT_MIPS_linkage_name, cu); This patch introduces functions to simplify this to: mangled = dw2_linkage_name (die, cu); or attr = dw2_linkage_name_attr (die, cu); gdb/ChangeLog: * dwarf2read.c (dw2_linkage_name_attr): New function. (dw2_linkage_name): New function. (dwarf2_compute_name, dwarf2_physname, read_call_site_scope) (guess_full_die_structure_name, dwarf2_name): Use dw2_linkage_name. (anonymous_struct_prefix, dwarf2_name): Use dw2_linkage_name_attr.
* Cast char constant to int in sizeof.expTom Tromey2017-09-062-1/+6
| | | | | | | | | | | | | | | | | | | | PR gdb/22010 concerns a regression I introduced with the scalar printing changes. The bug is that this code in sizeof.exp: set signof_byte [get_integer_valueof "'\\377'" -1] can incorrectly compute sizeof_byte. One underlying problem here is that gdb's C parser doesn't treat a char constant as an int (this is PR 19973). However, it seems good to have an immediate fix for the regression. The simplest is to cast to an int here. testsuite/ChangeLog 2017-09-05 Tom Tromey <tom@tromey.com> PR gdb/22010: * gdb.base/sizeof.exp (check_valueof): Cast char constant to int.
* Correct shell compatibility issue detected with pkgsrc.Kamil Rytarowski2017-09-062-1/+5
| | | | | | | | | | | String comparison of in a POSIX bourne shell must be done with '=', not '=='. For example the NetBSD sh(1) does not support it. gdb/ChangeLog 2017-09-06 Kamil Rytarowski <n54@gmx.com> * config/djgpp/djconfig.sh: Correct shell portability issue.
* Fix calls in gdb.arch/thumb2-it.expThomas Preud'homme2017-09-062-2/+6
| | | | | | | | | | | | | | Tests in gdb.arch/thumb2-it.exp call functions defined in assembly without type debugging information. Since 7022349d5c86bae74b49225515f42d2e221bd368 ("Stop assuming no-debug-info functions return int") this triggers an error which leads to many tests to FAIL. This patch cast the call to indicate the return type of the functions when calling them. 2017-09-06 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/testsuite/ * gdb.arch/thumb2-it.exp: Cast call to assembly defined function.
* Define HAVE_NATIVE_GCORE_HOST on NetBSDKamil Rytarowski2017-09-062-0/+5
| | | | | | | | | | NetBSD ships with gcore(1) againg since the version 2.0. This tool is functional and actively maintained. gdb/ChangeLog 2017-09-06 Kamil Rytarowski <n54@gmx.com> * configure.nat: Define HAVE_NATIVE_GCORE_HOST on NetBSD.
* Add native target for FreeBSD/aarch64.John Baldwin2017-09-066-0/+148
| | | | | | | | | | gdb/ChangeLog: * Makefile.in (ALLDEPFILES): Add mips-fbsd-nat.c. * NEWS: Mention new FreeBSD/mips native configuration. * configure.host: Add aarch64*-*-freebsd*. * configure.nat: Likewise. * aarch64-fbsd-nat.c: New file.
* Add FreeBSD/aarch64 architecture.John Baldwin2017-09-066-0/+258
| | | | | | | | | | | | | | Support for collecting and supplying general purpose and floating point register sets is provided along with signal frame unwinding. gdb/ChangeLog: * Makefile.in (ALL_64_TARGET_OBS): Add aarch64-fbsd-tdep.o. (ALLDEPFILES): Add aarch64-fbsd-tdep.c. * NEWS: Mention new FreeBSD/aarch64 target. * configure.tgt: Add aarch64*-*-freebsd*. * aarch64-fbsd-tdep.c: New file. * aarch64-fbsd-tdep.h: New file.
* Add myself as a write-after-approval GDB maintainer.Kamil Rytarowski2017-09-062-0/+5
| | | | | | | gdb/ChangeLog: 2017-09-06 Kamil Rytarowski <n54@gmx.com> * MAINTAINERS (Write After Approval): Add Kamil Rytarowski.
* Fix accessing TLS variables with no debug infoJan Kratochvil2017-09-065-2/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2273f0ac95a7 ("change minsyms not to be relocated at read-time"), printing TLS symbols of objfiles with a non-zero base address, without debug info, fails. E.g., with: $ mv /usr/lib/debug /usr/lib/debug-x to get debug info out of the way, we get: $ echo 'int main(){}' | gcc -pthread -x c - $ ./gdb -q -ex start -ex 'p (int) errno' ./a.out Cannot access memory at address 0xffffef7c0698 instead of the expected: $1 = 0 The regression is not visible with glibc debuginfo installed. The problem is that we compute the address of TLS minsyms incorrectly. To trigger the problem, it is important that the variable is in an objfile with a non-zero base address. While glibc is a shared library for 'errno', it's easier for the testcase to use PIE instead of a shlib. For TLS variables in PT_EXEC the regression obviously does not happen. gdb/ChangeLog 2017-09-06 Jan Kratochvil <jan.kratochvil@redhat.com> * parse.c (find_minsym_type_and_address): Don't relocate addresses of TLS symbols. gdb/testsuite/ChangeLog 2017-09-06 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.threads/tls-nodebug-pie.c: New file. * gdb.threads/tls-nodebug-pie.exp: New file.
* Fix leak of auto_obstack objfile_per_bfd_storage->storage_obstack;Philippe Waroquiers2017-09-052-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 23732b1e32dd58f7c731d9aee56ff0b22a645d53 Author: Pedro Alves <palves@redhat.com> Date: Tue Jun 27 16:22:08 2017 +0100 changed objfile_per_bfd_storage->storage_obstack from 'struct obstack storage_obstack;' to 'auto_obstack storage_obstack;' So the obstack is auto allocated when the objfile_per_bfd_storage ctor is manually called by get_objfile_bfd_data). However, the ctor call was still followed by a manual call to obstack_init (&storage->storage_obstack); This results in a bunch of leaks detected by valgrind, such as: ==24665== 4,064 bytes in 1 blocks are definitely lost in loss record 11,469 of 11,590 ==24665== at 0x4C27BF5: malloc (vg_replace_malloc.c:299) ==24665== by 0x5437B7: xmalloc (common-utils.c:44) ==24665== by 0x77CAA7: _obstack_begin_worker (obstack.c:141) ==24665== by 0x60168F: auto_obstack (gdb_obstack.h:70) ==24665== by 0x60168F: get_objfile_bfd_data(objfile*, bfd*) (objfiles.h:188) ==24665== by 0x601DB6: allocate_objfile(bfd*, char const*, enum_flags<objfile_flag>) (objfiles.c:423) ==24665== by 0x647753: symbol_file_add_with_addrs(bfd*, char const*, enum_flags<symfile_add_flag>, section_addr_info*, enum_flags<objfile_flag>, objfile*) (symfile.c:1158) ==24665== by 0x647C7B: symbol_file_add_separate(bfd*, char const*, enum_flags<symfile_add_flag>, objfile*) (symfile.c:1252) ==24665== by 0x4C7D79: elf_symfile_read(objfile*, enum_flags<symfile_add_flag>) (elfread.c:1270) ==24665== by 0x647CB4: read_symbols(objfile*, enum_flags<symfile_add_flag>) (symfile.c:861) ==24665== by 0x647809: syms_from_objfile_1 (symfile.c:1062) -> remove the manual call to obstack_init. Reg-tested on Debian 8/amd64, tests results are the same before/after the patch. valgrind still show some leaks, but less. gdb/ChangeLog 2017-09-05 Philippe Waroquiers <philippe.waroquiers@skynet.be> * objfiles.c (get_objfile_bfd_data): Remove useless obstack_init call.
* Don't use -fdiagnostics-color=never for rustcTom Tromey2017-09-052-1/+11
| | | | | | | | | | | | | | | I noticed that the gdb.rust tests fail because the test suite passes -fdiagnostics-color=never to rustc. This is not a recognized rustc option, and the test suite already handles passing the appropriate option to the Rust compiler. This patch fixes the problem. testsuite/ChangeLog 2017-09-05 Tom Tromey <tom@tromey.com> * lib/gdb.exp (gdb_compile): Don't use universal_compile_options for rust.
* Test different follow-exec-mode settings in gdb.multi/multi-arch-exec.expSimon Marchi2017-09-052-7/+23
| | | | | | | | | | | | | Using follow-exec-mode "new" takes a different code path than "same", so it's interesting to test this path in combination with a change in architecture of the inferior. This test fails if you remove the previous patch. gdb/testsuite/ChangeLog: * gdb.multi/multi-arch-exec.exp: Test with different "follow-exec-mode" settings. (do_test): New procedure.
* Add thread after updating gdbarch when exec'ingSimon Marchi2017-09-052-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in the previous patch, we should avoid doing register reads after a process does an exec and before we've updated that inferior's gdbarch. Otherwise, we may interpret the registers using the wrong architecture. When a process does an exec with "follow-exec-mode new", a new inferior is added by follow_exec. The gdbarch of that new inferior is at first set to some default value, probably specific to the gdb build (I get "i386" here), which may not be the right one. It is updated later by the call to target_find_description. Before that point, if we try to read the inferior's registers, we may not interpret them correctly. This has been exposed by a failure in gdb.base/foll-exec-mode.exp after the previous patch, with: Remote 'g' packet reply is too long (expected 312 bytes, got 816 bytes) The call to "add_thread" done just after adding the inferior is problematic, because it ends up reading the registers (because the ptid is re-used, we end up doing a switch_to_thread to it, which tries to update stop_pc). The registers returned by gdbserver are the x86-64 ones, while we try to interpret them using the "i386" gdbarch. Postponing the call to add_thread to until the target description/gdbarch has been updated seems to fix the issue. As to why this issue was uncovered by the previous patch: what I think happened before that patch is that since we were updating stop_pc before switching to the new inferior, we were filling the regcache associated to the ptid (this worked fine as long as the architectures of the previous and new process images were the same). The call to switch_to_thread then worked, because the register read hit the regcache. Now, it triggers a register read, while the gdbarch is not set correctly, leading to the "reply is too long" error. If this is right, it sounds wrong that we delete and re-add a thread with the same ptid, and are able to access the registers from the deleted thread. When we delete a thread, should we clear the regcache associated to that ptid, so that the new thread starts with a fresh/empty regcache? gdb/ChangeLog: * infrun.c (follow_exec): Call add_thread after target_find_description.
* Read stop_pc after updating the gdbarch when exec'ingSimon Marchi2017-09-052-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | When an inferior execs and changes architecture (e.g. 64 bits to 32 bits), the gdbarch associated to the inferior is updated by the follow_exec call in handle_inferior_event_1. We should avoid doing any register read before that point, because the registers sent by the remote side will be those of the new architecture, but we would interpret them using the old architecture. We do just that by setting stop_pc during this window, which obviously requires reading the registers. This results in gdb.multi/multi-arch-exec.exp failing, GDB outputting the following error: Truncated register 50 in remote 'g' packet This patch fixes that by postponing the setting of stop_pc to after we've updated the inferior gdbarch. This bug was hiding another problem, and as such introduces some failures in gdb.base/foll-exec-mode.exp. The following patch takes care of that. gdb/ChangeLog: * infrun.c (handle_inferior_event_1): When exec'ing, read stop_pc after follow_exec.
* Improve "'g' reply is is to long" error messageSimon Marchi2017-09-052-1/+6
| | | | | | | | | | ... by adding the expected size, and the received size. I found this useful when debugging gdbarch/remote issues, since it gives a hint of what gdb expects and what the remote sent. gdb/ChangeLog: * remote.c (process_g_packet): Update error message.
* Add i386.o to gdb_target_obs for x86_64-* targetsYao Qi2017-09-052-7/+13
| | | | | | | | | | | | This patch fixes the build failure caused by 22916b0 (Convert the rest x86 target descriptions). gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.tgt (gdb_target_obs): Add i386.o for x86_64-* targets.
* eval.c:evaluate_subexp_standard: Factor out function call handlingPedro Alves2017-09-052-451/+482
| | | | | | | | | | | | | | | While working on the no-debug-info debugging improvements, I found evaluate_subexp_standard's function call code unnecessarily long and hard to navigate and debug. The use of goto doesn't help either. This commit tries to improve things by factoring out the function-call-related code to separate helper functions. gdb/ChangeLog: 2017-09-05 Pedro Alves <palves@redhat.com> * eval.c (eval_call, evaluate_funcall): New functions, factored out from ... (evaluate_subexp_standard): ... this.
* Convert the rest x86 target descriptionsYao Qi2017-09-0530-2568/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.cYao Qi2017-09-0511-1998/+13
| | | | | | | | | | | | | | | | | gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * features/Makefile (XMLTOC): Remove i386/amd64XXX-linux.xml. * features/i386/amd64-avx-avx512-linux.c: Removed. * features/i386/amd64-avx-linux.c: Removed. * features/i386/amd64-avx-mpx-avx512-pku-linux.c: Removed. * features/i386/amd64-avx-mpx-linux.c: Removed. * features/i386/amd64-linux.c: Removed. * features/i386/amd64-mpx-linux.c: Removed. * features/i386/x32-avx-avx512-linux.c: Removed. * features/i386/x32-avx-linux.c: Removed. * features/i386/x32-linux.c: Removed.
* [GDBserver] Shorten srv_amd64_linux_xmlfilesYao Qi2017-09-052-1/+6
| | | | | | | | | | | | | | | | GDBserver now is able to generate target descriptions from features, so don't need to remember these target description files. Note that it should be i386/amd64-avx-avx512-linux.xml instead of i386/amd64-avx-avx512.xml in $srv_amd64_linux_xmlfiles. This patch removes it anyway. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv (srv_amd64_linux_xmlfiles): Remove i386/amd64-XXX-linux from it.
* [GDBserver] Use pre-generated amd64-linux tdesc as testYao Qi2017-09-052-9/+10
| | | | | | | | | | | | | | Now, all these amd64-linux pre-generated tdesc can be used as test, so don't need to build them if $development is false. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv: Empty srv_amd64_linux_regobj if $development is false. (ipa_amd64_linux_regobj): Remove. (ipa_x32_linux_regobj): Remove.
* Convert amd64-linux target descriptionsYao Qi2017-09-0514-210/+375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes amd64-linux target descriptions so that they can be dynamically generated in both GDB and GDBserver. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * Makefile.in (arch-amd64.o): New rule. * configure.srv: Append arch-amd64.o. * linux-amd64-ipa.c: Include common/x86-xstate.h. (get_ipa_tdesc): Call amd64_linux_read_description. (initialize_low_tracepoint): Don't call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-low.c (x86_linux_read_description): Call amd64_linux_read_description. (x86_get_ipa_tdesc_idx): Call amd64_get_ipa_tdesc_idx. (initialize_low_arch): Don't call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-tdesc-selftest.c: Declare init_registers_amd64_XXX and tdesc_amd64_XXX. [__x86_64__] (amd64_tdesc_test): New function. (initialize_low_tdesc) [__x86_64__]: Call init_registers_x32_XXX and init_registers_amd64_XXX. * linux-x86-tdesc.c: Include arch/amd64.h. (xcr0_to_tdesc_idx): New function. (i386_linux_read_description): New function. (amd64_get_ipa_tdesc_idx): New function. * linux-x86-tdesc.h (amd64_get_ipa_tdesc_idx): Declare. (amd64_get_ipa_tdesc): Declare. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-linux-tdep.c: Include arch/amd64.h. Don't include features/i386/*.c. (amd64_linux_read_description): Call amd64_create_target_description. * arch/amd64.c: New file. * arch/amd64.h: New file. * configure.tgt (x86_64-*-linux*): Append amd64.o. * Makefile.in (ALL_64_TARGET_OBS): Append amd64.o.
* Lazily and dynamically create amd64-linux target descriptionsYao Qi2017-09-0513-54/+599
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch starts to use the generate c feature files to dynamically create amd64-linux target descriptions. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-linux-tdep.c: Don't include amd64-XXX-linux and x32-XXX-linux.c. Include 64bit-XX.c and x32-XX.c. (amd64_linux_read_description): Create target descriptions. (_initialize_amd64_linux_tdep): Don't call initialize_tdesc_XXX functions. Add unit tests. * features/Makefile (FEATURE_XMLFILES): Append 64bit-XXX.xml and x32-core.xml. * features/i386/64bit-avx.c: Generated. * features/i386/64bit-avx512.c: Generated. * features/i386/64bit-core.c: Generated. * features/i386/64bit-linux.c: Generated. * features/i386/64bit-mpx.c: Generated. * features/i386/64bit-pkeys.c: Generated. * features/i386/64bit-segments.c: Generated. * features/i386/64bit-sse.c: Generated. * features/i386/x32-core.c: Generated. * target-descriptions.c (maint_print_c_tdesc_cmd): Print feature c files for amd64-linux and x32-linux.
* Centralize amd64-linux target descriptionsYao Qi2017-09-054-52/+47
| | | | | | | | | | | | | | | | | | | | This patch adds a new function amd64_linux_read_description, which creates amd64-linux target descriptions according to its two arguments, xcr0 and is_x32. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-linux-tdep.c (amd64_linux_read_description): New function. (amd64_linux_core_read_description): Call amd64_linux_read_description. (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-linux-tdep.h (amd64_linux_read_description): Declare. * x86-linux-nat.c (x86_linux_read_description): Call amd64_linux_read_description.
* Update comments in amd64_linux_core_read_descriptionYao Qi2017-09-052-3/+8
| | | | | | | | | gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * amd64-linux-tdep.c (amd64_linux_core_read_description): Update comments.
* [GDBserver] Shorten srv_i386_linux_xmlfilesYao Qi2017-09-052-1/+6
| | | | | | | | | | | | GDBserver now is able to generate target descriptions from features, so don't need to remember these target description files. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv (srv_i386_linux_xmlfiles): Remove i386/i386-XXX-linux.xml from it.
* [GDBserver] Use pre-generated tdesc as testYao Qi2017-09-056-87/+114
| | | | | | | | | | | | | | | | | | | Now, these *-generate.c files are only used in GDBserver for unit test. If $development is false (in release), these *-generate.c files won't be used at all. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * configure.srv: Set srv_i386_linux_regobj empty if $development is false. * linux-i386-ipa.c (initialize_low_tracepoint): Don't call initialize_low_tdesc. * linux-x86-low.c (initialize_low_arch): Wrap initialize_low_tdesc with #if initialize_low_tdesc. * linux-x86-tdesc-selftest.c: New file. * linux-x86-tdesc.c: Move code to linux-x86-tdesc-selftest.c.
* Remove features/i386/i386-*linux.cYao Qi2017-09-059-1118/+11
| | | | | | | | | | | | | | | | | Now, features/i386/i386-XXX-linux.c are not used, remove them. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * features/Makefile (XMLTOC): Remove i386/i386-XX-linux.xml. * features/i386/i386-avx-avx512-linux.c: Remove. * features/i386/i386-avx-linux.c: Remove. * features/i386/i386-avx-mpx-avx512-pku-linux.c: Remove. * features/i386/i386-avx-mpx-linux.c: Remove. * features/i386/i386-linux.c: Remove. * features/i386/i386-mmx-linux.c: Remove. * features/i386/i386-mpx-linux.c: Remove.
* Share i386-linux target description between GDB and GDBserverYao Qi2017-09-0515-77/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Dynamically composite xml in reply to GDBYao Qi2017-09-0515-39/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GDBserver still uses pre-generated target descriptions in order to reply to GDB's query on target description (see xml-builtin-generated.c in GDBserver build directory). This patch teaches GDBserver to create XML contents according to the target descriptions rather than using pre-generated ones. First, change target feature c files to pass the feature xml file name to tdesc_create_feature, so that target description in GDBserver can record them, and create XML contents from these features in buffer, like ... <xi:include href="$FEATURE1_XML_NAME"/> <xi:include href="$FEATURE2_XML_NAME"/> ... and send this buffer back to GDB. Note that this patch reuses target_desc.xmltarget a little bit, which is to hold the XML contents dynamically generated in tdesc_get_features_xml. However, it is not xfree'ed in ~target_desc, because we can't tell it is from xstrdup or a literal string. Since we don't delete target_desc, there is no memory leak yet. After we change all target descriptions to the new style, target_desc.xmltarget is from xstrdup, then, we can safely xfree it in ~target_desc. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * arch/tdesc.h (tdesc_create_feature): Add an argument xml. * target-descriptions.c (tdesc_create_feature): Likewise, and adjust code. * 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. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * linux-x86-tdesc.c: Don't include <inttypes.h>. (i386_linux_read_description) [!IN_PROCESS_AGENT]: Call set_tdesc_architecture and set_tdesc_osabi. Remove code setting .xmltarget. * server.c (get_features_xml): Call tdesc_get_features_xml. * tdesc.c (set_tdesc_architecture): New function. (set_tdesc_osabi): New function. (tdesc_get_features_xml): New function. (tdesc_create_feature): Add an argument. * tdesc.h (struct target_desc) <features>: New field. <arch, osabi>: New field. (~target_desc): xfree features, arch, and osabi. (target_desc::oerator==): Don't compare .xmltarget. [!IN_PROCESS_AGENT] (set_tdesc_architecture): Declare. (set_tdesc_osabi): Likewise. (tdesc_get_features_xml): Likewise.
* [GDBserver] unit test to i386_tdescYao Qi2017-09-055-1/+102
| | | | | | | | | | | | | | | | | | | | | This patch adds a unit test in GDBserver to test dynamically created target descriptions equal these pre-generated ones. gdb/gdbserver: 2017-09-05 Yao Qi <yao.qi@linaro.org> * linux-x86-tdesc.c: Include selftest.h. (i386_tdesc_test): New function. (initialize_low_tdesc): Call selftests::register_test. * tdesc.h: Include regdef.h. (target_desc): Override operator == and !=. gdb: 2017-09-05 Yao Qi <yao.qi@linaro.org> * regformats/regdef.h (struct reg): Override operator == and !=.