This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Replace some xmalloc-family functions with XNEW-family ones


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8d7493201cf01c9836403695f67f7e157341bfd5

commit 8d7493201cf01c9836403695f67f7e157341bfd5
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Wed Aug 26 17:16:07 2015 -0400

    Replace some xmalloc-family functions with XNEW-family ones
    
    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.

Diff:
---
 gdb/ChangeLog                     | 338 ++++++++++++++++++++++++++++++++++++++
 gdb/aarch64-linux-nat.c           |   2 +-
 gdb/aarch64-tdep.c                |   2 +-
 gdb/ada-exp.y                     |   4 +-
 gdb/ada-lang.c                    |   9 +-
 gdb/addrmap.c                     |   4 +-
 gdb/aix-thread.c                  |   8 +-
 gdb/alpha-tdep.c                  |   5 +-
 gdb/amd64-windows-tdep.c          |   4 +-
 gdb/arm-linux-nat.c               |   2 +-
 gdb/arm-linux-tdep.c              |   3 +-
 gdb/arm-tdep.c                    |  12 +-
 gdb/avr-tdep.c                    |   2 +-
 gdb/ax-general.c                  |   2 +-
 gdb/block.c                       |   3 +-
 gdb/breakpoint.c                  |  25 ++-
 gdb/btrace.c                      |   6 +-
 gdb/buildsym.c                    |  18 +-
 gdb/cli/cli-cmds.c                |   2 +-
 gdb/cli/cli-decode.c              |   3 +-
 gdb/cli/cli-script.c              |  27 +--
 gdb/cli/cli-setshow.c             |   4 +-
 gdb/coff-pe-read.c                |   3 +-
 gdb/coffread.c                    |  11 +-
 gdb/common/cleanups.c             |   3 +-
 gdb/common/common-exceptions.c    |   5 +-
 gdb/common/filestuff.c            |   2 +-
 gdb/common/format.c               |   3 +-
 gdb/common/queue.h                |   6 +-
 gdb/compile/compile-object-load.c |   4 +-
 gdb/compile/compile-object-run.c  |   2 +-
 gdb/compile/compile.c             |   2 +-
 gdb/corefile.c                    |   3 +-
 gdb/cp-support.c                  |   3 +-
 gdb/cris-tdep.c                   |   5 +-
 gdb/ctf.c                         |   3 +-
 gdb/dbxread.c                     |  27 ++-
 gdb/dcache.c                      |   4 +-
 gdb/dictionary.c                  |  14 +-
 gdb/dtrace-probe.c                |   4 +-
 gdb/dummy-frame.c                 |   2 +-
 gdb/dwarf2-frame-tailcall.c       |   4 +-
 gdb/dwarf2-frame.c                |  11 +-
 gdb/dwarf2expr.c                  |   5 +-
 gdb/dwarf2loc.c                   |   2 +-
 gdb/dwarf2read.c                  | 169 +++++++++----------
 gdb/elfread.c                     |   4 +-
 gdb/environ.c                     |   2 +-
 gdb/eval.c                        |   5 +-
 gdb/event-loop.c                  |  11 +-
 gdb/exec.c                        |   2 +-
 gdb/fbsd-nat.c                    |   4 +-
 gdb/fork-child.c                  |   2 +-
 gdb/frv-tdep.c                    |   5 +-
 gdb/gdbarch.c                     |   4 +-
 gdb/gdbarch.h                     |   2 +-
 gdb/gdbarch.sh                    |   4 +-
 gdb/gdbserver/ChangeLog           |  55 +++++++
 gdb/gdbserver/ax.c                |   4 +-
 gdb/gdbserver/dll.c               |   3 +-
 gdb/gdbserver/event-loop.c        |   8 +-
 gdb/gdbserver/hostio.c            |   2 +-
 gdb/gdbserver/inferiors.c         |   8 +-
 gdb/gdbserver/linux-aarch64-low.c |   2 +-
 gdb/gdbserver/linux-arm-low.c     |   4 +-
 gdb/gdbserver/linux-low.c         |  29 ++--
 gdb/gdbserver/linux-mips-low.c    |   6 +-
 gdb/gdbserver/linux-x86-low.c     |   4 +-
 gdb/gdbserver/lynx-low.c          |   2 +-
 gdb/gdbserver/mem-break.c         |  18 +-
 gdb/gdbserver/regcache.c          |   3 +-
 gdb/gdbserver/remote-utils.c      |   2 +-
 gdb/gdbserver/server.c            |   9 +-
 gdb/gdbserver/spu-low.c           |   4 +-
 gdb/gdbserver/target.c            |   2 +-
 gdb/gdbserver/thread-db.c         |   4 +-
 gdb/gdbserver/tracepoint.c        |  27 ++-
 gdb/gdbserver/win32-low.c         |   4 +-
 gdb/gdbtypes.c                    |   8 +-
 gdb/gnu-nat.c                     |   8 +-
 gdb/gnu-v3-abi.c                  |   6 +-
 gdb/guile/scm-param.c             |   3 +-
 gdb/guile/scm-utils.c             |   4 +-
 gdb/guile/scm-value.c             |   2 +-
 gdb/h8300-tdep.c                  |   2 +-
 gdb/ia64-tdep.c                   |   2 +-
 gdb/infcall.c                     |   6 +-
 gdb/infcmd.c                      |  10 +-
 gdb/inferior.c                    |   2 +-
 gdb/infrun.c                      |  22 +--
 gdb/jit.c                         |   7 +-
 gdb/language.c                    |   3 +-
 gdb/linespec.c                    |   2 +-
 gdb/linux-nat.c                   |   4 +-
 gdb/linux-thread-db.c             |   8 +-
 gdb/m32c-tdep.c                   |   2 +-
 gdb/m68hc11-tdep.c                |   2 +-
 gdb/m68k-tdep.c                   |   2 +-
 gdb/m88k-tdep.c                   |   8 +-
 gdb/macrocmd.c                    |   2 +-
 gdb/macroexp.c                    |   2 +-
 gdb/macroscope.c                  |   2 +-
 gdb/macrotab.c                    |   4 +-
 gdb/mdebugread.c                  |  13 +-
 gdb/mep-tdep.c                    |   2 +-
 gdb/mi/mi-main.c                  |   3 +-
 gdb/mi/mi-parse.c                 |   2 +-
 gdb/minidebug.c                   |   2 +-
 gdb/mips-linux-nat.c              |   3 +-
 gdb/mips-tdep.c                   |   2 +-
 gdb/mn10300-tdep.c                |   2 +-
 gdb/msp430-tdep.c                 |   2 +-
 gdb/mt-tdep.c                     |   2 +-
 gdb/nat/aarch64-linux.c           |   2 +-
 gdb/nat/linux-btrace.c            |   4 +-
 gdb/nat/linux-osdata.c            |   4 +-
 gdb/nios2-tdep.c                  |   2 +-
 gdb/nto-procfs.c                  |   2 +-
 gdb/objc-lang.c                   |  10 +-
 gdb/objfiles.c                    |   4 +-
 gdb/osabi.c                       |   6 +-
 gdb/parse.c                       |   2 +-
 gdb/ppc-linux-nat.c               |   7 +-
 gdb/printcmd.c                    |   4 +-
 gdb/procfs.c                      |  10 +-
 gdb/prologue-value.c              |   4 +-
 gdb/psymtab.c                     |  13 +-
 gdb/python/py-inferior.c          |   2 +-
 gdb/python/py-param.c             |   3 +-
 gdb/python/py-value.c             |   2 +-
 gdb/python/py-varobj.c            |   2 +-
 gdb/python/python.c               |   2 +-
 gdb/record-btrace.c               |   2 +-
 gdb/record-full.c                 |  10 +-
 gdb/regcache.c                    |   2 +-
 gdb/remote-fileio.c               |   2 +-
 gdb/remote-notif.c                |   2 +-
 gdb/remote.c                      |   8 +-
 gdb/reverse.c                     |   2 +-
 gdb/rl78-tdep.c                   |   2 +-
 gdb/rx-tdep.c                     |   2 +-
 gdb/s390-linux-nat.c              |   2 +-
 gdb/ser-go32.c                    |   4 +-
 gdb/ser-mingw.c                   |  14 +-
 gdb/ser-unix.c                    |   7 +-
 gdb/solib-aix.c                   |   2 +-
 gdb/solib-dsbt.c                  |   6 +-
 gdb/solib-frv.c                   |   6 +-
 gdb/solib-spu.c                   |   2 +-
 gdb/solib-svr4.c                  |   8 +-
 gdb/source.c                      |   8 +-
 gdb/spu-linux-nat.c               |   2 +-
 gdb/spu-tdep.c                    |   2 +-
 gdb/stabsread.c                   |  41 ++---
 gdb/stack.c                       |   3 +-
 gdb/stap-probe.c                  |   2 +-
 gdb/symfile.c                     |  14 +-
 gdb/symtab.c                      |  15 +-
 gdb/target.c                      |   2 +-
 gdb/thread.c                      |  11 +-
 gdb/tic6x-tdep.c                  |   2 +-
 gdb/top.c                         |   2 +-
 gdb/tracefile-tfile.c             |   2 +-
 gdb/tracepoint.c                  |  19 ++-
 gdb/tui/tui-data.c                |  12 +-
 gdb/tui/tui-disasm.c              |   6 +-
 gdb/ui-file.c                     |   6 +-
 gdb/utils.c                       |   7 +-
 gdb/v850-tdep.c                   |   2 +-
 gdb/valops.c                      |   3 +-
 gdb/value.c                       |  10 +-
 gdb/varobj.c                      |  16 +-
 gdb/windows-nat.c                 |   2 +-
 gdb/x86-nat.c                     |   4 +-
 gdb/xcoffread.c                   |  32 ++--
 gdb/xml-support.c                 |   2 +-
 gdb/xtensa-tdep.c                 |   3 +-
 177 files changed, 906 insertions(+), 675 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b9493e4..154228f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,341 @@
+2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* 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.
+
 2015-08-25  Don Breazeal  <donb@codesourcery.com>
 
 	* infrun.c (follow_exec): Re-order operations for
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index f6edb68..9747461 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -90,7 +90,7 @@ aarch64_add_process (pid_t pid)
 {
   struct aarch64_process_info *proc;
 
-  proc = xcalloc (1, sizeof (*proc));
+  proc = XCNEW (struct aarch64_process_info);
   proc->pid = pid;
 
   proc->next = aarch64_process_list;
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index c722dc5..9a44446 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -2773,7 +2773,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       return best_arch->gdbarch;
     }
 
-  tdep = xcalloc (1, sizeof (struct gdbarch_tdep));
+  tdep = XCNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   /* This should be low enough for everything.  */
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 2b671d4..1c45bcb 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1163,8 +1163,8 @@ static void
 write_ambiguous_var (struct parser_state *par_state,
 		     const struct block *block, char *name, int len)
 {
-  struct symbol *sym =
-    obstack_alloc (&temp_parse_space, sizeof (struct symbol));
+  struct symbol *sym = XOBNEW (&temp_parse_space, struct symbol);
+
   memset (sym, 0, sizeof (struct symbol));
   SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
   SYMBOL_LINKAGE_NAME (sym) = obstack_copy0 (&temp_parse_space, name, len);
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 4d7d22e..7e6b6dc 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -3300,7 +3300,7 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
       error (_("Unexpected operator during name resolution"));
     }
 
-  argvec = (struct value * *) alloca (sizeof (struct value *) * (nargs + 1));
+  argvec = XALLOCAVEC (struct value *, nargs + 1);
   for (i = 0; i < nargs; i += 1)
     argvec[i] = resolve_subexp (expp, pos, 1, NULL);
   argvec[i] = NULL;
@@ -3741,7 +3741,7 @@ int
 user_select_syms (struct block_symbol *syms, int nsyms, int max_results)
 {
   int i;
-  int *chosen = (int *) alloca (sizeof (int) * nsyms);
+  int *chosen = XALLOCAVEC (int , nsyms);
   int n_chosen;
   int first_choice = (max_results == 1) ? 1 : 2;
   const char *select_mode = multiple_symbols_select_mode ();
@@ -9790,7 +9790,7 @@ assign_aggregate (struct value *container,
 
   num_specs = num_component_specs (exp, *pos - 3);
   max_indices = 4 * num_specs + 4;
-  indices = alloca (max_indices * sizeof (indices[0]));
+  indices = XALLOCAVEC (LONGEST, max_indices);
   indices[0] = indices[1] = low_index - 1;
   indices[2] = indices[3] = high_index + 1;
   num_indices = 4;
@@ -10600,8 +10600,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       /* Allocate arg vector, including space for the function to be
          called in argvec[0] and a terminating NULL.  */
       nargs = longest_to_int (exp->elts[pc + 1].longconst);
-      argvec =
-        (struct value **) alloca (sizeof (struct value *) * (nargs + 2));
+      argvec = XALLOCAVEC (struct value *, nargs + 2);
 
       if (exp->elts[*pos].opcode == OP_VAR_VALUE
           && SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index 4eb08cd..a124aea 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -244,7 +244,7 @@ struct addrmap_mutable
 static splay_tree_key
 allocate_key (struct addrmap_mutable *map, CORE_ADDR addr)
 {
-  CORE_ADDR *key = obstack_alloc (map->obstack, sizeof (*key));
+  CORE_ADDR *key = XOBNEW (map->obstack, CORE_ADDR);
 
   *key = addr;
   return (splay_tree_key) key;
@@ -567,7 +567,7 @@ splay_compare_CORE_ADDR_ptr (splay_tree_key ak, splay_tree_key bk)
 struct addrmap *
 addrmap_create_mutable (struct obstack *obstack)
 {
-  struct addrmap_mutable *map = obstack_alloc (obstack, sizeof (*map));
+  struct addrmap_mutable *map = XOBNEW (obstack, struct addrmap_mutable);
 
   map->addrmap.funcs = &addrmap_mutable_funcs;
   map->obstack = obstack;
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index e97f793..8491dee 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -703,7 +703,7 @@ sync_threadlists (void)
 
   pcount = 0;
   psize = 1;
-  pbuf = (struct pd_thread *) xmalloc (psize * sizeof *pbuf);
+  pbuf = XNEWVEC (struct pd_thread, psize);
 
   for (cmd = PTHDB_LIST_FIRST;; cmd = PTHDB_LIST_NEXT)
     {
@@ -740,7 +740,7 @@ sync_threadlists (void)
 
   gcount = 0;
   iterate_over_threads (giter_count, &gcount);
-  g = gbuf = (struct thread_info **) xmalloc (gcount * sizeof *gbuf);
+  g = gbuf = XNEWVEC (struct thread_info *, gcount);
   iterate_over_threads (giter_accum, &g);
   qsort (gbuf, gcount, sizeof *gbuf, gcmp);
 
@@ -757,7 +757,7 @@ sync_threadlists (void)
       else if (gi == gcount)
 	{
 	  thread = add_thread (ptid_build (infpid, 0, pbuf[pi].pthid));
-	  thread->priv = xmalloc (sizeof (struct private_thread_info));
+	  thread->priv = XNEW (struct private_thread_info);
 	  thread->priv->pdtid = pbuf[pi].pdtid;
 	  thread->priv->tid = pbuf[pi].tid;
 	  pi++;
@@ -789,7 +789,7 @@ sync_threadlists (void)
 	  else
 	    {
 	      thread = add_thread (pptid);
-	      thread->priv = xmalloc (sizeof (struct private_thread_info));
+	      thread->priv = XNEW (struct private_thread_info);
 	      thread->priv->pdtid = pdtid;
 	      thread->priv->tid = tid;
 	      pi++;
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index d9b8517..7654096 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -305,8 +305,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       int len;
       int offset;
     };
-  struct alpha_arg *alpha_args
-    = (struct alpha_arg *) alloca (nargs * sizeof (struct alpha_arg));
+  struct alpha_arg *alpha_args = XALLOCAVEC (struct alpha_arg, nargs);
   struct alpha_arg *m_arg;
   gdb_byte arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS];
   int required_arg_regs;
@@ -1754,7 +1753,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   if (arches != NULL)
     return arches->gdbarch;
 
-  tdep = xmalloc (sizeof (struct gdbarch_tdep));
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Lowest text address.  This is used by heuristic_proc_start()
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index a092298..8b6e52b 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -158,7 +158,7 @@ amd64_windows_push_arguments (struct regcache *regcache, int nargs,
 {
   int reg_idx = 0;
   int i;
-  struct value **stack_args = alloca (nargs * sizeof (struct value *));
+  struct value **stack_args = XALLOCAVEC (struct value *, nargs);
   int num_stack_args = 0;
   int num_elements = 0;
   int element = 0;
@@ -169,7 +169,7 @@ amd64_windows_push_arguments (struct regcache *regcache, int nargs,
      in inferior memory.  So use a copy of the ARGS table, to avoid
      modifying the original one.  */
   {
-    struct value **args1 = alloca (nargs * sizeof (struct value *));
+    struct value **args1 = XALLOCAVEC (struct value *, nargs);
 
     memcpy (args1, args, nargs * sizeof (struct value *));
     sp = amd64_windows_adjust_args_passed_by_pointer (args1, nargs, sp);
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index fb65a5d..a63b181 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -791,7 +791,7 @@ arm_linux_add_process (pid_t pid)
 {
   struct arm_linux_process_info *proc;
 
-  proc = xcalloc (1, sizeof (*proc));
+  proc = XCNEW (struct arm_linux_process_info);
   proc->pid = pid;
 
   proc->next = arm_linux_process_list;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 4772d82..b3ad868 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1100,8 +1100,7 @@ arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
 				    CORE_ADDR from, CORE_ADDR to,
 				    struct regcache *regs)
 {
-  struct displaced_step_closure *dsc
-    = xmalloc (sizeof (struct displaced_step_closure));
+  struct displaced_step_closure *dsc = XNEW (struct displaced_step_closure);
 
   /* Detect when we enter an (inaccessible by GDB) Linux kernel helper, and
      stop at the return location.  */
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 73f26b9..bcee29c 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3402,7 +3402,7 @@ static struct stack_item *
 push_stack_item (struct stack_item *prev, const void *contents, int len)
 {
   struct stack_item *si;
-  si = xmalloc (sizeof (struct stack_item));
+  si = XNEW (struct stack_item);
   si->data = xmalloc (len);
   si->len = len;
   si->prev = prev;
@@ -8737,8 +8737,8 @@ arm_displaced_step_copy_insn (struct gdbarch *gdbarch,
 			      CORE_ADDR from, CORE_ADDR to,
 			      struct regcache *regs)
 {
-  struct displaced_step_closure *dsc
-    = xmalloc (sizeof (struct displaced_step_closure));
+  struct displaced_step_closure *dsc = XNEW (struct displaced_step_closure);
+
   arm_process_displaced_insn (gdbarch, from, to, regs, dsc);
   arm_displaced_init_closure (gdbarch, from, to, dsc);
 
@@ -10290,7 +10290,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       return best_arch->gdbarch;
     }
 
-  tdep = xcalloc (1, sizeof (struct gdbarch_tdep));
+  tdep = XCNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Record additional information about the architecture we are defining.
@@ -10571,8 +10571,8 @@ _initialize_arm_tdep (void)
 
   /* Initialize the array that will be passed to
      add_setshow_enum_cmd().  */
-  valid_disassembly_styles
-    = xmalloc ((num_disassembly_options + 1) * sizeof (char *));
+  valid_disassembly_styles = XNEWVEC (const char *,
+				      num_disassembly_options + 1);
   for (i = 0; i < num_disassembly_options; i++)
     {
       numregs = get_arm_regnames (i, &setname, &setdesc, &regnames);
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index dff0be9..aaa2921 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1205,7 +1205,7 @@ static struct stack_item *
 push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len)
 {
   struct stack_item *si;
-  si = xmalloc (sizeof (struct stack_item));
+  si = XNEW (struct stack_item);
   si->data = xmalloc (len);
   si->len = len;
   si->prev = prev;
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 485b2ad..8dbe572 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -41,7 +41,7 @@ static void generic_ext (struct agent_expr *x, enum agent_op op, int n);
 struct agent_expr *
 new_agent_expr (struct gdbarch *gdbarch, CORE_ADDR scope)
 {
-  struct agent_expr *x = xmalloc (sizeof (*x));
+  struct agent_expr *x = XNEW (struct agent_expr);
 
   x->len = 0;
   x->size = 1;			/* Change this to a larger value once
diff --git a/gdb/block.c b/gdb/block.c
index f4b8e4f..3195baa 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -351,8 +351,7 @@ block_initialize_namespace (struct block *block, struct obstack *obstack)
 {
   if (BLOCK_NAMESPACE (block) == NULL)
     {
-      BLOCK_NAMESPACE (block)
-	= obstack_alloc (obstack, sizeof (struct block_namespace_info));
+      BLOCK_NAMESPACE (block) = XOBNEW (obstack, struct block_namespace_info);
       BLOCK_NAMESPACE (block)->scope = NULL;
       BLOCK_NAMESPACE (block)->using_decl = NULL;
     }
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 052aeb9..5067222 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -725,11 +725,11 @@ clear_breakpoint_hit_counts (void)
 static struct counted_command_line *
 alloc_counted_command_line (struct command_line *commands)
 {
-  struct counted_command_line *result
-    = xmalloc (sizeof (struct counted_command_line));
+  struct counted_command_line *result = XNEW (struct counted_command_line);
 
   result->refc = 1;
   result->commands = commands;
+
   return result;
 }
 
@@ -3395,8 +3395,8 @@ get_breakpoint_objfile_data (struct objfile *objfile)
   bp_objfile_data = objfile_data (objfile, breakpoint_objfile_key);
   if (bp_objfile_data == NULL)
     {
-      bp_objfile_data = obstack_alloc (&objfile->objfile_obstack,
-				       sizeof (*bp_objfile_data));
+      bp_objfile_data =
+	XOBNEW (&objfile->objfile_obstack, struct breakpoint_objfile_data);
 
       memset (bp_objfile_data, 0, sizeof (*bp_objfile_data));
       set_objfile_data (objfile, breakpoint_objfile_key, bp_objfile_data);
@@ -9081,8 +9081,7 @@ update_dprintf_command_list (struct breakpoint *b)
   gdb_assert (printf_line != NULL);
   /* Manufacture a printf sequence.  */
   {
-    struct command_line *printf_cmd_line
-      = xmalloc (sizeof (struct command_line));
+    struct command_line *printf_cmd_line = XNEW (struct command_line);
 
     printf_cmd_line->control_type = simple_control;
     printf_cmd_line->body_count = 0;
@@ -9374,8 +9373,7 @@ parse_breakpoint_sals (const struct event_location *location,
 	      CORE_ADDR pc;
 
 	      init_sal (&sal);		/* Initialize to zeroes.  */
-	      lsal.sals.sals = (struct symtab_and_line *)
-		xmalloc (sizeof (struct symtab_and_line));
+	      lsal.sals.sals = XNEW (struct symtab_and_line);
 
 	      /* Set sal's pspace, pc, symtab, and line to the values
 		 corresponding to the last call to print_frame_info.
@@ -9602,7 +9600,7 @@ decode_static_tracepoint_spec (const char **arg_p)
     error (_("No known static tracepoint marker named %s"), marker_str);
 
   sals.nelts = VEC_length(static_tracepoint_marker_p, markers);
-  sals.sals = xmalloc (sizeof *sals.sals * sals.nelts);
+  sals.sals = XNEWVEC (struct symtab_and_line, sals.nelts);
 
   for (i = 0; i < sals.nelts; i++)
     {
@@ -11592,8 +11590,8 @@ until_break_command (char *arg, int from_tty, int anywhere)
 
   if (target_can_async_p () && is_running (inferior_ptid))
     {
-      struct until_break_command_continuation_args *args;
-      args = xmalloc (sizeof (*args));
+      struct until_break_command_continuation_args *args =
+        XNEW (struct until_break_command_continuation_args);
 
       args->breakpoint = breakpoint;
       args->breakpoint2 = breakpoint2;
@@ -11827,8 +11825,7 @@ clear_command (char *arg, int from_tty)
     }
   else
     {
-      sals.sals = (struct symtab_and_line *)
-	xmalloc (sizeof (struct symtab_and_line));
+      sals.sals = XNEW (struct symtab_and_line);
       make_cleanup (xfree, sals.sals);
       init_sal (&sal);		/* Initialize to zeroes.  */
 
@@ -12245,7 +12242,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
     for (loc = b->loc; loc; loc = loc->next)
       bp_location_count++;
 
-  bp_location = xmalloc (sizeof (*bp_location) * bp_location_count);
+  bp_location = XNEWVEC (struct bp_location *, bp_location_count);
   locp = bp_location;
   ALL_BREAKPOINTS (b)
     for (loc = b->loc; loc; loc = loc->next)
diff --git a/gdb/btrace.c b/gdb/btrace.c
index abdf639..e205ea8 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -193,7 +193,7 @@ ftrace_new_function (struct btrace_function *prev,
 {
   struct btrace_function *bfun;
 
-  bfun = xzalloc (sizeof (*bfun));
+  bfun = XCNEW (struct btrace_function);
 
   bfun->msym = mfun;
   bfun->sym = fun;
@@ -2196,7 +2196,7 @@ btrace_set_insn_history (struct btrace_thread_info *btinfo,
 			 const struct btrace_insn_iterator *end)
 {
   if (btinfo->insn_history == NULL)
-    btinfo->insn_history = xzalloc (sizeof (*btinfo->insn_history));
+    btinfo->insn_history = XCNEW (struct btrace_insn_history);
 
   btinfo->insn_history->begin = *begin;
   btinfo->insn_history->end = *end;
@@ -2212,7 +2212,7 @@ btrace_set_call_history (struct btrace_thread_info *btinfo,
   gdb_assert (begin->btinfo == end->btinfo);
 
   if (btinfo->call_history == NULL)
-    btinfo->call_history = xzalloc (sizeof (*btinfo->call_history));
+    btinfo->call_history = XCNEW (struct btrace_call_history);
 
   btinfo->call_history->begin = *begin;
   btinfo->call_history->end = *end;
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 36ec62f..54c1d03 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -232,7 +232,7 @@ add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
 	}
       else
 	{
-	  link = (struct pending *) xmalloc (sizeof (struct pending));
+	  link = XNEW (struct pending);
 	}
 
       link->next = *listhead;
@@ -550,8 +550,7 @@ record_pending_block (struct objfile *objfile, struct block *block,
   if (pending_blocks == NULL)
     obstack_init (&pending_block_obstack);
 
-  pblock = (struct pending_block *)
-    obstack_alloc (&pending_block_obstack, sizeof (struct pending_block));
+  pblock = XOBNEW (&pending_block_obstack, struct pending_block);
   pblock->block = block;
   if (opblock)
     {
@@ -705,7 +704,7 @@ start_subfile (const char *name)
 
   /* This subfile is not known.  Add an entry for it.  */
 
-  subfile = (struct subfile *) xmalloc (sizeof (struct subfile));
+  subfile = XNEW (struct subfile);
   memset (subfile, 0, sizeof (struct subfile));
   subfile->buildsym_compunit = buildsym_compunit;
 
@@ -773,8 +772,7 @@ start_buildsym_compunit (struct objfile *objfile, const char *comp_dir)
 {
   struct buildsym_compunit *bscu;
 
-  bscu = (struct buildsym_compunit *)
-    xmalloc (sizeof (struct buildsym_compunit));
+  bscu = XNEW (struct buildsym_compunit);
   memset (bscu, 0, sizeof (struct buildsym_compunit));
 
   bscu->objfile = objfile;
@@ -866,8 +864,7 @@ patch_subfile_names (struct subfile *subfile, char *name)
 void
 push_subfile (void)
 {
-  struct subfile_stack *tem
-    = (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack));
+  struct subfile_stack *tem = XNEW (struct subfile_stack);
 
   tem->next = subfile_stack;
   subfile_stack = tem;
@@ -1265,7 +1262,7 @@ end_symtab_get_static_block (CORE_ADDR end_addr, int expandable, int required)
       for (pb = pending_blocks; pb != NULL; pb = pb->next)
 	count++;
 
-      barray = xmalloc (sizeof (*barray) * count);
+      barray = XNEWVEC (struct block *, count);
       back_to = make_cleanup (xfree, barray);
 
       bp = barray;
@@ -1768,8 +1765,7 @@ buildsym_init (void)
   if (context_stack == NULL)
     {
       context_stack_size = INITIAL_CONTEXT_STACK_SIZE;
-      context_stack = (struct context_stack *)
-	xmalloc (context_stack_size * sizeof (struct context_stack));
+      context_stack = XNEWVEC (struct context_stack, context_stack_size);
     }
 
   /* Ensure the really_free_pendings cleanup was called after
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index bcd7802..aa9a9a5 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -636,7 +636,7 @@ source_command (char *args, int from_tty)
 {
   struct cleanup *old_cleanups;
   char *file = args;
-  int *old_source_verbose = xmalloc (sizeof(int));
+  int *old_source_verbose = XNEW (int);
   int search_path = 0;
 
   *old_source_verbose = source_verbose;
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index e406157..f5b6fc4 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -192,8 +192,7 @@ struct cmd_list_element *
 add_cmd (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun,
 	 const char *doc, struct cmd_list_element **list)
 {
-  struct cmd_list_element *c
-    = (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
+  struct cmd_list_element *c = XNEW (struct cmd_list_element);
   struct cmd_list_element *p, *iter;
 
   /* Turn each alias of the old command into an alias of the new
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 4bd18a7..1717240 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -109,15 +109,12 @@ build_command_line (enum command_control_type type, char *args)
     error (_("if/while commands require arguments."));
   gdb_assert (args != NULL);
 
-  cmd = (struct command_line *) xmalloc (sizeof (struct command_line));
+  cmd = XNEW (struct command_line);
   cmd->next = NULL;
   cmd->control_type = type;
 
   cmd->body_count = 1;
-  cmd->body_list
-    = (struct command_line **) xmalloc (sizeof (struct command_line *)
-					* cmd->body_count);
-  memset (cmd->body_list, 0, sizeof (struct command_line *) * cmd->body_count);
+  cmd->body_list = XCNEWVEC (struct command_line *, cmd->body_count);
   cmd->line = xstrdup (args);
 
   return cmd;
@@ -722,7 +719,7 @@ setup_user_args (char *p)
   struct cleanup *old_chain;
   unsigned int arg_count = 0;
 
-  args = (struct user_args *) xmalloc (sizeof (struct user_args));
+  args = XNEW (struct user_args);
   memset (args, 0, sizeof (struct user_args));
 
   args->next = user_args;
@@ -918,11 +915,9 @@ realloc_body_list (struct command_line *command, int new_length)
   if (new_length <= n)
     return;
 
-  body_list = (struct command_line **)
-    xmalloc (sizeof (struct command_line *) * new_length);
+  body_list = XCNEWVEC (struct command_line *, new_length);
 
   memcpy (body_list, command->body_list, sizeof (struct command_line *) * n);
-  memset (body_list + n, 0, sizeof (struct command_line *) * (new_length - n));
 
   xfree (command->body_list);
   command->body_list = body_list;
@@ -1076,8 +1071,7 @@ process_next_line (char *p, struct command_line **command, int parse_commands,
 	}
       else if (p_end - p == 10 && startswith (p, "loop_break"))
 	{
-	  *command = (struct command_line *)
-	    xmalloc (sizeof (struct command_line));
+	  *command = XNEW (struct command_line);
 	  (*command)->next = NULL;
 	  (*command)->line = NULL;
 	  (*command)->control_type = break_control;
@@ -1086,8 +1080,7 @@ process_next_line (char *p, struct command_line **command, int parse_commands,
 	}
       else if (p_end - p == 13 && startswith (p, "loop_continue"))
 	{
-	  *command = (struct command_line *)
-	    xmalloc (sizeof (struct command_line));
+	  *command = XNEW (struct command_line);
 	  (*command)->next = NULL;
 	  (*command)->line = NULL;
 	  (*command)->control_type = continue_control;
@@ -1101,8 +1094,7 @@ process_next_line (char *p, struct command_line **command, int parse_commands,
   if (!parse_commands || not_handled)
     {
       /* A normal command.  */
-      *command = (struct command_line *)
-	xmalloc (sizeof (struct command_line));
+      *command = XNEW (struct command_line);
       (*command)->next = NULL;
       (*command)->line = savestring (p, p_end - p);
       (*command)->control_type = simple_control;
@@ -1414,7 +1406,7 @@ copy_command_lines (struct command_line *cmds)
 
   if (cmds)
     {
-      result = (struct command_line *) xmalloc (sizeof (struct command_line));
+      result = XNEW (struct command_line);
 
       result->next = copy_command_lines (cmds->next);
       result->line = xstrdup (cmds->line);
@@ -1424,8 +1416,7 @@ copy_command_lines (struct command_line *cmds)
         {
           int i;
 
-          result->body_list = (struct command_line **)
-            xmalloc (sizeof (struct command_line *) * cmds->body_count);
+          result->body_list = XNEWVEC (struct command_line *, cmds->body_count);
 
           for (i = 0; i < cmds->body_count; i++)
             result->body_list[i] = copy_command_lines (cmds->body_list[i]);
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 8d01b52..ca41d8e 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -475,8 +475,8 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c)
 
 	  p = p->prefix;
 	}
-      cp = name = xmalloc (length);
-      cmds = xmalloc (sizeof (struct cmd_list_element *) * i);
+      cp = name = (char *) xmalloc (length);
+      cmds = XNEWVEC (struct cmd_list_element *, i);
 
       /* Track back through filed 'prefix' and cache them in CMDS.  */
       for (i = 0, p = c; p != NULL; i++)
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index 451a15c..2154c35 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -356,8 +356,7 @@ read_pe_exported_syms (struct objfile *objfile)
 
   char const *target = bfd_get_target (objfile->obfd);
 
-  section_data = xzalloc (PE_SECTION_TABLE_SIZE
-			 * sizeof (struct read_pe_section_data));
+  section_data = XCNEWVEC (struct read_pe_section_data, PE_SECTION_TABLE_SIZE);
 
   make_cleanup (free_current_contents, &section_data);
 
diff --git a/gdb/coffread.c b/gdb/coffread.c
index c0f4267..a5033d1 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -253,8 +253,7 @@ coff_locate_sections (bfd *abfd, asection *sectp, void *csip)
 	{
 	  struct stab_section_list *n, **pn;
 
-	  n = ((struct stab_section_list *)
-	       xmalloc (sizeof (struct stab_section_list)));
+	  n = XNEW (struct stab_section_list);
 	  n->section = sectp;
 	  n->next = NULL;
 	  for (pn = &csi->stabsects; *pn != NULL; pn = &(*pn)->next)
@@ -841,9 +840,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
   if (type_vector)		/* Get rid of previous one.  */
     xfree (type_vector);
   type_vector_length = INITIAL_TYPE_VECTOR_LENGTH;
-  type_vector = (struct type **)
-    xmalloc (type_vector_length * sizeof (struct type *));
-  memset (type_vector, 0, type_vector_length * sizeof (struct type *));
+  type_vector = XCNEWVEC (struct type *, type_vector_length);
 
   coff_start_symtab (objfile, "");
 
@@ -2102,7 +2099,7 @@ coff_read_struct_type (int index, int length, int lastsym,
 	case C_MOU:
 
 	  /* Get space to record the next field's data.  */
-	  newobj = (struct nextfield *) alloca (sizeof (struct nextfield));
+	  newobj = XALLOCA (struct nextfield);
 	  newobj->next = list;
 	  list = newobj;
 
@@ -2119,7 +2116,7 @@ coff_read_struct_type (int index, int length, int lastsym,
 	case C_FIELD:
 
 	  /* Get space to record the next field's data.  */
-	  newobj = (struct nextfield *) alloca (sizeof (struct nextfield));
+	  newobj = XALLOCA (struct nextfield);
 	  newobj->next = list;
 	  list = newobj;
 
diff --git a/gdb/common/cleanups.c b/gdb/common/cleanups.c
index e57e4cc..2b48e86 100644
--- a/gdb/common/cleanups.c
+++ b/gdb/common/cleanups.c
@@ -79,8 +79,7 @@ static struct cleanup *
 make_my_cleanup2 (struct cleanup **pmy_chain, make_cleanup_ftype *function,
 		  void *arg,  void (*free_arg) (void *))
 {
-  struct cleanup *newobj
-    = (struct cleanup *) xmalloc (sizeof (struct cleanup));
+  struct cleanup *newobj = XNEW (struct cleanup);
   struct cleanup *old_chain = *pmy_chain;
 
   newobj->next = *pmy_chain;
diff --git a/gdb/common/common-exceptions.c b/gdb/common/common-exceptions.c
index b300a9d..8ee96ab 100644
--- a/gdb/common/common-exceptions.c
+++ b/gdb/common/common-exceptions.c
@@ -336,9 +336,8 @@ throw_it (enum return_reason reason, enum errors error, const char *fmt,
       int old_size = exception_messages_size;
 
       exception_messages_size = depth + 10;
-      exception_messages = (char **) xrealloc (exception_messages,
-					       exception_messages_size
-					       * sizeof (char *));
+      exception_messages = XRESIZEVEC (char *, exception_messages,
+				       exception_messages_size);
       memset (exception_messages + old_size, 0,
 	      (exception_messages_size - old_size) * sizeof (char *));
     }
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index 25ea8fa..c829a89 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -420,7 +420,7 @@ do_close_cleanup (void *arg)
 struct cleanup *
 make_cleanup_close (int fd)
 {
-  int *saved_fd = xmalloc (sizeof (fd));
+  int *saved_fd = XNEW (int);
 
   *saved_fd = fd;
   return make_cleanup_dtor (do_close_cleanup, saved_fd, xfree);
diff --git a/gdb/common/format.c b/gdb/common/format.c
index deea93c..1602e53 100644
--- a/gdb/common/format.c
+++ b/gdb/common/format.c
@@ -103,8 +103,7 @@ parse_format_string (const char **arg)
 
   max_pieces = strlen (string) + 2;
 
-  pieces = (struct format_piece *)
-    xmalloc (max_pieces * sizeof (struct format_piece));
+  pieces = XNEWVEC (struct format_piece, max_pieces);
 
   next_frag = 0;
 
diff --git a/gdb/common/queue.h b/gdb/common/queue.h
index fce4349..99459a0 100644
--- a/gdb/common/queue.h
+++ b/gdb/common/queue.h
@@ -125,8 +125,7 @@ QUEUE(TYPE)					\
 void									\
 queue_ ## TYPE ## _enque (QUEUE (TYPE) *q, TYPE v)			\
 {									\
-  QUEUE_ELEM (TYPE) *p							\
-    = xmalloc (sizeof (QUEUE_ELEM (TYPE)));				\
+  QUEUE_ELEM (TYPE) *p = XNEW (QUEUE_ELEM (TYPE));			\
 									\
   gdb_assert (q != NULL);						\
   p->data = v;								\
@@ -229,9 +228,8 @@ queue_ ## TYPE ## _iterate (QUEUE (TYPE) *q,				\
 QUEUE (TYPE) *								\
 queue_ ## TYPE ## _alloc (void (*free_func) (TYPE))			\
 {									\
-  QUEUE (TYPE) *q;							\
+  QUEUE (TYPE) *q = XNEW (QUEUE (TYPE));				\
 									\
-  q = (QUEUE (TYPE) *) xmalloc (sizeof (QUEUE (TYPE)));		\
   q->head = NULL;							\
   q->tail = NULL;							\
   q->free_func = free_func;						\
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 16775ab..73868c2 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -46,7 +46,7 @@ struct munmap_list
 static void
 munmap_list_add (struct munmap_list **headp, CORE_ADDR addr, CORE_ADDR size)
 {
-  struct munmap_list *head_new = xmalloc (sizeof (*head_new));
+  struct munmap_list *head_new = XNEW (struct munmap_list);
 
   head_new->next = *headp;
   *headp = head_new;
@@ -827,7 +827,7 @@ compile_object_load (const char *object_file, const char *source_file,
 
   discard_cleanups (cleanups_free_objfile);
 
-  retval = xmalloc (sizeof (*retval));
+  retval = XNEW (struct compile_module);
   retval->objfile = objfile;
   retval->source_file = xstrdup (source_file);
   retval->func_sym = func_sym;
diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
index ce47831..6a39d13 100644
--- a/gdb/compile/compile-object-run.c
+++ b/gdb/compile/compile-object-run.c
@@ -155,7 +155,7 @@ compile_object_run (struct compile_module *module)
       func_val = value_from_pointer (lookup_pointer_type (func_type),
 				   BLOCK_START (SYMBOL_BLOCK_VALUE (func_sym)));
 
-      vargs = alloca (sizeof (*vargs) * TYPE_NFIELDS (func_type));
+      vargs = XALLOCAVEC (struct value *, TYPE_NFIELDS (func_type));
       if (TYPE_NFIELDS (func_type) >= 1)
 	{
 	  gdb_assert (regs_addr != 0);
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 499c530..d3ce3ba 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -338,7 +338,7 @@ append_args (int *argcp, char ***argvp, int argc, char **argv)
 {
   int argi;
 
-  *argvp = xrealloc (*argvp, (*argcp + argc + 1) * sizeof (**argvp));
+  *argvp = XRESIZEVEC (char *, *argvp, (*argcp + argc + 1));
 
   for (argi = 0; argi < argc; argi++)
     (*argvp)[(*argcp)++] = xstrdup (argv[argi]);
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 5246f71..eba36d6 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -107,8 +107,7 @@ specify_exec_file_hook (void (*hook) (const char *))
 	{
 	  /* If this is the first extra hook, initialize the hook
 	     array.  */
-	  exec_file_extra_hooks = (hook_type *)
-	    xmalloc (sizeof (hook_type));
+	  exec_file_extra_hooks = XNEW (hook_type);
 	  exec_file_extra_hooks[0] = deprecated_exec_file_display_hook;
 	  deprecated_exec_file_display_hook = call_extra_exec_file_hooks;
 	  exec_file_hook_count = 1;
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index dc0a057..3995bcc 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -1192,8 +1192,7 @@ make_symbol_overload_list (const char *func_name,
 
   sym_return_val_size = 100;
   sym_return_val_index = 0;
-  sym_return_val = xmalloc ((sym_return_val_size + 1) *
-			    sizeof (struct symbol *));
+  sym_return_val = XNEWVEC (struct symbol *, sym_return_val_size + 1);
   sym_return_val[0] = NULL;
 
   old_cleanups = make_cleanup (xfree, sym_return_val);
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 2273887..88a6441 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -671,8 +671,7 @@ struct stack_item
 static struct stack_item *
 push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len)
 {
-  struct stack_item *si;
-  si = xmalloc (sizeof (struct stack_item));
+  struct stack_item *si = XNEW (struct stack_item);
   si->data = xmalloc (len);
   si->len = len;
   si->prev = prev;
@@ -4037,7 +4036,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     }
 
   /* No matching architecture was found.  Create a new one.  */
-  tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
+  tdep = XNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   tdep->cris_version = usr_cmd_cris_version;
diff --git a/gdb/ctf.c b/gdb/ctf.c
index 9891321..6e7c616 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -810,8 +810,7 @@ static const struct trace_file_write_ops ctf_write_ops =
 struct trace_file_writer *
 ctf_trace_file_writer_new (void)
 {
-  struct ctf_trace_file_writer *writer
-    = xmalloc (sizeof (struct ctf_trace_file_writer));
+  struct ctf_trace_file_writer *writer = XNEW (struct ctf_trace_file_writer);
 
   writer->base.ops = &ctf_write_ops;
 
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index fdf4e09..029b98e 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -319,7 +319,7 @@ void
 init_header_files (void)
 {
   n_allocated_this_object_header_files = 10;
-  this_object_header_files = (int *) xmalloc (10 * sizeof (int));
+  this_object_header_files = XNEWVEC (int, 10);
 }
 
 /* Add header file number I for this object file
@@ -405,9 +405,7 @@ add_new_header_file (char *name, int instance)
   hfile->name = xstrdup (name);
   hfile->instance = instance;
   hfile->length = 10;
-  hfile->vector
-    = (struct type **) xmalloc (10 * sizeof (struct type *));
-  memset (hfile->vector, 0, 10 * sizeof (struct type *));
+  hfile->vector = XCNEWVEC (struct type *, 10);
 
   add_this_object_header_file (i);
 }
@@ -890,8 +888,8 @@ static void
 init_bincl_list (int number, struct objfile *objfile)
 {
   bincls_allocated = number;
-  next_bincl = bincl_list = (struct header_file_location *)
-    xmalloc (bincls_allocated * sizeof (struct header_file_location));
+  next_bincl = bincl_list = XNEWVEC (struct header_file_location,
+				     bincls_allocated);
 }
 
 /* Add a bincl to the list.  */
@@ -2170,8 +2168,8 @@ start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
     start_psymtab_common (objfile, filename, textlow,
 			  global_syms, static_syms);
 
-  result->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
-					       sizeof (struct symloc));
+  result->read_symtab_private =
+    XOBNEW (&objfile->objfile_obstack, struct symloc);
   LDSYMOFF (result) = ldsymoff;
   result->read_symtab = dbx_read_symtab;
   SYMBOL_SIZE (result) = symbol_size;
@@ -2288,9 +2286,9 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
   pst->number_of_dependencies = number_dependencies;
   if (number_dependencies)
     {
-      pst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->objfile_obstack,
-		       number_dependencies * sizeof (struct partial_symtab *));
+      pst->dependencies = XOBNEWVEC (&objfile->objfile_obstack,
+				     struct partial_symtab *,
+				     number_dependencies);
       memcpy (pst->dependencies, dependency_list,
 	      number_dependencies * sizeof (struct partial_symtab *));
     }
@@ -2303,7 +2301,7 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
 	allocate_psymtab (include_list[i], objfile);
 
       subpst->read_symtab_private =
-	obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
+	XOBNEW (&objfile->objfile_obstack, struct symloc);
       LDSYMOFF (subpst) =
 	LDSYMLEN (subpst) =
 	subpst->textlow =
@@ -2311,9 +2309,8 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
 
       /* We could save slight bits of space by only making one of these,
          shared by the entire set of include files.  FIXME-someday.  */
-      subpst->dependencies = (struct partial_symtab **)
-	obstack_alloc (&objfile->objfile_obstack,
-		       sizeof (struct partial_symtab *));
+      subpst->dependencies =
+	XOBNEW (&objfile->objfile_obstack, struct partial_symtab *);
       subpst->dependencies[0] = pst;
       subpst->number_of_dependencies = 1;
 
diff --git a/gdb/dcache.c b/gdb/dcache.c
index f87c529..f1cabb0 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -444,9 +444,7 @@ dcache_splay_tree_compare (splay_tree_key a, splay_tree_key b)
 DCACHE *
 dcache_init (void)
 {
-  DCACHE *dcache;
-
-  dcache = (DCACHE *) xmalloc (sizeof (*dcache));
+  DCACHE *dcache = XNEW (DCACHE);
 
   dcache->tree = splay_tree_new (dcache_splay_tree_compare,
 				 NULL,
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index a16955a..1829b12 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -361,7 +361,7 @@ dict_create_hashed (struct obstack *obstack,
   struct symbol **buckets;
   const struct pending *list_counter;
 
-  retval = obstack_alloc (obstack, sizeof (struct dictionary));
+  retval = XOBNEW (obstack, struct dictionary);
   DICT_VECTOR (retval) = &dict_hashed_vector;
 
   /* Calculate the number of symbols, and allocate space for them.  */
@@ -373,7 +373,7 @@ dict_create_hashed (struct obstack *obstack,
     }
   nbuckets = DICT_HASHTABLE_SIZE (nsyms);
   DICT_HASHED_NBUCKETS (retval) = nbuckets;
-  buckets = obstack_alloc (obstack, nbuckets * sizeof (struct symbol *));
+  buckets = XOBNEWVEC (obstack, struct symbol *, nbuckets);
   memset (buckets, 0, nbuckets * sizeof (struct symbol *));
   DICT_HASHED_BUCKETS (retval) = buckets;
 
@@ -399,9 +399,8 @@ dict_create_hashed (struct obstack *obstack,
 extern struct dictionary *
 dict_create_hashed_expandable (void)
 {
-  struct dictionary *retval;
+  struct dictionary *retval = XNEW (struct dictionary);
 
-  retval = xmalloc (sizeof (struct dictionary));
   DICT_VECTOR (retval) = &dict_hashed_expandable_vector;
   DICT_HASHED_NBUCKETS (retval) = DICT_EXPANDABLE_INITIAL_CAPACITY;
   DICT_HASHED_BUCKETS (retval) = xcalloc (DICT_EXPANDABLE_INITIAL_CAPACITY,
@@ -425,7 +424,7 @@ dict_create_linear (struct obstack *obstack,
   struct symbol **syms;
   const struct pending *list_counter;
 
-  retval = obstack_alloc (obstack, sizeof (struct dictionary));
+  retval = XOBNEW (obstack, struct dictionary);
   DICT_VECTOR (retval) = &dict_linear_vector;
 
   /* Calculate the number of symbols, and allocate space for them.  */
@@ -436,7 +435,7 @@ dict_create_linear (struct obstack *obstack,
       nsyms += list_counter->nsyms;
     }
   DICT_LINEAR_NSYMS (retval) = nsyms;
-  syms = obstack_alloc (obstack, nsyms * sizeof (struct symbol *));
+  syms = XOBNEWVEC (obstack, struct symbol *, nsyms );
   DICT_LINEAR_SYMS (retval) = syms;
 
   /* Now fill in the symbols.  Start filling in from the back, so as
@@ -464,9 +463,8 @@ dict_create_linear (struct obstack *obstack,
 struct dictionary *
 dict_create_linear_expandable (void)
 {
-  struct dictionary *retval;
+  struct dictionary *retval = XNEW (struct dictionary);
 
-  retval = xmalloc (sizeof (struct dictionary));
   DICT_VECTOR (retval) = &dict_linear_expandable_vector;
   DICT_LINEAR_NSYMS (retval) = 0;
   DICT_LINEAR_EXPANDABLE_CAPACITY (retval)
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 9816f07..03b6264 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -386,8 +386,8 @@ dtrace_process_dof_probe (struct objfile *objfile,
     {
       uint32_t probe_offset
 	= ((uint32_t *) offtab)[DOF_UINT (dof, probe->dofpr_offidx) + i];
-      struct dtrace_probe *ret
-	= obstack_alloc (&objfile->per_bfd->storage_obstack, sizeof (*ret));
+      struct dtrace_probe *ret =
+	XOBNEW (&objfile->per_bfd->storage_obstack, struct dtrace_probe);
 
       ret->p.pops = &dtrace_probe_ops;
       ret->p.arch = gdbarch;
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index f1d3de8..b6993a2 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -241,7 +241,7 @@ register_dummy_frame_dtor (struct frame_id dummy_id, ptid_t ptid,
   dp = lookup_dummy_frame (&id);
   gdb_assert (dp != NULL);
   d = *dp;
-  list = xmalloc (sizeof (*list));
+  list = XNEW (struct dummy_frame_dtor_list);
   list->next = d->dtor_list;
   d->dtor_list = list;
   list->dtor = dtor;
diff --git a/gdb/dwarf2-frame-tailcall.c b/gdb/dwarf2-frame-tailcall.c
index f964ab2..e4a8112 100644
--- a/gdb/dwarf2-frame-tailcall.c
+++ b/gdb/dwarf2-frame-tailcall.c
@@ -91,11 +91,9 @@ cache_eq (const void *arg1, const void *arg2)
 static struct tailcall_cache *
 cache_new_ref1 (struct frame_info *next_bottom_frame)
 {
-  struct tailcall_cache *cache;
+  struct tailcall_cache *cache = XCNEW (struct tailcall_cache);
   void **slot;
 
-  cache = xzalloc (sizeof (*cache));
-
   cache->next_bottom_frame = next_bottom_frame;
   cache->refc = 1;
 
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 8fb2ac7..f9afe0b 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1908,9 +1908,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
       if (find_cie (cie_table, cie_pointer))
 	return end;
 
-      cie = (struct dwarf2_cie *)
-	obstack_alloc (&unit->objfile->objfile_obstack,
-		       sizeof (struct dwarf2_cie));
+      cie = XOBNEW (&unit->objfile->objfile_obstack, struct dwarf2_cie);
       cie->initial_instructions = NULL;
       cie->cie_pointer = cie_pointer;
 
@@ -2089,9 +2087,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
       if (cie_pointer >= unit->dwarf_frame_size)
 	return NULL;
 
-      fde = (struct dwarf2_fde *)
-	obstack_alloc (&unit->objfile->objfile_obstack,
-		       sizeof (struct dwarf2_fde));
+      fde = XOBNEW (&unit->objfile->objfile_obstack, struct dwarf2_fde);
       fde->cie = find_cie (cie_table, cie_pointer);
       if (fde->cie == NULL)
 	{
@@ -2395,8 +2391,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
     }
 
   /* Copy fde_table to obstack: it is needed at runtime.  */
-  fde_table2 = (struct dwarf2_fde_table *)
-    obstack_alloc (&objfile->objfile_obstack, sizeof (*fde_table2));
+  fde_table2 = XOBNEW (&objfile->objfile_obstack, struct dwarf2_fde_table);
 
   if (fde_table.num_entries == 0)
     {
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 862a753..09b56b6 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -94,11 +94,10 @@ new_dwarf_expr_context (void)
 {
   struct dwarf_expr_context *retval;
 
-  retval = xcalloc (1, sizeof (struct dwarf_expr_context));
+  retval = XCNEW (struct dwarf_expr_context);
   retval->stack_len = 0;
   retval->stack_allocated = 10;
-  retval->stack = xmalloc (retval->stack_allocated
-			   * sizeof (struct dwarf_stack_value));
+  retval->stack = XNEWVEC (struct dwarf_stack_value, retval->stack_allocated);
   retval->num_pieces = 0;
   retval->pieces = 0;
   retval->max_recursion_depth = 0x100;
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index efe4357..91cb99a 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -2908,7 +2908,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
   unsigned int addr_size_bits = 8 * addr_size;
   int bits_big_endian = gdbarch_bits_big_endian (arch);
 
-  offsets = xmalloc ((op_end - op_ptr) * sizeof (int));
+  offsets = XNEWVEC (int, op_end - op_ptr);
   cleanups = make_cleanup (xfree, offsets);
 
   for (i = 0; i < op_end - op_ptr; ++i)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 77d37dd..6ec8595 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2048,7 +2048,7 @@ dwarf2_has_info (struct objfile *objfile,
     {
       /* Initialize per-objfile state.  */
       struct dwarf2_per_objfile *data
-	= obstack_alloc (&objfile->objfile_obstack, sizeof (*data));
+	= XOBNEW (&objfile->objfile_obstack, struct dwarf2_per_objfile);
 
       memset (data, 0, sizeof (*data));
       set_objfile_data (objfile, dwarf2_objfile_data_key, data);
@@ -2819,10 +2819,9 @@ create_cus_from_index (struct objfile *objfile,
   struct dwz_file *dwz;
 
   dwarf2_per_objfile->n_comp_units = (cu_list_elements + dwz_elements) / 2;
-  dwarf2_per_objfile->all_comp_units
-    = obstack_alloc (&objfile->objfile_obstack,
-		     dwarf2_per_objfile->n_comp_units
-		     * sizeof (struct dwarf2_per_cu_data *));
+  dwarf2_per_objfile->all_comp_units =
+    XOBNEWVEC (&objfile->objfile_obstack, struct dwarf2_per_cu_data *,
+	       dwarf2_per_objfile->n_comp_units);
 
   create_cus_from_index_list (objfile, cu_list, cu_list_elements,
 			      &dwarf2_per_objfile->info, 0, 0);
@@ -2849,9 +2848,8 @@ create_signatured_type_table_from_index (struct objfile *objfile,
   dwarf2_per_objfile->n_type_units
     = dwarf2_per_objfile->n_allocated_type_units
     = elements / 3;
-  dwarf2_per_objfile->all_type_units
-    = xmalloc (dwarf2_per_objfile->n_type_units
-	       * sizeof (struct signatured_type *));
+  dwarf2_per_objfile->all_type_units =
+    XNEWVEC (struct signatured_type *, dwarf2_per_objfile->n_type_units);
 
   sig_types_hash = allocate_signatured_type_table (objfile);
 
@@ -3230,7 +3228,7 @@ dwarf2_read_index (struct objfile *objfile)
 
   create_addrmap_from_index (objfile, &local_map);
 
-  map = obstack_alloc (&objfile->objfile_obstack, sizeof (struct mapped_index));
+  map = XOBNEW (&objfile->objfile_obstack, struct mapped_index);
   *map = local_map;
 
   dwarf2_per_objfile->index_table = map;
@@ -3314,7 +3312,7 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader,
       return;
     }
 
-  qfn = obstack_alloc (&objfile->objfile_obstack, sizeof (*qfn));
+  qfn = XOBNEW (&objfile->objfile_obstack, struct quick_file_names);
   qfn->hash.dwo_unit = cu->dwo_unit;
   qfn->hash.line_offset.sect_off = line_offset;
   gdb_assert (slot != NULL);
@@ -3323,8 +3321,8 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader,
   find_file_and_directory (comp_unit_die, cu, &name, &comp_dir);
 
   qfn->num_file_names = lh->num_file_names;
-  qfn->file_names = obstack_alloc (&objfile->objfile_obstack,
-				   lh->num_file_names * sizeof (char *));
+  qfn->file_names =
+    XOBNEWVEC (&objfile->objfile_obstack, const char *, lh->num_file_names);
   for (i = 0; i < lh->num_file_names; ++i)
     qfn->file_names[i] = file_full_name (i + 1, lh, comp_dir);
   qfn->real_names = NULL;
@@ -4506,9 +4504,8 @@ dwarf2_create_include_psymtab (const char *name, struct partial_symtab *pst,
   subpst->textlow = 0;
   subpst->texthigh = 0;
 
-  subpst->dependencies = (struct partial_symtab **)
-    obstack_alloc (&objfile->objfile_obstack,
-                   sizeof (struct partial_symtab *));
+  subpst->dependencies
+    = XOBNEW (&objfile->objfile_obstack, struct partial_symtab *);
   subpst->dependencies[0] = pst;
   subpst->number_of_dependencies = 1;
 
@@ -4780,9 +4777,8 @@ create_all_type_units (struct objfile *objfile)
   dwarf2_per_objfile->n_type_units
     = dwarf2_per_objfile->n_allocated_type_units
     = htab_elements (types_htab);
-  dwarf2_per_objfile->all_type_units
-    = xmalloc (dwarf2_per_objfile->n_type_units
-	       * sizeof (struct signatured_type *));
+  dwarf2_per_objfile->all_type_units =
+    XNEWVEC (struct signatured_type *, dwarf2_per_objfile->n_type_units);
   iter = &dwarf2_per_objfile->all_type_units[0];
   htab_traverse_noresize (types_htab, add_signatured_type_cu_to_table, &iter);
   gdb_assert (iter - &dwarf2_per_objfile->all_type_units[0]
@@ -5130,8 +5126,7 @@ read_cutu_die_from_dwo (struct dwarf2_per_cu_data *this_cu,
   else if (stub_comp_dir != NULL)
     {
       /* Reconstruct the comp_dir attribute to simplify the code below.  */
-      comp_dir = (struct attribute *)
-	obstack_alloc (&cu->comp_unit_obstack, sizeof (*comp_dir));
+      comp_dir = XOBNEW (&cu->comp_unit_obstack, struct attribute);
       comp_dir->name = DW_AT_comp_dir;
       comp_dir->form = DW_FORM_string;
       DW_STRING_IS_CANONICAL (comp_dir) = 0;
@@ -5349,7 +5344,7 @@ init_tu_and_read_dwo_dies (struct dwarf2_per_cu_data *this_cu,
     {
       /* If !use_existing_cu, this_cu->cu must be NULL.  */
       gdb_assert (this_cu->cu == NULL);
-      cu = xmalloc (sizeof (*cu));
+      cu = XNEW (struct dwarf2_cu);
       init_one_comp_unit (cu, this_cu);
       /* If an error occurs while loading, release our storage.  */
       free_cu_cleanup = make_cleanup (free_heap_comp_unit, cu);
@@ -5486,7 +5481,7 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu,
     {
       /* If !use_existing_cu, this_cu->cu must be NULL.  */
       gdb_assert (this_cu->cu == NULL);
-      cu = xmalloc (sizeof (*cu));
+      cu = XNEW (struct dwarf2_cu);
       init_one_comp_unit (cu, this_cu);
       /* If an error occurs while loading, release our storage.  */
       free_cu_cleanup = make_cleanup (free_heap_comp_unit, cu);
@@ -6027,8 +6022,8 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
       /* Fill in 'dependencies' here; we fill in 'users' in a
 	 post-pass.  */
       pst->number_of_dependencies = len;
-      pst->dependencies = obstack_alloc (&objfile->objfile_obstack,
-					 len * sizeof (struct symtab *));
+      pst->dependencies =
+	XOBNEWVEC (&objfile->objfile_obstack, struct partial_symtab *, len);
       for (i = 0;
 	   VEC_iterate (dwarf2_per_cu_ptr, cu->per_cu->imported_symtabs,
 			i, iter);
@@ -6299,8 +6294,8 @@ build_type_psymtab_dependencies (void **slot, void *info)
   gdb_assert (IS_TYPE_UNIT_GROUP (per_cu));
 
   pst->number_of_dependencies = len;
-  pst->dependencies = obstack_alloc (&objfile->objfile_obstack,
-				     len * sizeof (struct psymtab *));
+  pst->dependencies =
+    XOBNEWVEC (&objfile->objfile_obstack, struct partial_symtab *, len);
   for (i = 0;
        VEC_iterate (sig_type_ptr, tu_group->tus, i, iter);
        ++i)
@@ -6565,8 +6560,7 @@ read_comp_units_from_section (struct objfile *objfile,
       length = read_initial_length (abfd, info_ptr, &initial_length_size);
 
       /* Save the compilation unit for later lookup.  */
-      this_cu = obstack_alloc (&objfile->objfile_obstack,
-			       sizeof (struct dwarf2_per_cu_data));
+      this_cu = XOBNEW (&objfile->objfile_obstack, struct dwarf2_per_cu_data);
       memset (this_cu, 0, sizeof (*this_cu));
       this_cu->offset = offset;
       this_cu->length = length + initial_length_size;
@@ -6601,8 +6595,7 @@ create_all_comp_units (struct objfile *objfile)
 
   n_comp_units = 0;
   n_allocated = 10;
-  all_comp_units = xmalloc (n_allocated
-			    * sizeof (struct dwarf2_per_cu_data *));
+  all_comp_units = XNEWVEC (struct dwarf2_per_cu_data *, n_allocated);
 
   read_comp_units_from_section (objfile, &dwarf2_per_objfile->info, 0,
 				&n_allocated, &n_comp_units, &all_comp_units);
@@ -6613,9 +6606,9 @@ create_all_comp_units (struct objfile *objfile)
 				  &n_allocated, &n_comp_units,
 				  &all_comp_units);
 
-  dwarf2_per_objfile->all_comp_units
-    = obstack_alloc (&objfile->objfile_obstack,
-		     n_comp_units * sizeof (struct dwarf2_per_cu_data *));
+  dwarf2_per_objfile->all_comp_units = XOBNEWVEC (&objfile->objfile_obstack,
+						  struct dwarf2_per_cu_data *,
+						  n_comp_units);
   memcpy (dwarf2_per_objfile->all_comp_units, all_comp_units,
 	  n_comp_units * sizeof (struct dwarf2_per_cu_data *));
   xfree (all_comp_units);
@@ -7460,7 +7453,7 @@ queue_comp_unit (struct dwarf2_per_cu_data *per_cu,
   struct dwarf2_queue_item *item;
 
   per_cu->queued = 1;
-  item = xmalloc (sizeof (*item));
+  item = XNEW (struct dwarf2_queue_item);
   item->per_cu = per_cu;
   item->pretend_language = pretend_language;
   item->next = NULL;
@@ -7973,8 +7966,8 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu)
       /* Now we have a transitive closure of all the included symtabs.  */
       len = VEC_length (compunit_symtab_ptr, result_symtabs);
       cust->includes
-	= obstack_alloc (&dwarf2_per_objfile->objfile->objfile_obstack,
-			 (len + 1) * sizeof (struct compunit_symtab *));
+	= XOBNEWVEC (&dwarf2_per_objfile->objfile->objfile_obstack,
+		     struct compunit_symtab *, len + 1);
       for (ix = 0;
 	   VEC_iterate (compunit_symtab_ptr, result_symtabs, ix,
 			compunit_symtab_iter);
@@ -10148,8 +10141,8 @@ create_dwo_unit_in_dwp_v1 (struct dwp_file *dwp_file,
   dwo_unit = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct dwo_unit);
   dwo_unit->dwo_file = dwo_file;
   dwo_unit->signature = signature;
-  dwo_unit->section = obstack_alloc (&objfile->objfile_obstack,
-				     sizeof (struct dwarf2_section_info));
+  dwo_unit->section =
+    XOBNEW (&objfile->objfile_obstack, struct dwarf2_section_info);
   *dwo_unit->section = sections.info_or_types;
   /* dwo_unit->{offset,length,type_offset_in_tu} are set later.  */
 
@@ -10362,8 +10355,8 @@ create_dwo_unit_in_dwp_v2 (struct dwp_file *dwp_file,
   dwo_unit = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct dwo_unit);
   dwo_unit->dwo_file = dwo_file;
   dwo_unit->signature = signature;
-  dwo_unit->section = obstack_alloc (&objfile->objfile_obstack,
-				     sizeof (struct dwarf2_section_info));
+  dwo_unit->section =
+    XOBNEW (&objfile->objfile_obstack, struct dwarf2_section_info);
   *dwo_unit->section = create_dwp_v2_section (is_debug_types
 					      ? &dwp_file->sections.types
 					      : &dwp_file->sections.info,
@@ -11223,7 +11216,7 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
       child_die = sibling_die (child_die);
       die_children_count++;
     }
-  offsets = xmalloc (sizeof (*offsets) * die_children_count);
+  offsets = XNEWVEC (sect_offset, die_children_count);
   cleanups = make_cleanup (xfree, offsets);
 
   offsets_end = offsets;
@@ -11479,9 +11472,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
 
       templ_func->n_template_arguments = VEC_length (symbolp, template_args);
       templ_func->template_arguments
-	= obstack_alloc (&objfile->objfile_obstack,
-			 (templ_func->n_template_arguments
-			  * sizeof (struct symbol *)));
+        = XOBNEWVEC (&objfile->objfile_obstack, struct symbol *,
+		     templ_func->n_template_arguments);
       memcpy (templ_func->template_arguments,
 	      VEC_address (symbolp, template_args),
 	      (templ_func->n_template_arguments * sizeof (struct symbol *)));
@@ -11689,7 +11681,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
     {
       struct dwarf2_locexpr_baton *dlbaton;
 
-      dlbaton = obstack_alloc (&objfile->objfile_obstack, sizeof (*dlbaton));
+      dlbaton = XOBNEW (&objfile->objfile_obstack, struct dwarf2_locexpr_baton);
       dlbaton->data = DW_BLOCK (attr)->data;
       dlbaton->size = DW_BLOCK (attr)->size;
       dlbaton->per_cu = cu->per_cu;
@@ -12456,7 +12448,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
   const char *fieldname = "";
 
   /* Allocate a new field list entry and link it in.  */
-  new_field = (struct nextfield *) xmalloc (sizeof (struct nextfield));
+  new_field = XNEW (struct nextfield);
   make_cleanup (xfree, new_field);
   memset (new_field, 0, sizeof (struct nextfield));
 
@@ -12642,7 +12634,7 @@ dwarf2_add_typedef (struct field_info *fip, struct die_info *die,
   char *fieldname = "";
 
   /* Allocate a new field list entry and link it in.  */
-  new_field = xzalloc (sizeof (*new_field));
+  new_field = XCNEW (struct typedef_field_list);
   make_cleanup (xfree, new_field);
 
   gdb_assert (die->tag == DW_TAG_typedef);
@@ -12846,7 +12838,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
 
   /* Create a new member function field and chain it to the field list
      entry.  */
-  new_fnfield = (struct nextfnfield *) xmalloc (sizeof (struct nextfnfield));
+  new_fnfield = XNEW (struct nextfnfield);
   make_cleanup (xfree, new_fnfield);
   memset (new_fnfield, 0, sizeof (struct nextfnfield));
   new_fnfield->next = flp->head;
@@ -13303,9 +13295,9 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
 	  TYPE_N_TEMPLATE_ARGUMENTS (type)
 	    = VEC_length (symbolp, template_args);
 	  TYPE_TEMPLATE_ARGUMENTS (type)
-	    = obstack_alloc (&objfile->objfile_obstack,
-			     (TYPE_N_TEMPLATE_ARGUMENTS (type)
-			      * sizeof (struct symbol *)));
+	    = XOBNEWVEC (&objfile->objfile_obstack,
+			 struct symbol *,
+			 TYPE_N_TEMPLATE_ARGUMENTS (type));
 	  memcpy (TYPE_TEMPLATE_ARGUMENTS (type),
 		  VEC_address (symbolp, template_args),
 		  (TYPE_N_TEMPLATE_ARGUMENTS (type)
@@ -13899,8 +13891,7 @@ mark_common_block_symbol_computed (struct symbol *sym,
   gdb_assert (attr_form_is_block (member_loc)
 	      || attr_form_is_constant (member_loc));
 
-  baton = obstack_alloc (&objfile->objfile_obstack,
-			 sizeof (struct dwarf2_locexpr_baton));
+  baton = XOBNEW (&objfile->objfile_obstack, struct dwarf2_locexpr_baton);
   baton->per_cu = cu->per_cu;
   gdb_assert (baton->per_cu);
 
@@ -14813,7 +14804,7 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
 
   if (attr_form_is_block (attr))
     {
-      baton = obstack_alloc (obstack, sizeof (*baton));
+      baton = XOBNEW (obstack, struct dwarf2_property_baton);
       baton->referenced_type = NULL;
       baton->locexpr.per_cu = cu->per_cu;
       baton->locexpr.size = DW_BLOCK (attr)->size;
@@ -14841,7 +14832,7 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
 	  case DW_AT_location:
 	    if (attr_form_is_section_offset (target_attr))
 	      {
-		baton = obstack_alloc (obstack, sizeof (*baton));
+		baton = XOBNEW (obstack, struct dwarf2_property_baton);
 		baton->referenced_type = die_type (target_die, target_cu);
 		fill_in_loclist_baton (cu, &baton->loclist, target_attr);
 		prop->data.baton = baton;
@@ -14850,7 +14841,7 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
 	      }
 	    else if (attr_form_is_block (target_attr))
 	      {
-		baton = obstack_alloc (obstack, sizeof (*baton));
+		baton = XOBNEW (obstack, struct dwarf2_property_baton);
 		baton->referenced_type = die_type (target_die, target_cu);
 		baton->locexpr.per_cu = cu->per_cu;
 		baton->locexpr.size = DW_BLOCK (target_attr)->size;
@@ -14874,7 +14865,7 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
 						&offset))
 		return 0;
 
-	      baton = obstack_alloc (obstack, sizeof (*baton));
+	      baton = XOBNEW (obstack, struct dwarf2_property_baton);
 	      baton->referenced_type = read_type_die (target_die->parent,
 						      target_cu);
 	      baton->offset_info.offset = offset;
@@ -15271,9 +15262,9 @@ abbrev_table_alloc_abbrev (struct abbrev_table *abbrev_table)
 {
   struct abbrev_info *abbrev;
 
-  abbrev = (struct abbrev_info *)
-    obstack_alloc (&abbrev_table->abbrev_obstack, sizeof (struct abbrev_info));
+  abbrev = XOBNEW (&abbrev_table->abbrev_obstack, struct abbrev_info);
   memset (abbrev, 0, sizeof (struct abbrev_info));
+
   return abbrev;
 }
 
@@ -15332,9 +15323,9 @@ abbrev_table_read_table (struct dwarf2_section_info *section,
   abbrev_table = XNEW (struct abbrev_table);
   abbrev_table->offset = offset;
   obstack_init (&abbrev_table->abbrev_obstack);
-  abbrev_table->abbrevs = obstack_alloc (&abbrev_table->abbrev_obstack,
-					 (ABBREV_HASH_SIZE
-					  * sizeof (struct abbrev_info *)));
+  abbrev_table->abbrevs =
+    XOBNEWVEC (&abbrev_table->abbrev_obstack, struct abbrev_info *,
+	       ABBREV_HASH_SIZE);
   memset (abbrev_table->abbrevs, 0,
 	  ABBREV_HASH_SIZE * sizeof (struct abbrev_info *));
 
@@ -15344,7 +15335,7 @@ abbrev_table_read_table (struct dwarf2_section_info *section,
   abbrev_ptr += bytes_read;
 
   allocated_attrs = ATTR_ALLOC_CHUNK;
-  cur_attrs = xmalloc (allocated_attrs * sizeof (struct attr_abbrev));
+  cur_attrs = XNEWVEC (struct attr_abbrev, allocated_attrs);
 
   /* Loop until we reach an abbrev number of 0.  */
   while (abbrev_number)
@@ -15384,9 +15375,9 @@ abbrev_table_read_table (struct dwarf2_section_info *section,
 	  abbrev_ptr += bytes_read;
 	}
 
-      cur_abbrev->attrs = obstack_alloc (&abbrev_table->abbrev_obstack,
-					 (cur_abbrev->num_attrs
-					  * sizeof (struct attr_abbrev)));
+      cur_abbrev->attrs =
+	XOBNEWVEC (&abbrev_table->abbrev_obstack, struct attr_abbrev,
+		   cur_abbrev->num_attrs);
       memcpy (cur_abbrev->attrs, cur_attrs,
 	      cur_abbrev->num_attrs * sizeof (struct attr_abbrev));
 
@@ -15522,8 +15513,7 @@ load_partial_dies (const struct die_reader_specs *reader,
 			    hashtab_obstack_allocate,
 			    dummy_obstack_deallocate);
 
-  part_die = obstack_alloc (&cu->comp_unit_obstack,
-			    sizeof (struct partial_die_info));
+  part_die = XOBNEW (&cu->comp_unit_obstack, struct partial_die_info);
 
   while (1)
     {
@@ -15723,8 +15713,7 @@ load_partial_dies (const struct die_reader_specs *reader,
 	  *slot = part_die;
 	}
 
-      part_die = obstack_alloc (&cu->comp_unit_obstack,
-				sizeof (struct partial_die_info));
+      part_die = XOBNEW (&cu->comp_unit_obstack, struct partial_die_info);
 
       /* For some DIEs we want to follow their children (if any).  For C
 	 we have no reason to follow the children of structures; for other
@@ -17209,15 +17198,13 @@ add_include_dir (struct line_header *lh, const char *include_dir)
   if (lh->include_dirs_size == 0)
     {
       lh->include_dirs_size = 1; /* for testing */
-      lh->include_dirs = xmalloc (lh->include_dirs_size
-                                  * sizeof (*lh->include_dirs));
+      lh->include_dirs = XNEWVEC (const char *, lh->include_dirs_size);
     }
   else if (lh->num_include_dirs >= lh->include_dirs_size)
     {
       lh->include_dirs_size *= 2;
-      lh->include_dirs = xrealloc (lh->include_dirs,
-                                   (lh->include_dirs_size
-                                    * sizeof (*lh->include_dirs)));
+      lh->include_dirs = XRESIZEVEC (const char *, lh->include_dirs,
+				     lh->include_dirs_size);
     }
 
   lh->include_dirs[lh->num_include_dirs++] = include_dir;
@@ -17242,8 +17229,7 @@ add_file_name (struct line_header *lh,
   if (lh->file_names_size == 0)
     {
       lh->file_names_size = 1; /* for testing */
-      lh->file_names = xmalloc (lh->file_names_size
-                                * sizeof (*lh->file_names));
+      lh->file_names = XNEWVEC (struct file_entry, lh->file_names_size);
     }
   else if (lh->num_file_names >= lh->file_names_size)
     {
@@ -17330,7 +17316,7 @@ dwarf_decode_line_header (unsigned int offset, struct dwarf2_cu *cu)
       return 0;
     }
 
-  lh = xmalloc (sizeof (*lh));
+  lh = XNEW (struct line_header);
   memset (lh, 0, sizeof (*lh));
   back_to = make_cleanup ((make_cleanup_ftype *) free_line_header,
                           (void *) lh);
@@ -17390,8 +17376,7 @@ dwarf_decode_line_header (unsigned int offset, struct dwarf2_cu *cu)
   line_ptr += 1;
   lh->opcode_base = read_1_byte (abfd, line_ptr);
   line_ptr += 1;
-  lh->standard_opcode_lengths
-    = xmalloc (lh->opcode_base * sizeof (lh->standard_opcode_lengths[0]));
+  lh->standard_opcode_lengths = XNEWVEC (unsigned char, lh->opcode_base);
 
   lh->standard_opcode_lengths[0] = 1;  /* This should never be used anyway.  */
   for (i = 1; i < lh->opcode_base; ++i)
@@ -18764,7 +18749,7 @@ dwarf2_const_value_attr (const struct attribute *attr, struct type *type,
 	/* Symbols of this form are reasonably rare, so we just
 	   piggyback on the existing location code rather than writing
 	   a new implementation of symbol_computed_ops.  */
-	*baton = obstack_alloc (obstack, sizeof (struct dwarf2_locexpr_baton));
+	*baton = XOBNEW (obstack, struct dwarf2_locexpr_baton);
 	(*baton)->per_cu = cu->per_cu;
 	gdb_assert ((*baton)->per_cu);
 
@@ -20815,11 +20800,7 @@ decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
 static struct dwarf_block *
 dwarf_alloc_block (struct dwarf2_cu *cu)
 {
-  struct dwarf_block *blk;
-
-  blk = (struct dwarf_block *)
-    obstack_alloc (&cu->comp_unit_obstack, sizeof (struct dwarf_block));
-  return (blk);
+  return XOBNEW (&cu->comp_unit_obstack, struct dwarf_block);
 }
 
 static struct die_info *
@@ -21019,7 +21000,7 @@ parse_macro_definition (struct macro_source_file *file, int line,
       char *name = copy_string (body, p - body);
       int argc = 0;
       int argv_size = 1;
-      char **argv = xmalloc (argv_size * sizeof (*argv));
+      char **argv = XNEWVEC (char *, argv_size);
 
       p++;
 
@@ -21879,8 +21860,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
     {
       struct dwarf2_loclist_baton *baton;
 
-      baton = obstack_alloc (&objfile->objfile_obstack,
-			     sizeof (struct dwarf2_loclist_baton));
+      baton = XOBNEW (&objfile->objfile_obstack, struct dwarf2_loclist_baton);
 
       fill_in_loclist_baton (cu, baton, attr);
 
@@ -21898,8 +21878,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
     {
       struct dwarf2_locexpr_baton *baton;
 
-      baton = obstack_alloc (&objfile->objfile_obstack,
-			     sizeof (struct dwarf2_locexpr_baton));
+      baton = XOBNEW (&objfile->objfile_obstack, struct dwarf2_locexpr_baton);
       baton->per_cu = cu->per_cu;
       gdb_assert (baton->per_cu);
 
@@ -22365,7 +22344,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
     complaint (&symfile_complaints,
 	       _("A problem internal to GDB: DIE 0x%x has type already set"),
 	       die->offset.sect_off);
-  *slot = obstack_alloc (&objfile->objfile_obstack, sizeof (**slot));
+  *slot = XOBNEW (&objfile->objfile_obstack,
+		  struct dwarf2_per_cu_offset_and_type);
   **slot = ofs;
   return type;
 }
@@ -23282,9 +23262,8 @@ write_psymtabs_to_index (struct objfile *objfile, const char *dir)
 				     eq_psymtab_cu_index,
 				     NULL, xcalloc, xfree);
   make_cleanup_htab_delete (cu_index_htab);
-  psymtab_cu_index_map = (struct psymtab_cu_index_map *)
-    xmalloc (sizeof (struct psymtab_cu_index_map)
-	     * dwarf2_per_objfile->n_comp_units);
+  psymtab_cu_index_map = XNEWVEC (struct psymtab_cu_index_map,
+				  dwarf2_per_objfile->n_comp_units);
   make_cleanup (xfree, psymtab_cu_index_map);
 
   /* The CU list is already sorted, so we don't need to do additional
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 1e52515..fa900a0 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -95,7 +95,7 @@ elf_symfile_segments (bfd *abfd)
     return NULL;
 
   num_segments = 0;
-  segments = alloca (sizeof (Elf_Internal_Phdr *) * num_phdrs);
+  segments = XALLOCAVEC (Elf_Internal_Phdr *, num_phdrs);
   for (i = 0; i < num_phdrs; i++)
     if (phdrs[i].p_type == PT_LOAD)
       segments[num_segments++] = &phdrs[i];
@@ -1124,7 +1124,7 @@ elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags,
       long i;
 
       make_cleanup (xfree, synthsyms);
-      synth_symbol_table = xmalloc (sizeof (asymbol *) * synthcount);
+      synth_symbol_table = XNEWVEC (asymbol *, synthcount);
       for (i = 0; i < synthcount; i++)
 	synth_symbol_table[i] = synthsyms + i;
       make_cleanup (xfree, synth_symbol_table);
diff --git a/gdb/environ.c b/gdb/environ.c
index 824a6f5..cd314fe 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -29,7 +29,7 @@ make_environ (void)
 {
   struct gdb_environ *e;
 
-  e = (struct gdb_environ *) xmalloc (sizeof (struct gdb_environ));
+  e = XNEW (struct gdb_environ);
 
   e->allocated = 10;
   e->vector = (char **) xmalloc ((e->allocated + 1) * sizeof (char *));
diff --git a/gdb/eval.c b/gdb/eval.c
index 2beea10..a668e76 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -998,7 +998,7 @@ evaluate_subexp_standard (struct type *expect_type,
 	  return set;
 	}
 
-      argvec = (struct value **) alloca (sizeof (struct value *) * nargs);
+      argvec = XALLOCAVEC (struct value *, nargs);
       for (tem = 0; tem < nargs; tem++)
 	{
 	  /* Ensure that array expressions are coerced into pointer
@@ -1082,8 +1082,7 @@ evaluate_subexp_standard (struct type *expect_type,
 
 	selector = exp->elts[pc + 1].longconst;
 	nargs = exp->elts[pc + 2].longconst;
-	argvec = (struct value **) alloca (sizeof (struct value *) 
-					   * (nargs + 5));
+	argvec = XALLOCAVEC (struct value *, nargs + 5);
 
 	(*pos) += 3;
 
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index aee37bb..b1f3dd8 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -455,7 +455,7 @@ create_file_handler (int fd, int mask, handler_func * proc,
      change the data associated with it.  */
   if (file_ptr == NULL)
     {
-      file_ptr = (file_handler *) xmalloc (sizeof (file_handler));
+      file_ptr = XNEW (file_handler);
       file_ptr->fd = fd;
       file_ptr->ready_mask = 0;
       file_ptr->next_file = gdb_notifier.first_file_handler;
@@ -472,7 +472,7 @@ create_file_handler (int fd, int mask, handler_func * proc,
 					   * sizeof (struct pollfd)));
 	  else
 	    gdb_notifier.poll_fds =
-	      (struct pollfd *) xmalloc (sizeof (struct pollfd));
+	      XNEW (struct pollfd);
 	  (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->fd = fd;
 	  (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask;
 	  (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0;
@@ -875,8 +875,7 @@ create_async_signal_handler (sig_handler_func * proc,
 {
   async_signal_handler *async_handler_ptr;
 
-  async_handler_ptr =
-    (async_signal_handler *) xmalloc (sizeof (async_signal_handler));
+  async_handler_ptr = XNEW (async_signal_handler);
   async_handler_ptr->ready = 0;
   async_handler_ptr->next_handler = NULL;
   async_handler_ptr->proc = proc;
@@ -990,7 +989,7 @@ create_async_event_handler (async_event_handler_func *proc,
 {
   async_event_handler *h;
 
-  h = xmalloc (sizeof (*h));
+  h = XNEW (struct async_event_handler);
   h->ready = 0;
   h->next_handler = NULL;
   h->proc = proc;
@@ -1090,7 +1089,7 @@ create_timer (int milliseconds, timer_handler_func * proc,
 
   gettimeofday (&time_now, NULL);
 
-  timer_ptr = (struct gdb_timer *) xmalloc (sizeof (*timer_ptr));
+  timer_ptr = XNEW (struct gdb_timer);
   timer_ptr->when.tv_sec = time_now.tv_sec + delta.tv_sec;
   timer_ptr->when.tv_usec = time_now.tv_usec + delta.tv_usec;
   /* Carry?  */
diff --git a/gdb/exec.c b/gdb/exec.c
index f1b1049..8ddb3df 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -475,7 +475,7 @@ build_section_table (struct bfd *some_bfd, struct target_section **start,
   count = bfd_count_sections (some_bfd);
   if (*start)
     xfree (* start);
-  *start = (struct target_section *) xmalloc (count * sizeof (**start));
+  *start = XNEWVEC (struct target_section, count);
   *end = *start;
   bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);
   if (*end > *start + count)
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 9705d45..44d9e05 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -257,9 +257,7 @@ static struct fbsd_fork_child_info *fbsd_pending_children;
 static void
 fbsd_remember_child (pid_t pid)
 {
-  struct fbsd_fork_child_info *info;
-
-  info = xcalloc (1, sizeof *info);
+  struct fbsd_fork_child_info *info = XCNEW (struct fbsd_fork_child_info);
 
   info->child = pid;
   info->next = fbsd_pending_children;
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index 4ba62b0..959f578 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -170,7 +170,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
 	 argument.  */
       int argc = (strlen (allargs) + 1) / 2 + 2;
 
-      argv = (char **) alloca (argc * sizeof (*argv));
+      argv = XALLOCAVEC (char *, argc);
       argv[0] = exec_file;
       breakup_args (allargs, &argv[1]);
     }
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index f7fd00b..19ff87e 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -136,9 +136,8 @@ new_variant (void)
   struct gdbarch_tdep *var;
   int r;
 
-  var = xmalloc (sizeof (*var));
-  memset (var, 0, sizeof (*var));
-  
+  var = XCNEW (struct gdbarch_tdep);
+
   var->frv_abi = FRV_ABI_EABI;
   var->num_gprs = 64;
   var->num_fprs = 64;
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 07b38a3..94e457a 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -345,7 +345,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
      then use that to allocate the architecture vector.  */
   struct obstack *obstack = XNEW (struct obstack);
   obstack_init (obstack);
-  gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
+  gdbarch = XOBNEW (obstack, struct gdbarch);
   memset (gdbarch, 0, sizeof (*gdbarch));
   gdbarch->obstack = obstack;
 
@@ -4894,7 +4894,7 @@ static struct gdbarch_registration *gdbarch_registry = NULL;
 static void
 append_name (const char ***buf, int *nr, const char *name)
 {
-  *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
+  *buf = XRESIZEVEC (const char **, *buf, *nr + 1);
   (*buf)[*nr] = name;
   *nr += 1;
 }
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index c1e2c1a..7df37c9 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -924,7 +924,7 @@ extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_i
    If your architecture doesn't need to adjust instructions before
    single-stepping them, consider using simple_displaced_step_copy_insn
    here.
-
+  
    If the instruction cannot execute out of line, return NULL.  The
    core falls back to stepping past the instruction in-line instead in
    that case. */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 994a87b..5831b7b 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1741,7 +1741,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
      then use that to allocate the architecture vector.  */
   struct obstack *obstack = XNEW (struct obstack);
   obstack_init (obstack);
-  gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
+  gdbarch = XOBNEW (obstack, struct gdbarch);
   memset (gdbarch, 0, sizeof (*gdbarch));
   gdbarch->obstack = obstack;
 
@@ -2201,7 +2201,7 @@ static struct gdbarch_registration *gdbarch_registry = NULL;
 static void
 append_name (const char ***buf, int *nr, const char *name)
 {
-  *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
+  *buf = XRESIZEVEC (const char **, *buf, *nr + 1);
   (*buf)[*nr] = name;
   *nr += 1;
 }
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 6d77e94..5b9b170 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,58 @@
+2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* 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-25  Yao Qi  <yao.qi@linaro.org>
 
 	* linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index f94a27d..d834fbb 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -102,7 +102,7 @@ gdb_parse_agent_expr (char **actparm)
   ++act;  /* skip the X */
   act = unpack_varlen_hex (act, &xlen);
   ++act;  /* skip a comma */
-  aexpr = xmalloc (sizeof (struct agent_expr));
+  aexpr = XNEW (struct agent_expr);
   aexpr->length = xlen;
   aexpr->bytes = xmalloc (xlen);
   hex2bin (act, aexpr->bytes, xlen);
@@ -430,7 +430,7 @@ compile_bytecodes (struct agent_expr *aexpr)
 
       /* Record the compiled-code address of the bytecode, for use by
 	 jump instructions.  */
-      aentry = xmalloc (sizeof (struct bytecode_address));
+      aentry = XNEW (struct bytecode_address);
       aentry->pc = pc;
       aentry->address = current_insn_ptr;
       aentry->goto_pc = -1;
diff --git a/gdb/gdbserver/dll.c b/gdb/gdbserver/dll.c
index 1608527..c4f838c 100644
--- a/gdb/gdbserver/dll.c
+++ b/gdb/gdbserver/dll.c
@@ -60,8 +60,7 @@ match_dll (struct inferior_list_entry *inf, void *arg)
 void
 loaded_dll (const char *name, CORE_ADDR base_addr)
 {
-  struct dll_info *new_dll = xmalloc (sizeof (*new_dll));
-  memset (new_dll, 0, sizeof (*new_dll));
+  struct dll_info *new_dll = XCNEW (struct dll_info);
 
   new_dll->entry.id = minus_one_ptid;
 
diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c
index d27bc94..dd07093[...]

[diff truncated at 100000 bytes]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]