summaryrefslogtreecommitdiff
path: root/gdb/ax-general.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-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-11-08'struct agent_expr *' -> unique_ptr<agent_expr>Pedro Alves
This patch makes the gen_* functions return a unique_ptr instead of raw pointer: typedef gdb::unique_ptr<agent_expr> agent_expr_up; and then adjusts the codebase throughout to stop using make_cleanup_free_agent_expr. The cond_bytecode and cmd_bytecode fields of struct bp_location are owning pointers, so they're changed to be unique_ptr's instead of raw pointers. gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * ax-gdb.c (is_nontrivial_conversion): Use agent_expr_up. (gen_trace_for_var, gen_trace_for_expr, gen_eval_for_expr) (gen_trace_for_return_address, gen_printf): Use and return an agent_expr_up. Don't use make_cleanup_free_agent_expr. (agent_eval_command_one, maint_agent_printf_command): Use agent_expr_up. Don't use make_cleanup_free_agent_expr. * ax-gdb.h (gen_trace_for_expr, gen_trace_for_var) (gen_trace_for_return_address, gen_eval_for_expr, gen_printf): Use agent_expr_up. * ax-general.c (new_agent_expr): Rename to ... (agent_expr::agent_expr): ... this, and now a constructor. (free_agent_expr): Rename to ... (agent_expr::~agent_exp): ... this, and now a destructor. (do_free_agent_expr_cleanup, make_cleanup_free_agent_expr): Delete. * ax.h (struct agent_expr): Add ctor/dtor. (agent_expr_up): New typedef. (new_agent_expr, free_agent_expr, make_cleanup_free_agent_expr): Delete declarations. * breakpoint.c (parse_cond_to_aexpr): Use and return an agent_expr_up. Don't use make_cleanup_free_agent_expr. (build_target_condition_list): Adjust to use agent_expr_up. (parse_cmd_to_aexpr): Use and return an agent_expr_up. Don't use make_cleanup_free_agent_expr. (build_target_command_list): Adjust to use agent_expr_up. (force_breakpoint_reinsertion): Adjust to use agent_expr_up. (bp_location_dtor): Remove unnecessary free_agent_expr and xfree calls. * breakpoint.h (struct bp_target_info) <cond_bytecode, cmd_bytecode>: Now agent_expr_up's. * remote.c (remote_download_tracepoint): Adjust to use agent_expr_up and remove use of make_cleanup_free_agent_expr. * tracepoint.c (validate_actionline, collect_symbol): Adjust to use agent_expr_up and remove uses of make_cleanup_free_agent_expr. (collection_list::~collection_list): Call delete instead of free_agent_expr. (encode_actions_1): Adjust to use agent_expr_up and remove uses of make_cleanup_free_agent_expr. (add_aexpr): Change parameter type to agent_expr_up; Return a raw agent_expr pointer.
2016-02-25Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operationAntoine Tremblay
When encoding the agent expression operation ax_reg or ax_reg_mask, the register number used is internal to GDB. However GDBServer expects a tdesc based number. This usually does not cause a problem since at the moment, for raw registers GDBServer R trace action ignores the register mask and just collects all registers. It can be a problem, however with pseudo registers on some platforms if the tdesc number doesn't match the GDB internal register number. This is the case with ARM, the upcoming ARM tracepoint support, fails these test cases without this patch: gdb.trace/collection.exp: collect register locals collectively:* GDBSever would exit with: unhandled register size Since the register number is not mapped. This patch fixes these issues by calling gdbarch_remote_register_number before encoding the register number in the ax_reg or ax_reg_mask operation. Tested on x86 native-gdbserver no regressions observed. gdb/ChangeLog: * ax-general.c (ax_reg): Call gdbarch_remote_register_number. (ax_reg_mask): Likewise.
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-27Introduce ax_raw_byte and use itSimon Marchi
This patch was taken directly from Pedro's branch. ax_simple is used to append an agent expression operator to an agent expression string. Therefore, it takes an enum agent_op as input. There is an instance where it's called to append a raw byte, unrelated to the enum. It makes the build fail in C++ mode. This patch introduces ax_raw_byte for that purpose and uses it. gdb/ChangeLog: * ax.h (ax_raw_byte): New declaration. * ax-general.c (ax_raw_byte): New function. (ax_simple): Use ax_raw_byte. * ax-gdb.c (gen_printf): Likewise.
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-09-25Add casts to memory allocation related callsSimon Marchi
Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-08-26Replace some xmalloc-family functions with XNEW-family onesSimon Marchi
This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
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-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-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-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker
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-03-21 * tracepoint.h (decode_agent_options): Add 'trace_string'Tom Tromey
argument. * tracepoint.c (decode_agent_options): Add 'trace_string' argument. (validate_actionline): Update. (collect_symbol): Add 'trace_string' argument. (struct add_local_symbols_data) <trace_string>: New field. (do_collect_symbol): Update. (add_local_symbols): Add 'trace_string' argument. (encode_actions_1): Update. (trace_dump_actions): Update. * dwarf2loc.c (access_memory): Update. * ax.h (struct agent_expr) <tracing, trace_string>: New fields. * ax-general.c (new_agent_expr): Update. * ax-gdb.h (gen_trace_for_expr, gen_trace_for_var) (gen_trace_for_return_address): Add argument. (trace_kludge, trace_string_kludge): Remove. * ax-gdb.c (trace_kludge, trace_string_kludge): Remove. (gen_traced_pop, gen_fetch, gen_bitfield_ref, gen_expr): Update. (gen_trace_for_var): Add 'trace_string' argument. (gen_trace_for_expr, gen_trace_for_return_address): Likewise. (gen_printf, agent_eval_command_one): Update.
2013-03-07 * ax-gdb.c (gen_printf): Make FORMAT const.Keith Seitz
* ax-gdb.h (gen_printf): Likewise. * ax-general.c (ax_string): Make STR const. * ax.h (ax_string): Likewise.
2013-01-312013-01-31 Aleksandar Ristovski <aristovski@qnx.com>Aleksandar Ristovski
* auto-load.c (auto_load_expand_dir_vars): Remove unused dir_vec. * ax-gdb.c (gen_printf): Remove unused expr, i, bot, fr, flen, fmt. * ax-general.c (ax_print): Remove unused is_float. * blockframe.c (block_innermost_frame): Remove unused start, end. * break-catch-sig.c (catch_signal_command): Remove unused gdbarch. Reference: http://sourceware.org/ml/gdb-patches/2013-01/msg00752.html
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-07-02 Add target-side support for dynamic printf.Stan Shebs
* NEWS: Mention the additional style. * breakpoint.h (struct bp_target_info): New fields tcommands, persist. (struct bp_location): New field cmd_bytecode. * breakpoint.c: Include format.h. (disconnected_dprintf): New global. (parse_cmd_to_aexpr): New function. (build_target_command_list): New function. (insert_bp_location): Call it. (remove_breakpoints_pid): Skip dprintf breakpoints. (print_one_breakpoint_location): Ditto. (dprintf_style_agent): New global. (dprintf_style_enums): Add dprintf_style_agent. (update_dprintf_command_list): Add agent case. (agent_printf_command): New function. (_initialize_breakpoint): Add new commands. * common/ax.def (printf): New bytecode. * ax.h (ax_string): Declare. * ax-gdb.h (gen_printf): Declare. * ax-gdb.c: Include cli-utils.h, format.h. (gen_printf): New function. (maint_agent_print_command): New function. (_initialize_ax_gdb): Add maint agent-printf command. * ax-general.c (ax_string): New function. (ax_print): Add printf disassembly. * Makefile.in (SFILES): Add format.c (COMMON_OBS): Add format.o. * common/format.h: New file. * common/format.c: New file. * printcmd.c: Include format.h. (ui_printf): Call parse_format_string. * remote.c (remote_state): New field breakpoint_commands. (PACKET_BreakpointCommands): New enum. (remote_breakpoint_commands_feature): New function. (remote_protocol_features): Add new BreakpointCommands entry. (remote_can_run_breakpoint_commands): New function. (remote_add_target_side_commands): New function. (remote_insert_breakpoint): Call it. (remote_insert_hw_breakpoint): Ditto. (_initialize_remote): Add new packet configuration for target-side breakpoint commands. * target.h (struct target_ops): New field to_can_run_breakpoint_commands. (target_can_run_breakpoint_commands): New macro. * target.c (update_current_target): Handle to_can_run_breakpoint_commands. [gdbserver] * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define. (ax.o): Add it to build rule. (ax-ipa.o): Ditto. (OBS): Add format.o. (IPA_OBS): Add format.o. * server.c (handle_query): Claim support for breakpoint commands. (process_point_options): Add command case. (process_serial_event): Leave running if there are printfs in effect. * mem-break.h (any_persistent_commands): Declare. (add_breakpoint_commands): Declare. (gdb_no_commands_at_breakpoint): Declare. (run_breakpoint_commands): Declare. * mem-break.c (struct point_command_list): New struct. (struct breakpoint): New field command_list. (any_persistent_commands): New function. (add_commands_to_breakpoint): New function. (add_breakpoint_commands): New function. (gdb_no_commands_at_breakpoint): New function. (run_breakpoint_commands): New function. * linux-low.c (linux_wait_1): Test for and run breakpoint commands locally. * ax.c: Include format.h. (ax_printf): New function. (gdb_eval_agent_expr): Add printf opcode. [doc] * gdb.texinfo (Dynamic Printf): Mention agent style and disconnected dprintf. (Maintenance Commands): Describe maint agent-printf. (General Query Packets): Mention BreakpointCommands feature. (Packets): Document commands extension to Z0 packet. * agentexpr.texi (Bytecode Descriptions): Document printf bytecode. [testsuite] * gdb.base/dprintf.exp: Add agent style tests.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-02-24Revert the following change (not approved yet):Joel Brobecker
2011-02-21 Hui Zhu <teawater@gmail.com> * Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h. * ax-gdb.c (gen_printf_expr_callback): New function. * ax-gdb.h (gen_printf_expr_callback): Forward declare. * ax-general.c (ax_memcpy): New function. (ax_print): Handle "printf". (ax_reqs): Ditto. * ax.h (ax_memcpy): Forward declare. * common/ax.def (invalid2): Removed. (printf): New entry. * printcmd.c (printcmd.h): New include. (string_printf): New function. (ui_printf): Removed. (printf_command): Remove static. Call string_printf. (eval_command): Call string_printf. * printcmd.h: New file. * tracepoint.c (validate_actionline, encode_actions_1): handle printf_command.
2011-02-23 * ax-general.c (ax_pick): Add missing newline.Tom Tromey
2011-02-212011-02-21 Hui Zhu <teawater@gmail.com>Hui Zhu
* Makefile.in (HFILES_NO_SRCDIR): Add printcmd.h. * ax-gdb.c (gen_printf_expr_callback): New function. * ax-gdb.h (gen_printf_expr_callback): Forward declare. * ax-general.c (ax_memcpy): New function. (ax_print): Handle "printf". (ax_reqs): Ditto. * ax.h (ax_memcpy): Forward declare. * common/ax.def (invalid2): Removed. (printf): New entry. * printcmd.c (printcmd.h): New include. (string_printf): New function. (ui_printf): Removed. (printf_command): Remove static. Call string_printf. (eval_command): Call string_printf. * printcmd.h: New file. * tracepoint.c (validate_actionline, encode_actions_1): handle printf_command.
2011-02-18gdbTom Tromey
* common/ax.def: New file. * ax.h (enum agent_op): Use ax.def. * ax-general.c (aop_map): Use ax.def. gdbserver * Makefile.in (tracepoint-ipa.o): Depend on ax.def. (tracepoint.o): Likewise. * tracepoint.c (enum gdb_agent_op): Use ax.def. (gdb_agent_op_names): Likewise.
2011-02-18gdbTom Tromey
* ax-general.c (aop_map): Add pick and rot. * dwarf2loc.c (compile_dwarf_to_ax) <DW_OP_over>: Reimplement. <DW_OP_rot>: Implement. * ax.h (enum agent_op) <aop_pick, aop_rot>: New constants. (ax_pick): Declare. * ax-general.c (ax_pick): New function. doc * agentexpr.texi (Bytecode Descriptions): Document pick and rot. gdbserver * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick, gdb_agent_op_rot>: New constants. (gdb_agent_op_names): Add pick and roll. (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New cases.
2011-01-052011-01-05 Michael Snyder <msnyder@vmware.com>Michael Snyder
* addrmap.c: Shorten lines of >= 80 columns. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * ax-gdb.c: Ditto. * ax-general.c: Ditto. * bcache.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * buildsym.c: Ditto. * c-lang.c: Ditto. * c-typeprint.c: Ditto. * charset.c: Ditto. * coffread.c: Ditto. * command.h: Ditto. * corelow.c: Ditto. * cp-abi.c: Ditto. * cp-namespace.c: Ditto. * cp-support.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * defs.h: Ditto. * dfp.c: Ditto. * dfp.h: Ditto. * dictionary.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * eval.c: Ditto. * event-loop.c: Ditto. * event-loop.h: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-lang.c: Ditto. * f-valprint.c: Ditto. * findcmd.c: Ditto. * frame-base.c: Ditto. * frame-unwind.c: Ditto. * frame-unwind.h: Ditto. * frame.c: Ditto. * frame.h: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_dirent.h: Ditto. * gdb_obstack.h: Ditto. * gdbcore.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * inf-ttrace.c: Ditto. * infcall.c: Ditto. * infcmd.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * inline-frame.h: Ditto. * language.c: Ditto. * language.h: Ditto. * libunwind-frame.c: Ditto. * libunwind-frame.h: Ditto. * linespec.c: Ditto. * linux-nat.c: Ditto. * linux-nat.h: Ditto. * linux-thread-db.c: Ditto. * machoread.c: Ditto. * macroexp.c: Ditto. * macrotab.c: Ditto. * main.c: Ditto. * maint.c: Ditto. * mdebugread.c: Ditto. * memattr.c: Ditto. * minsyms.c: Ditto. * monitor.c: Ditto. * monitor.h: Ditto. * objfiles.c: Ditto. * objfiles.h: Ditto. * osabi.c: Ditto. * p-typeprint.c: Ditto. * p-valprint.c: Ditto. * parse.c: Ditto. * printcmd.c: Ditto. * proc-events.c: Ditto. * procfs.c: Ditto. * progspace.c: Ditto. * progspace.h: Ditto. * psympriv.h: Ditto. * psymtab.c: Ditto. * record.c: Ditto. * regcache.c: Ditto. * regcache.h: Ditto. * remote-fileio.c: Ditto. * remote.c: Ditto. * ser-mingw.c: Ditto. * ser-tcp.c: Ditto. * ser-unix.c: Ditto. * serial.c: Ditto. * serial.h: Ditto. * solib-frv.c: Ditto. * solib-irix.c: Ditto. * solib-osf.c: Ditto. * solib-pa64.c: Ditto. * solib-som.c: Ditto. * solib-sunos.c: Ditto. * solib-svr4.c: Ditto. * solib-target.c: Ditto. * solib.c: Ditto. * somread.c: Ditto. * source.c: Ditto. * stabsread.c: Ditto. * stabsread.c: Ditto. * stack.c: Ditto. * stack.h: Ditto. * symfile-mem.c: Ditto. * symfile.c: Ditto. * symfile.h: Ditto. * symmisc.c: Ditto. * symtab.c: Ditto. * symtab.h: Ditto. * target-descriptions.c: Ditto. * target-memory.c: Ditto. * target.c: Ditto. * target.h: Ditto. * terminal.h: Ditto. * thread.c: Ditto. * top.c: Ditto. * tracepoint.c: Ditto. * tracepoint.h: Ditto. * ui-file.c: Ditto. * ui-file.h: Ditto. * ui-out.h: Ditto. * user-regs.c: Ditto. * user-regs.h: Ditto. * utils.c: Ditto. * valarith.c: Ditto. * valops.c: Ditto. * valprint.c: Ditto. * valprint.h: Ditto. * value.c: Ditto. * varobj.c: Ditto. * varobj.h: Ditto. * vec.h: Ditto. * xcoffread.c: Ditto. * xcoffsolib.c: Ditto. * xcoffsolib.h: Ditto. * xml-syscall.c: Ditto. * xml-tdesc.c: Ditto.
2011-01-01run copyright.sh for 2011.Joel Brobecker
2010-12-312010-12-31 Michael Snyder <msnyder@vmware.com>Michael Snyder
* annotate.c: Comment cleanup, shorten long lines. * arch-utils.c: Ditto. * arch-utils.h: Ditto. * auxv.c: Ditto. * auxv.h: Ditto. * ax-gdb.c: Ditto. * ax-gdb.h: Ditto. * ax-general.c: Ditto. * breakpoint.h: Ditto. * buildsym.h: Ditto.
2010-12-282010-12-28 Hui Zhu <teawater@gmail.com>Hui Zhu
* gdbarch.sh (ax_pseudo_register_collect, ax_pseudo_register_push_stack): new callbacks. (agent_expr): Forward declare. * gdbarch.h, gdbarch.c: Regenerate. * ax-gdb.c (gen_expr): Remove pseudo-register check code. * ax-general.c (user-regs.h): New include. (ax_reg): Call gdbarch_ax_pseudo_register_push_stack. (ax_reg_mask): Call gdbarch_ax_pseudo_register_collect. * mips-tdep.c (ax.h): New include. (mips_ax_pseudo_register_collect, mips_ax_pseudo_register_push_stack): New functions. (mips_gdbarch_init): Set mips_ax_pseudo_register_collect and mips_ax_pseudo_register_push_stack.
2010-04-232010-04-23 Stan Shebs <stan@codesourcery.com>Stan Shebs
* ax.h (struct agent_expr): Merge in agent_reqs fields, add some comments. (struct agent_reqs): Remove. (ax_reg_mask): Declare. * ax-general.c (new_agent_expr): Add gdbarch argument, set new fields. (free_agent_expr): Free reg_mask. (ax_print): Add scope and register mask info. (ax_reqs): Remove agent_reqs argument, use agent expression fields, and move part of register mask computation to... (ax_reg_mask): New function. * ax-gdb.c (gen_trace_static_fields): Call it. (gen_traced_pop): Ditto. (is_nontrivial_conversion): Add dummy gdbarch to new_agent_expr. (gen_trace_for_var): Pass gdbarch to new_agent_expr. (gen_trace_for_expr): Ditto, and clear optimized_out flag. (gen_eval_for_expr): Ditto, and require an rvalue. (agent_command): Call ax_reqs. (agent_eval_command): Ditto. * tracepoint.c (report_agent_reqs_errors): Use agent expression fields. (validate_action_line): Ditto. (collect_symbol): Ditto. (encode_actions_1): Ditto.
2010-03-192010-03-19 Stan Shebs <stan@codesourcery.com>Stan Shebs
* ax-general.c (ax_const_l): Fix a sizing bug.
2010-01-01Update copyright year in most headers.Joel Brobecker
Automatic update by copyright.sh.
2009-12-282009-12-28 Stan Shebs <stan@codesourcery.com>Stan Shebs
Add trace state variables. * ax.h (enum agent_op): Add getv, setv, and tracev. (ax_tsv): Declare. * ax-gdb.c: Include tracepoint.h. (gen_expr): Handle BINOP_ASSIGN, BINOP_ASSIGN_MODIFY, and OP_INTERNALVAR. (gen_expr_binop_rest): New function, split from gen_expr. * ax-general.c (ax_tsv): New function. (aop_map): Add new bytecodes. * tracepoint.h (struct trace_state_variable): New struct. (tsv_s): New typedef. (find_trace_state_variable): Declare. * tracepoint.c (tvariables): New global. (next_tsv_number): New global. (create_trace_state_variable): New function. (find_trace_state_variable): New function. (delete_trace_state_variable): New function. (trace_variable_command): New function. (delete_trace_variable_command): New function. (tvariables_info): New function. (trace_start_command): Download tsvs with initial values. (_initialize_tracepoint): Add new commands. * NEWS: Mention the addition of trace state variables. ==> doc/ChangeLog <== 2009-12-28 Stan Shebs <stan@codesourcery.com> * gdb.texinfo (Trace State Variables): New section. (Tracepoint Packets): Describe trace state variable packets. * agentexpr.texi (Bytecode Descriptions): Describe trace state variable bytecodes. ==> testsuite/ChangeLog <== 2009-12-28 Stan Shebs <stan@codesourcery.com> * gdb.trace/tsv.exp: New file. * gdb.base/completion.exp: Update ambiguous info output.
2009-01-03 Updated copyright notices for most files.Joel Brobecker
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz
2007-08-23 Switch the license of all .c files to GPLv3.Joel Brobecker
Switch the license of all .h files to GPLv3. Switch the license of all .cc files to GPLv3.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz
2007-01-07* ax-general.c (ax_const_l): Select proper opcode for the givenJim Blandy
value.
2005-12-17 * breakpoint.c:Eli Zaretskii
* arm-tdep.c: * ia64-tdep.c: * i386-tdep.c: * hpread.c: * hppa-tdep.c: * hppa-hpux-tdep.c: * gnu-nat.c: * gdbtypes.c: * gdbarch.h: * gdbarch.c: * eval.c: * dwarf2read.c: * dbxread.c: * copying: * symfile.c: * stabsread.c: * sh64-tdep.c: * sh-tdep.c: * s390-tdep.c: * rs6000-tdep.c: * remote.c: * remote-mips.c: * mips-tdep.c: * mdebugread.c: * linux-nat.c: * infrun.c: * xcoffread.c: * win32-nat.c: * valops.c: * utils.c: * tracepoint.c: * target.c: * symtab.c: * c-exp.y: * ada-valprint.c: * ada-typeprint.c: * ada-lex.l: * ada-lang.h: * ada-lang.c: * ada-exp.y: * alphafbsd-tdep.c: * alphabsd-tdep.h: * alphabsd-tdep.c: * alphabsd-nat.c: * alpha-tdep.h: * alpha-tdep.c: * alpha-osf1-tdep.c: * alpha-nat.c: * alpha-mdebug-tdep.c: * alpha-linux-tdep.c: * alpha-linux-nat.c: * aix-thread.c: * abug-rom.c: * arch-utils.c: * annotate.h: * annotate.c: * amd64obsd-tdep.c: * amd64obsd-nat.c: * amd64nbsd-tdep.c: * amd64nbsd-nat.c: * amd64fbsd-tdep.c: * amd64fbsd-nat.c: * amd64bsd-nat.c: * amd64-tdep.h: * amd64-tdep.c: * amd64-sol2-tdep.c: * amd64-nat.h: * amd64-nat.c: * amd64-linux-tdep.c: * amd64-linux-nat.c: * alphanbsd-tdep.c: * block.h: * block.c: * bfd-target.h: * bfd-target.c: * bcache.h: * bcache.c: * ax.h: * ax-general.c: * ax-gdb.h: * ax-gdb.c: * avr-tdep.c: * auxv.h: * auxv.c: * armnbsd-tdep.c: * armnbsd-nat.c: * arm-tdep.h: * arm-linux-nat.c: * arch-utils.h: * charset.c: * call-cmds.h: * c-valprint.c: * c-typeprint.c: * c-lang.h: * c-lang.c: * buildsym.h: * buildsym.c: * bsd-uthread.h: * bsd-uthread.c: * bsd-kvm.h: * bsd-kvm.c: * breakpoint.h: * core-regset.c: * core-aout.c: * completer.h: * completer.c: * complaints.h: * complaints.c: * command.h: * coffread.c: * coff-solib.h: * coff-solib.c: * coff-pe-read.h: * coff-pe-read.c: * cli-out.h: * cli-out.c: * charset.h: * dink32-rom.c: * dictionary.h: * dictionary.c: * demangle.c: * defs.h: * dcache.h: * dcache.c: * d10v-tdep.c: * cpu32bug-rom.c: * cp-valprint.c: * cp-support.h: * cp-support.c: * cp-namespace.c: * cp-abi.h: * cp-abi.c: * corelow.c: * corefile.c: * environ.c: * elfread.c: * dwarfread.c: * dwarf2loc.c: * dwarf2expr.h: * dwarf2expr.c: * dwarf2-frame.h: * dwarf2-frame.c: * dve3900-rom.c: * dummy-frame.h: * dummy-frame.c: * dsrec.c: * doublest.h: * doublest.c: * disasm.h: * disasm.c: * fork-child.c: * findvar.c: * fbsd-nat.h: * fbsd-nat.c: * f-valprint.c: * f-typeprint.c: * f-lang.h: * f-lang.c: * expression.h: * expprint.c: * exec.h: * exec.c: * exceptions.h: * exceptions.c: * event-top.h: * event-top.c: * event-loop.h: * event-loop.c: * gdb.c: * gdb-stabs.h: * gdb-events.h: * gdb-events.c: * gcore.c: * frv-tdep.h: * frv-tdep.c: * frv-linux-tdep.c: * frame.h: * frame.c: * frame-unwind.h: * frame-unwind.c: * frame-base.h: * frame-base.c: * gdb_vfork.h: * gdb_thread_db.h: * gdb_string.h: * gdb_stat.h: * gdb_regex.h: * gdb_ptrace.h: * gdb_proc_service.h: * gdb_obstack.h: * gdb_locale.h: * gdb_dirent.h: * gdb_curses.h: * gdb_assert.h: * gdbarch.sh: * gdb.h: * hpux-thread.c: * hppabsd-nat.c: * hppa-tdep.h: * hpacc-abi.c: * h8300-tdep.c: * gregset.h: * go32-nat.c: * gnu-v3-abi.c: * gnu-v2-abi.h: * gnu-v2-abi.c: * gnu-nat.h: * glibc-tdep.c: * gdbtypes.h: * gdbcore.h: * gdbcmd.h: * i386nbsd-tdep.c: * i386nbsd-nat.c: * i386gnu-tdep.c: * i386gnu-nat.c: * i386fbsd-tdep.c: * i386fbsd-nat.c: * i386bsd-tdep.c: * i386bsd-nat.h: * i386bsd-nat.c: * i386-tdep.h: * i386-sol2-nat.c: * i386-nto-tdep.c: * i386-nat.c: * i386-linux-tdep.h: * i386-linux-tdep.c: * i386-linux-nat.c: * i386-cygwin-tdep.c: * inf-ttrace.c: * inf-ptrace.h: * inf-ptrace.c: * inf-loop.h: * inf-loop.c: * inf-child.h: * inf-child.c: * ia64-tdep.h: * ia64-linux-nat.c: * i387-tdep.h: * i387-tdep.c: * i386v4-nat.c: * i386v-nat.c: * i386obsd-tdep.c: * i386obsd-nat.c: * kod.c: * jv-valprint.c: * jv-typeprint.c: * jv-lang.h: * jv-lang.c: * irix5-nat.c: * iq2000-tdep.c: * interps.h: * interps.c: * inftarg.c: * inflow.h: * inflow.c: * inferior.h: * infcmd.c: * infcall.h: * infcall.c: * inf-ttrace.h: * m32r-tdep.h: * m32r-tdep.c: * m32r-rom.c: * m32r-linux-tdep.c: * m32r-linux-nat.c: * m2-valprint.c: * m2-typeprint.c: * m2-lang.h: * m2-lang.c: * lynx-nat.c: * linux-thread-db.c: * linux-nat.h: * linespec.c: * libunwind-frame.h: * libunwind-frame.c: * language.h: * language.c: * macroexp.c: * macrocmd.c: * m88kbsd-nat.c: * m88k-tdep.h: * m88k-tdep.c: * m68klinux-tdep.c: * m68klinux-nat.c: * m68kbsd-tdep.c: * m68kbsd-nat.c: * m68k-tdep.h: * m68k-tdep.c: * mips-linux-nat.c: * mips-irix-tdep.c: * minsyms.c: * memattr.h: * memattr.c: * mem-break.c: * mdebugread.h: * main.h: * main.c: * macrotab.h: * macrotab.c: * macroscope.h: * macroscope.c: * macroexp.h: * nbsd-tdep.c: * mt-tdep.c: * monitor.h: * monitor.c: * mn10300-tdep.h: * mn10300-tdep.c: * mn10300-linux-tdep.c: * mipsv4-nat.c: * mipsread.c: * mipsnbsd-tdep.h: * mipsnbsd-tdep.c: * mipsnbsd-nat.c: * mips64obsd-tdep.c: * mips64obsd-nat.c: * mips-tdep.h: * mips-mdebug-tdep.c: * mips-linux-tdep.c: * osabi.h: * osabi.c: * ocd.h: * ocd.c: * observer.c: * objfiles.h: * objfiles.c: * objc-lang.h: * objc-lang.c: * objc-exp.y: * nto-tdep.h: * nto-tdep.c: * nto-procfs.c: * nlmread.c: * nbsd-tdep.h: * ppcobsd-tdep.c: * ppcobsd-nat.c: * ppcnbsd-tdep.h: * ppcnbsd-tdep.c: * ppcnbsd-nat.c: * ppcbug-rom.c: * ppc-tdep.h: * ppc-sysv-tdep.c: * ppc-linux-tdep.c: * ppc-linux-nat.c: * ppc-bdm.c: * parser-defs.h: * parse.c: * p-valprint.c: * p-typeprint.c: * p-lang.h: * p-lang.c: * remote-fileio.h: * remote-fileio.c: * remote-est.c: * remote-e7000.c: * regset.h: * regset.c: * reggroups.h: * reggroups.c: * regcache.h: * regcache.c: * proc-why.c: * proc-service.c: * proc-events.c: * printcmd.c: * ppcobsd-tdep.h: * sentinel-frame.h: * sentinel-frame.c: * scm-valprint.c: * scm-tags.h: * scm-lang.h: * scm-lang.c: * scm-exp.c: * s390-tdep.h: * rom68k-rom.c: * remote.h: * remote-utils.c: * remote-st.c: * remote-sim.c: * remote-sds.c: * remote-rdp.c: * remote-rdi.c: * remote-hms.c: * sim-regno.h: * shnbsd-tdep.h: * shnbsd-tdep.c: * shnbsd-nat.c: * sh-tdep.h: * serial.h: * serial.c: * ser-unix.h: * ser-unix.c: * ser-tcp.c: * ser-pipe.c: * ser-go32.c: * ser-e7kpc.c: * ser-base.h: * ser-base.c: * solib.c: * solib-svr4.h: * solib-svr4.c: * solib-sunos.c: * solib-som.h: * solib-som.c: * solib-pa64.h: * solib-pa64.c: * solib-osf.c: * solib-null.c: * solib-legacy.c: * solib-irix.c: * solib-frv.c: * solib-aix5.c: * sol-thread.c: * sparc64-linux-tdep.c: * sparc64-linux-nat.c: * sparc-tdep.h: * sparc-tdep.c: * sparc-sol2-tdep.c: * sparc-sol2-nat.c: * sparc-nat.h: * sparc-nat.c: * sparc-linux-tdep.c: * sparc-linux-nat.c: * source.h: * source.c: * somread.c: * solist.h: * solib.h: * std-regs.c: * stack.h: * stack.c: * stabsread.h: * sparcobsd-tdep.c: * sparcnbsd-tdep.c: * sparcnbsd-nat.c: * sparc64obsd-tdep.c: * sparc64nbsd-tdep.c: * sparc64nbsd-nat.c: * sparc64fbsd-tdep.c: * sparc64fbsd-nat.c: * sparc64-tdep.h: * sparc64-tdep.c: * sparc64-sol2-tdep.c: * sparc64-nat.c: * ui-file.c: * typeprint.h: * typeprint.c: * tramp-frame.h: * tramp-frame.c: * trad-frame.h: * trad-frame.c: * tracepoint.h: * top.c: * tobs.inc: * thread.c: * terminal.h: * target.h: * symfile.h: * stop-gdb.c: * vaxbsd-nat.c: * vax-tdep.h: * vax-tdep.c: * vax-nat.c: * varobj.h: * varobj.c: * value.h: * value.c: * valprint.h: * valprint.c: * v850-tdep.c: * uw-thread.c: * user-regs.c: * ui-out.h: * ui-out.c: * ui-file.h: * xcoffsolib.h: * xcoffsolib.c: * wrapper.c: * wince.c: * wince-stub.h: * wince-stub.c: * vaxobsd-tdep.c: * vaxnbsd-tdep.c: * gdb_gcore.sh: * copying.c: * configure.ac: * aclocal.m4: * acinclude.m4: * reply_mig_hack.awk: * observer.sh: * gdb_mbuild.sh: * arm-linux-tdep.c: * blockframe.c: * dbug-rom.c: * environ.h: * dwarf2loc.h: * gdb-events.sh: * glibc-tdep.h: * gdb_wait.h: * gdbthread.h: * i386-sol2-tdep.c: * hppabsd-tdep.c: * hppa-linux-nat.c: * hppa-hpux-nat.c: * ia64-linux-tdep.c: * infptrace.c: * linespec.h: * maint.c: * mips-mdebug-tdep.h: * remote-m32r-sdi.c: * s390-nat.c: * rs6000-nat.c: * remote-utils.h: * sh3-rom.c: * sh-linux-tdep.c: * top.h: * symtab.h: * symmisc.c: * symfile-mem.c: * srec.h: * user-regs.h: * version.h: * valarith.c: * xstormy16-tdep.c: * wrapper.h: * Makefile.in: * f-exp.y: * cris-tdep.c: * cp-name-parser.y: * procfs.c: * proc-utils.h: * proc-flags.c: * proc-api.c: * p-exp.y: * m68hc11-tdep.c: * m2-exp.y: * kod.h: * kod-cisco.c: * jv-exp.y: * hppa-linux-tdep.c: Add (c) after Copyright. Update the FSF address.
2005-12-072005-12-07 Jim Blandy <jimb@redhat.com>Jim Blandy
* ax-general.c (ax_reqs): Check stack heights for backward jumps, too. Correctly check height at target. Doc fixes.
2005-01-292005-01-29 Baurzhan Ismagulov <ibr@radix50.net>Baurzhan Ismagulov
* ax-gdb.c, ax-general.c, bcache.c, bfd-target.c, bsd-kvm.c, * buildsym.c, c-lang.c, c-typeprint.c, c-valprint.c, charset.c, * coff-pe-read.c, coffread.c, complaints.c, copying.c: I18n markup.
2002-08-02Fri Aug 2 15:53:50 2002 Andrew Cagney <cagney@redhat.com>Andrew Cagney
* gdbarch.sh: Include "gdb_string.h". * gdbarch.c: Regenerate. * regcache.c: Include "gdb_string.h". * ax-general.c: Ditto. * varobj.c: Ditto. * std-regs.c: Ditto. * fbsd-proc.c: Ditto. * thread.c: Ditto. * Makefile.in (regcache.o): Update dependencies. (thread.o, gdbarch.o): Ditto. (ax-general.o, gdbarch.o): Ditto. (varobj.o, std-regs.o): Ditto. (fbsd-proc.o): Specify dependencies.
2001-03-06Update/correct copyright notices.Kevin Buettner
2000-12-15Replace free() with xfree().Kevin Buettner
2000-07-30Protoization.Kevin Buettner
2000-05-28PARAMS removal.Kevin Buettner
2000-05-15Cleanup free_agent_expr cleanups.Andrew Cagney
2000-02-02import gdb-2000-02-01 snapshotJason Molenda
1999-07-07import gdb-1999-07-07 post reformatJason Molenda
1999-05-25import gdb-1999-05-25 snapshotJason Molenda