]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
replace XZALLOC with XCNEW
authorTom Tromey <tromey@redhat.com>
Sat, 28 Dec 2013 22:31:01 +0000 (15:31 -0700)
committerTom Tromey <tromey@redhat.com>
Mon, 13 Jan 2014 14:31:27 +0000 (07:31 -0700)
This replaces XZALLOC with XCNEW and removes XZALLOC.
This change is purely mechanical.

2014-01-13  Tom Tromey  <tromey@redhat.com>

* defs.h (XZALLOC): Remove.
* ada-lang.c (get_ada_inferior_data): Use XCNEW, not XZALLOC.
* ada-tasks.c (get_ada_tasks_pspace_data): Likewise.
(get_ada_tasks_inferior_data): Likewise.
* auto-load.c (get_auto_load_pspace_data): Likewise.
* auxv.c (get_auxv_inferior_data): Likewise.
* bfd-target.c (target_bfd_reopen): Likewise.
* breakpoint.c (get_catch_syscall_inferior_data): Likewise.
(deprecated_insert_raw_breakpoint): Likewise.
* bsd-uthread.c (bsd_uthread_pid_to_str): Likewise.
* corelow.c (core_open): Likewise.
* darwin-nat.c (darwin_check_new_threads): Likewise.
(darwin_attach_pid): Likewise.
* dummy-frame.c (dummy_frame_push): Likewise.
* dwarf2-frame.c (dwarf2_frame_cache): Likewise.
* dwarf2loc.c (allocate_piece_closure): Likewise.
* elfread.c (elf_symfile_segments): Likewise.
* eval.c (ptrmath_type_p): Likewise.
* exceptions.c (EXCEPTIONS_SIGJMP_BUF): Likewise.
* gdbtypes.c (alloc_type_arch): Likewise.
(alloc_type_instance): Likewise.
* hppa-tdep.c (hppa_gdbarch_init): Likewise.
* inf-child.c (inf_child_can_use_agent): Likewise.
* inflow.c (get_inflow_inferior_data): Likewise.
* infrun.c (save_infcall_suspend_state): Likewise.
* jit.c (jit_reader_load): Likewise.
(get_jit_objfile_data): Likewise.
(get_jit_program_space_data): Likewise.
(jit_object_open_impl): Likewise.
(jit_symtab_open_impl): Likewise.
(jit_block_open_impl): Likewise.
(jit_frame_sniffer): Likewise.
* linux-fork.c (add_fork): Likewise.
* maint.c (make_command_stats_cleanup): Likewise.
* objfiles.c (get_objfile_pspace_data): Likewise.
* opencl-lang.c (struct lval_closure): Likewise.
* osdata.c (osdata_start_osdata): Likewise.
* progspace.c (new_address_space): Likewise.
(add_program_space): Likewise.
* remote-sim.c (get_sim_inferior_data): Likewise.
* sh-tdep.c (sh_gdbarch_init): Likewise.
* skip.c (Ignore): Likewise.
(skip_delete_command): Likewise.
* solib-aix.c (get_solib_aix_inferior_data): Likewise.
(library_list_start_library): Likewise.
(solib_aix_current_sos): Likewise.
* solib-darwin.c (get_darwin_info): Likewise.
(darwin_current_sos): Likewise.
* solib-dsbt.c (get_dsbt_info): Likewise.
* solib-ia64-hpux.c (new_so_list): Likewise.
(ia64_hpux_get_solib_linkage_addr): Likewise.
* solib-spu.c (append_ocl_sos): Likewise.
(spu_current_sos): Likewise.
* solib-svr4.c (get_svr4_info): Likewise.
(svr4_keep_data_in_core): Likewise.
(library_list_start_library): Likewise.
(svr4_default_sos): Likewise.
(svr4_read_so_list): Likewise.
* solib-target.c (library_list_start_library): Likewise.
(solib_target_current_sos): Likewise.
* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
* symfile-debug.c (install_symfile_debug_logging): Likewise.
* symfile.c (default_symfile_segments): Likewise.
* target-descriptions.c (tdesc_data_init): Likewise.
(tdesc_create_reg): Likewise.
(struct tdesc_type *): Likewise.
(tdesc_create_vector): Likewise.
(tdesc_set_struct_size): Likewise.
(struct tdesc_type *): Likewise.
(tdesc_free_feature): Likewise.
(tdesc_create_feature): Likewise.
* windows-nat.c (windows_add_thread): Likewise.
(windows_make_so): Likewise.
* xml-support.c (gdb_xml_body_text): Likewise.
(gdb_xml_create_parser_and_cleanup): Likewise.
(xml_process_xincludes): Likewise.
* xml-syscall.c (allocate_syscalls_info): Likewise.
(syscall_create_syscall_desc): Likewise.

46 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/ada-tasks.c
gdb/auto-load.c
gdb/auxv.c
gdb/bfd-target.c
gdb/breakpoint.c
gdb/bsd-uthread.c
gdb/corelow.c
gdb/darwin-nat.c
gdb/defs.h
gdb/dummy-frame.c
gdb/dwarf2-frame.c
gdb/dwarf2loc.c
gdb/elfread.c
gdb/eval.c
gdb/exceptions.c
gdb/gdbtypes.c
gdb/hppa-tdep.c
gdb/inf-child.c
gdb/inflow.c
gdb/infrun.c
gdb/jit.c
gdb/linux-fork.c
gdb/maint.c
gdb/objfiles.c
gdb/opencl-lang.c
gdb/osdata.c
gdb/progspace.c
gdb/remote-sim.c
gdb/sh-tdep.c
gdb/skip.c
gdb/solib-aix.c
gdb/solib-darwin.c
gdb/solib-dsbt.c
gdb/solib-ia64-hpux.c
gdb/solib-spu.c
gdb/solib-svr4.c
gdb/solib-target.c
gdb/sparc-tdep.c
gdb/symfile-debug.c
gdb/symfile.c
gdb/target-descriptions.c
gdb/windows-nat.c
gdb/xml-support.c
gdb/xml-syscall.c

index fd7aeee76d5c6d8eb5628672c2f0e4869b916c0c..debaaff93cb2023ea654e94c1941320bbb5cea11 100644 (file)
@@ -1,3 +1,84 @@
+2014-01-13  Tom Tromey  <tromey@redhat.com>
+
+       * defs.h (XZALLOC): Remove.
+       * ada-lang.c (get_ada_inferior_data): Use XCNEW, not XZALLOC.
+       * ada-tasks.c (get_ada_tasks_pspace_data): Likewise.
+       (get_ada_tasks_inferior_data): Likewise.
+       * auto-load.c (get_auto_load_pspace_data): Likewise.
+       * auxv.c (get_auxv_inferior_data): Likewise.
+       * bfd-target.c (target_bfd_reopen): Likewise.
+       * breakpoint.c (get_catch_syscall_inferior_data): Likewise.
+       (deprecated_insert_raw_breakpoint): Likewise.
+       * bsd-uthread.c (bsd_uthread_pid_to_str): Likewise.
+       * corelow.c (core_open): Likewise.
+       * darwin-nat.c (darwin_check_new_threads): Likewise.
+       (darwin_attach_pid): Likewise.
+       * dummy-frame.c (dummy_frame_push): Likewise.
+       * dwarf2-frame.c (dwarf2_frame_cache): Likewise.
+       * dwarf2loc.c (allocate_piece_closure): Likewise.
+       * elfread.c (elf_symfile_segments): Likewise.
+       * eval.c (ptrmath_type_p): Likewise.
+       * exceptions.c (EXCEPTIONS_SIGJMP_BUF): Likewise.
+       * gdbtypes.c (alloc_type_arch): Likewise.
+       (alloc_type_instance): Likewise.
+       * hppa-tdep.c (hppa_gdbarch_init): Likewise.
+       * inf-child.c (inf_child_can_use_agent): Likewise.
+       * inflow.c (get_inflow_inferior_data): Likewise.
+       * infrun.c (save_infcall_suspend_state): Likewise.
+       * jit.c (jit_reader_load): Likewise.
+       (get_jit_objfile_data): Likewise.
+       (get_jit_program_space_data): Likewise.
+       (jit_object_open_impl): Likewise.
+       (jit_symtab_open_impl): Likewise.
+       (jit_block_open_impl): Likewise.
+       (jit_frame_sniffer): Likewise.
+       * linux-fork.c (add_fork): Likewise.
+       * maint.c (make_command_stats_cleanup): Likewise.
+       * objfiles.c (get_objfile_pspace_data): Likewise.
+       * opencl-lang.c (struct lval_closure): Likewise.
+       * osdata.c (osdata_start_osdata): Likewise.
+       * progspace.c (new_address_space): Likewise.
+       (add_program_space): Likewise.
+       * remote-sim.c (get_sim_inferior_data): Likewise.
+       * sh-tdep.c (sh_gdbarch_init): Likewise.
+       * skip.c (Ignore): Likewise.
+       (skip_delete_command): Likewise.
+       * solib-aix.c (get_solib_aix_inferior_data): Likewise.
+       (library_list_start_library): Likewise.
+       (solib_aix_current_sos): Likewise.
+       * solib-darwin.c (get_darwin_info): Likewise.
+       (darwin_current_sos): Likewise.
+       * solib-dsbt.c (get_dsbt_info): Likewise.
+       * solib-ia64-hpux.c (new_so_list): Likewise.
+       (ia64_hpux_get_solib_linkage_addr): Likewise.
+       * solib-spu.c (append_ocl_sos): Likewise.
+       (spu_current_sos): Likewise.
+       * solib-svr4.c (get_svr4_info): Likewise.
+       (svr4_keep_data_in_core): Likewise.
+       (library_list_start_library): Likewise.
+       (svr4_default_sos): Likewise.
+       (svr4_read_so_list): Likewise.
+       * solib-target.c (library_list_start_library): Likewise.
+       (solib_target_current_sos): Likewise.
+       * sparc-tdep.c (sparc32_gdbarch_init): Likewise.
+       * symfile-debug.c (install_symfile_debug_logging): Likewise.
+       * symfile.c (default_symfile_segments): Likewise.
+       * target-descriptions.c (tdesc_data_init): Likewise.
+       (tdesc_create_reg): Likewise.
+       (struct tdesc_type *): Likewise.
+       (tdesc_create_vector): Likewise.
+       (tdesc_set_struct_size): Likewise.
+       (struct tdesc_type *): Likewise.
+       (tdesc_free_feature): Likewise.
+       (tdesc_create_feature): Likewise.
+       * windows-nat.c (windows_add_thread): Likewise.
+       (windows_make_so): Likewise.
+       * xml-support.c (gdb_xml_body_text): Likewise.
+       (gdb_xml_create_parser_and_cleanup): Likewise.
+       (xml_process_xincludes): Likewise.
+       * xml-syscall.c (allocate_syscalls_info): Likewise.
+       (syscall_create_syscall_desc): Likewise.
+
 2014-01-12  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        * i386-tdep.c (i386_stap_parse_special_token_triplet): New
index e70a33b49cdc16f01014b4ac29fcc4361b12d98b..b3224f3d2c746c40cb8b55a95acfe724ac54e15c 100644 (file)
@@ -358,7 +358,7 @@ get_ada_inferior_data (struct inferior *inf)
   data = inferior_data (inf, ada_inferior_data);
   if (data == NULL)
     {
-      data = XZALLOC (struct ada_inferior_data);
+      data = XCNEW (struct ada_inferior_data);
       set_inferior_data (inf, ada_inferior_data, data);
     }
 
index 53a29e143f296715ccaa695825d895d336caec2e..a83035f2e2af92e0e4301d34d4b1855a5db439b8 100644 (file)
@@ -251,7 +251,7 @@ get_ada_tasks_pspace_data (struct program_space *pspace)
   data = program_space_data (pspace, ada_tasks_pspace_data_handle);
   if (data == NULL)
     {
-      data = XZALLOC (struct ada_tasks_pspace_data);
+      data = XCNEW (struct ada_tasks_pspace_data);
       set_program_space_data (pspace, ada_tasks_pspace_data_handle, data);
     }
 
@@ -278,7 +278,7 @@ get_ada_tasks_inferior_data (struct inferior *inf)
   data = inferior_data (inf, ada_tasks_inferior_data_handle);
   if (data == NULL)
     {
-      data = XZALLOC (struct ada_tasks_inferior_data);
+      data = XCNEW (struct ada_tasks_inferior_data);
       set_inferior_data (inf, ada_tasks_inferior_data_handle, data);
     }
 
index fd612b2a3b1a5fa731862c0888d6ecb031ad8555..46d063c9dd3890b407f21ac9884043b588914418 100644 (file)
@@ -595,7 +595,7 @@ get_auto_load_pspace_data (struct program_space *pspace)
   info = program_space_data (pspace, auto_load_pspace_data);
   if (info == NULL)
     {
-      info = XZALLOC (struct auto_load_pspace_info);
+      info = XCNEW (struct auto_load_pspace_info);
       set_program_space_data (pspace, auto_load_pspace_data, info);
     }
 
index b08f1d5e4663669802f6bcff7aeedec7da0f90bd..6223de2682425b007e96c14acfa219e075a58f8f 100644 (file)
@@ -341,7 +341,7 @@ get_auxv_inferior_data (struct target_ops *ops)
   info = inferior_data (inf, auxv_inferior_data);
   if (info == NULL)
     {
-      info = XZALLOC (struct auxv_info);
+      info = XCNEW (struct auxv_info);
       info->length = target_read_alloc (ops, TARGET_OBJECT_AUXV,
                                        NULL, &info->data);
       set_inferior_data (inf, auxv_inferior_data, info);
index 4cbac2008efe926c0056d10fff56153715a3edcf..559ca635f4193831f1a4709b89957bb521e6a70d 100644 (file)
@@ -83,12 +83,12 @@ target_bfd_reopen (struct bfd *abfd)
   struct target_ops *t;
   struct target_bfd_data *data;
 
-  data = XZALLOC (struct target_bfd_data);
+  data = XCNEW (struct target_bfd_data);
   data->bfd = abfd;
   gdb_bfd_ref (abfd);
   build_section_table (abfd, &data->table.sections, &data->table.sections_end);
 
-  t = XZALLOC (struct target_ops);
+  t = XCNEW (struct target_ops);
   t->to_shortname = "bfd";
   t->to_longname = _("BFD backed target");
   t->to_doc = _("You should never see this");
index 152f638e2b4fe44888ae607a8131ab22e3cfda1d..642ffdf8cc65e0a961cdbfca43f45a1ad24fa1cd 100644 (file)
@@ -8238,7 +8238,7 @@ get_catch_syscall_inferior_data (struct inferior *inf)
   inf_data = inferior_data (inf, catch_syscall_inferior_data);
   if (inf_data == NULL)
     {
-      inf_data = XZALLOC (struct catch_syscall_inferior_data);
+      inf_data = XCNEW (struct catch_syscall_inferior_data);
       set_inferior_data (inf, catch_syscall_inferior_data, inf_data);
     }
 
@@ -14994,7 +14994,7 @@ deprecated_insert_raw_breakpoint (struct gdbarch *gdbarch,
 {
   struct bp_target_info *bp_tgt;
 
-  bp_tgt = XZALLOC (struct bp_target_info);
+  bp_tgt = XCNEW (struct bp_target_info);
 
   bp_tgt->placed_address_space = aspace;
   bp_tgt->placed_address = pc;
index 5757e770510834fa8984f193432520fe6cdb6849..af522fa4994026f6a0da703de7fdd9008ffa7d08 100644 (file)
@@ -518,7 +518,7 @@ bsd_uthread_pid_to_str (struct target_ops *ops, ptid_t ptid)
 static struct target_ops *
 bsd_uthread_target (void)
 {
-  struct target_ops *t = XZALLOC (struct target_ops);
+  struct target_ops *t = XCNEW (struct target_ops);
 
   t->to_shortname = "bsd-uthreads";
   t->to_longname = "BSD user-level threads";
index 7183f62db1d2c0de5d41dabef1ed15064d873f57..8b20d3f5a08e6266189b3857499bae07cac0b3d6 100644 (file)
@@ -348,7 +348,7 @@ core_open (char *filename, int from_tty)
 
   validate_files ();
 
-  core_data = XZALLOC (struct target_section_table);
+  core_data = XCNEW (struct target_section_table);
 
   /* Find the data section */
   if (build_section_table (core_bfd,
index a21bb0f9f6d3f7188fe82aa621783d84d38f9c8b..f0935a6a53f15a29f024af52728574c2695f66b5 100644 (file)
@@ -350,7 +350,7 @@ darwin_check_new_threads (struct inferior *inf)
          struct thread_info *tp;
          struct private_thread_info *pti;
 
-         pti = XZALLOC (struct private_thread_info);
+         pti = XCNEW (struct private_thread_info);
          pti->gdb_port = new_id;
          pti->msg_state = DARWIN_RUNNING;
 
@@ -1344,7 +1344,7 @@ darwin_attach_pid (struct inferior *inf)
   mach_port_t prev_not;
   exception_mask_t mask;
 
-  inf->private = XZALLOC (darwin_inferior);
+  inf->private = XCNEW (darwin_inferior);
 
   kret = task_for_pid (gdb_task, inf->pid, &inf->private->task);
   if (kret != KERN_SUCCESS)
index f3f034f314022218fd3da431974ce5bdd07cf4f3..4c70cf67ece42f39945b0bd04c448f9504e43e84 100644 (file)
@@ -556,7 +556,6 @@ extern int longest_to_int (LONGEST);
 /* Utility macros to allocate typed memory.  Avoids errors like:
    struct foo *foo = xmalloc (sizeof struct bar); and memset (foo,
    sizeof (struct foo), 0).  */
-#define XZALLOC(TYPE) ((TYPE*) xzalloc (sizeof (TYPE)))
 #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
 #define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))
 
index 390b4c913f00c662d4a4bded9f551c2c9e7684a1..998ca934805308ebe9c4a5eef0730190101d7f62 100644 (file)
@@ -56,7 +56,7 @@ dummy_frame_push (struct infcall_suspend_state *caller_state,
 {
   struct dummy_frame *dummy_frame;
 
-  dummy_frame = XZALLOC (struct dummy_frame);
+  dummy_frame = XCNEW (struct dummy_frame);
   dummy_frame->caller_state = caller_state;
   dummy_frame->id = (*dummy_id);
   dummy_frame->next = dummy_frame_stack;
index 1907128600679197f8b52ae0eaa2e5412be1a3a2..3dcaf27580c4fac0ec45febc7dc638441bb8fb80 100644 (file)
@@ -1045,7 +1045,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
   reset_cache_cleanup = make_cleanup (clear_pointer_cleanup, this_cache);
 
   /* Allocate and initialize the frame state.  */
-  fs = XZALLOC (struct dwarf2_frame_state);
+  fs = XCNEW (struct dwarf2_frame_state);
   old_chain = make_cleanup (dwarf2_frame_state_free, fs);
 
   /* Unwind the PC.
index dd921ec0514bc8e0735380fc50d11e823e812c81..6185a6b4e2501c120e4305a0dfce70bf96608f98 100644 (file)
@@ -1414,7 +1414,7 @@ allocate_piece_closure (struct dwarf2_per_cu_data *per_cu,
                        int n_pieces, struct dwarf_expr_piece *pieces,
                        int addr_size)
 {
-  struct piece_closure *c = XZALLOC (struct piece_closure);
+  struct piece_closure *c = XCNEW (struct piece_closure);
   int i;
 
   c->refc = 1;
index 31f6470cd129b157ebfef93c81d2c8e70c394702..4f27aff19e1234ad86b9e55f74f02a860fc6024b 100644 (file)
@@ -105,7 +105,7 @@ elf_symfile_segments (bfd *abfd)
   if (num_segments == 0)
     return NULL;
 
-  data = XZALLOC (struct symfile_segment_data);
+  data = XCNEW (struct symfile_segment_data);
   data->num_segments = num_segments;
   data->segment_bases = XCALLOC (num_segments, CORE_ADDR);
   data->segment_sizes = XCALLOC (num_segments, CORE_ADDR);
index bfbe319b5064b53894f07c2efe83b19cbc3cc977..949f76cf2ef9dff2a17e259446898068ef6f48a7 100644 (file)
@@ -660,8 +660,8 @@ ptrmath_type_p (const struct language_defn *lang, struct type *type)
 static struct type *
 make_params (int num_types, struct type **param_types)
 {
-  struct type *type = XZALLOC (struct type);
-  TYPE_MAIN_TYPE (type) = XZALLOC (struct main_type);
+  struct type *type = XCNEW (struct type);
+  TYPE_MAIN_TYPE (type) = XCNEW (struct main_type);
   TYPE_LENGTH (type) = 1;
   TYPE_CODE (type) = TYPE_CODE_METHOD;
   TYPE_VPTR_FIELDNO (type) = -1;
index b0b6c971db9abd18e18a82dd7088c26f50fd8935..ca80893732127057c3144c5f14fe5b4fcabbc437 100644 (file)
@@ -86,7 +86,7 @@ EXCEPTIONS_SIGJMP_BUF *
 exceptions_state_mc_init (volatile struct gdb_exception *exception,
                          return_mask mask)
 {
-  struct catcher *new_catcher = XZALLOC (struct catcher);
+  struct catcher *new_catcher = XCNEW (struct catcher);
 
   /* Start with no exception, save it's address.  */
   exception->reason = 0;
index 8e3090d90361a27e79b287a2541f59c0b9c4e691..e02b66c7aacb9211714784c7992bec5b182a47d9 100644 (file)
@@ -201,8 +201,8 @@ alloc_type_arch (struct gdbarch *gdbarch)
 
   /* Alloc the structure and start off with all fields zeroed.  */
 
-  type = XZALLOC (struct type);
-  TYPE_MAIN_TYPE (type) = XZALLOC (struct main_type);
+  type = XCNEW (struct type);
+  TYPE_MAIN_TYPE (type) = XCNEW (struct main_type);
 
   TYPE_OBJFILE_OWNED (type) = 0;
   TYPE_OWNER (type).gdbarch = gdbarch;
@@ -268,7 +268,7 @@ alloc_type_instance (struct type *oldtype)
   /* Allocate the structure.  */
 
   if (! TYPE_OBJFILE_OWNED (oldtype))
-    type = XZALLOC (struct type);
+    type = XCNEW (struct type);
   else
     type = OBSTACK_ZALLOC (&TYPE_OBJFILE (oldtype)->objfile_obstack,
                           struct type);
index 68ec9cf39fb53aa62a90e494db77d3c487e2bbb0..53b6c950a4414b658396212c9e23febe3875ac82 100644 (file)
@@ -2997,7 +2997,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     return (arches->gdbarch);
 
   /* If none found, then allocate and initialize one.  */
-  tdep = XZALLOC (struct gdbarch_tdep);
+  tdep = XCNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Determine from the bfd_arch_info structure if we are dealing with
index d7225093b3569c73820c367e6ac8be79c54abb70..75944a0c9cf6013aa47f985fc905ddb87d380d80 100644 (file)
@@ -386,7 +386,7 @@ inf_child_can_use_agent (void)
 struct target_ops *
 inf_child_target (void)
 {
-  struct target_ops *t = XZALLOC (struct target_ops);
+  struct target_ops *t = XCNEW (struct target_ops);
 
   t->to_shortname = "child";
   t->to_longname = "Unix child process";
index 9e2444c15dbee4d06dd90c41a6398749196a7f0d..5503a42518cfa34a790f25b39cc5d371558f410b 100644 (file)
@@ -505,7 +505,7 @@ get_inflow_inferior_data (struct inferior *inf)
   info = inferior_data (inf, inflow_inferior_data);
   if (info == NULL)
     {
-      info = XZALLOC (struct terminal_info);
+      info = XCNEW (struct terminal_info);
       set_inferior_data (inf, inflow_inferior_data, info);
     }
 
index 51540b33425b276ac880abfe0849f17d53bd7aa7..73038a396eda36b5c97543243f326c05b8c9b663 100644 (file)
@@ -6851,7 +6851,7 @@ save_infcall_suspend_state (void)
        }
     }
 
-  inf_state = XZALLOC (struct infcall_suspend_state);
+  inf_state = XCNEW (struct infcall_suspend_state);
 
   if (siginfo_data)
     {
index ef6abbfe4cc8fc902b4ae35ba7d45c3cace2866f..ebbee5418e03882c7b8131cfaa1948eb37cd9363 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -189,7 +189,7 @@ jit_reader_load (const char *file_name)
   if (funcs->reader_version != GDB_READER_INTERFACE_VERSION)
     error (_("Reader version does not match GDB version."));
 
-  new_reader = XZALLOC (struct jit_reader);
+  new_reader = XCNEW (struct jit_reader);
   new_reader->functions = funcs;
   new_reader->handle = so;
 
@@ -288,7 +288,7 @@ get_jit_objfile_data (struct objfile *objf)
   objf_data = objfile_data (objf, jit_objfile_data);
   if (objf_data == NULL)
     {
-      objf_data = XZALLOC (struct jit_objfile_data);
+      objf_data = XCNEW (struct jit_objfile_data);
       set_objfile_data (objf, jit_objfile_data, objf_data);
     }
 
@@ -318,7 +318,7 @@ get_jit_program_space_data (void)
   ps_data = program_space_data (current_program_space, jit_program_space_data);
   if (ps_data == NULL)
     {
-      ps_data = XZALLOC (struct jit_program_space_data);
+      ps_data = XCNEW (struct jit_program_space_data);
       set_program_space_data (current_program_space, jit_program_space_data,
                              ps_data);
     }
@@ -504,7 +504,7 @@ jit_object_open_impl (struct gdb_symbol_callbacks *cb)
   /* CB is not required right now, but sometime in the future we might
      need a handle to it, and we'd like to do that without breaking
      the ABI.  */
-  return XZALLOC (struct gdb_object);
+  return XCNEW (struct gdb_object);
 }
 
 /* Readers call into this function to open a new gdb_symtab, which,
@@ -519,7 +519,7 @@ jit_symtab_open_impl (struct gdb_symbol_callbacks *cb,
 
   /* CB stays unused.  See comment in jit_object_open_impl.  */
 
-  ret = XZALLOC (struct gdb_symtab);
+  ret = XCNEW (struct gdb_symtab);
   ret->file_name = file_name ? xstrdup (file_name) : xstrdup ("");
   ret->next = object->symtabs;
   object->symtabs = ret;
@@ -557,7 +557,7 @@ jit_block_open_impl (struct gdb_symbol_callbacks *cb,
                      struct gdb_symtab *symtab, struct gdb_block *parent,
                      GDB_CORE_ADDR begin, GDB_CORE_ADDR end, const char *name)
 {
-  struct gdb_block *block = XZALLOC (struct gdb_block);
+  struct gdb_block *block = XCNEW (struct gdb_block);
 
   block->next = symtab->blocks;
   block->begin = (CORE_ADDR) begin;
@@ -1181,7 +1181,7 @@ jit_frame_sniffer (const struct frame_unwind *self,
 
   gdb_assert (!*cache);
 
-  *cache = XZALLOC (struct jit_unwind_private);
+  *cache = XCNEW (struct jit_unwind_private);
   priv_data = *cache;
   priv_data->registers =
     XCALLOC (gdbarch_num_regs (get_frame_arch (this_frame)),
index f8afd4ac74f79bce90ee7f4b99bb5471e5f2c9c9..cfe1ce555af0aac8ce8952bdd2f5dbe76618ce73 100644 (file)
@@ -81,7 +81,7 @@ add_fork (pid_t pid)
       add_fork (ptid_get_pid (inferior_ptid)); /* safe recursion */
     }
 
-  fp = XZALLOC (struct fork_info);
+  fp = XCNEW (struct fork_info);
   fp->ptid = ptid_build (pid, pid, 0);
   fp->num = ++highest_fork_num;
   fp->next = fork_list;
index df8a8fef89b347e5697a4bdc49b280b209ae56f1..41a39e79e4577e0d65da50d639ce8333c249da06 100644 (file)
@@ -902,7 +902,7 @@ make_command_stats_cleanup (int msg_type)
       && !per_command_symtab)
     return make_cleanup (null_cleanup, 0);
 
-  new_stat = XZALLOC (struct cmd_stats);
+  new_stat = XCNEW (struct cmd_stats);
 
   new_stat->msg_type = msg_type;
 
index 73847bdf64b18faff1dbbc9971d550bfd0f0d518..9cc0054557ec7cd9af688d2f3cd8d5956ddcc12c 100644 (file)
@@ -102,7 +102,7 @@ get_objfile_pspace_data (struct program_space *pspace)
   info = program_space_data (pspace, objfiles_pspace_data);
   if (info == NULL)
     {
-      info = XZALLOC (struct objfile_pspace_info);
+      info = XCNEW (struct objfile_pspace_info);
       set_program_space_data (pspace, objfiles_pspace_data, info);
     }
 
index 8dbd4cea255a1b4cdac92eb8bf656875ffddcc04..4bcaf7ecaecf8cf056f98fc94c7b2e11b017eb2c 100644 (file)
@@ -156,7 +156,7 @@ struct lval_closure
 static struct lval_closure *
 allocate_lval_closure (int *indices, int n, struct value *val)
 {
-  struct lval_closure *c = XZALLOC (struct lval_closure);
+  struct lval_closure *c = XCNEW (struct lval_closure);
 
   c->refc = 1;
   c->n = n;
index 887b4e3d2828babe224c39b1dbd605234965c899..fd00b4e8ea84d06912b51a793870a181ec1d6af7 100644 (file)
@@ -67,7 +67,7 @@ osdata_start_osdata (struct gdb_xml_parser *parser,
     gdb_xml_error (parser, _("Seen more than on osdata element"));
 
   type = xml_find_attribute (attributes, "type")->value;
-  osdata = XZALLOC (struct osdata);
+  osdata = XCNEW (struct osdata);
   osdata->type = xstrdup (type);
   data->osdata = osdata;
 }
index 9a6321fde89a047036a34914a6d67d2410a26707..14507ef11cedaf2b82a5e0c167e27a01123f5def 100644 (file)
@@ -70,7 +70,7 @@ new_address_space (void)
 {
   struct address_space *aspace;
 
-  aspace = XZALLOC (struct address_space);
+  aspace = XCNEW (struct address_space);
   aspace->num = ++highest_address_space_num;
   address_space_alloc_data (aspace);
 
@@ -126,7 +126,7 @@ add_program_space (struct address_space *aspace)
 {
   struct program_space *pspace;
 
-  pspace = XZALLOC (struct program_space);
+  pspace = XCNEW (struct program_space);
 
   pspace->num = ++last_program_space_num;
   pspace->aspace = aspace;
index b0f49225e45c0efea94b3789072c8c15fb412dcb..726372729238d41b4e24011710a61a0313b0d3be 100644 (file)
@@ -206,7 +206,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
 
   if (sim_data == NULL)
     {
-      sim_data = XZALLOC(struct sim_inferior_data);
+      sim_data = XCNEW(struct sim_inferior_data);
       set_inferior_data (inf, sim_inferior_data_key, sim_data);
 
       /* Allocate a ptid for this inferior.  */
index 6bfd041f7d17723065dd0213e27dfc1fa0a5c70e..85f8067acd5376f8939808f8b0fc4ca079e03290 100644 (file)
@@ -2253,7 +2253,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* None found, create a new architecture from the information
      provided.  */
-  tdep = XZALLOC (struct gdbarch_tdep);
+  tdep = XCNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
index 5aadb73b0a90290d1d5347f9741aa974a171052f..64a0254ba37160fcede121bad5b165c4d639bb0b 100644 (file)
@@ -101,7 +101,7 @@ Ignore file pending future shared library load? ")))
       filename = arg;
     }
 
-  e = XZALLOC (struct skiplist_entry);
+  e = XCNEW (struct skiplist_entry);
   e->filename = xstrdup (filename);
   e->enabled = 1;
 
@@ -295,7 +295,7 @@ skip_delete_command (char *arg, int from_tty)
 static void
 skip_function (const char *name)
 {
-  struct skiplist_entry *e = XZALLOC (struct skiplist_entry);
+  struct skiplist_entry *e = XCNEW (struct skiplist_entry);
 
   e->enabled = 1;
   e->function_name = xstrdup (name);
index fefa51ff8e0758755e284b9be9e3f63321a4be63..8f335f6a76c3649fc342bc15dc4bc870d3496dea 100644 (file)
@@ -115,7 +115,7 @@ get_solib_aix_inferior_data (struct inferior *inf)
   data = inferior_data (inf, solib_aix_inferior_data_handle);
   if (data == NULL)
     {
-      data = XZALLOC (struct solib_aix_inferior_data);
+      data = XCNEW (struct solib_aix_inferior_data);
       set_inferior_data (inf, solib_aix_inferior_data_handle, data);
     }
 
@@ -161,7 +161,7 @@ library_list_start_library (struct gdb_xml_parser *parser,
                            VEC (gdb_xml_value_s) *attributes)
 {
   VEC (lm_info_p) **list = user_data;
-  struct lm_info *item = XZALLOC (struct lm_info);
+  struct lm_info *item = XCNEW (struct lm_info);
   struct gdb_xml_value *attr;
 
   attr = xml_find_attribute (attributes, "name");
@@ -575,7 +575,7 @@ solib_aix_current_sos (void)
      to the main executable, not a shared library.  */
   for (ix = 1; VEC_iterate (lm_info_p, library_list, ix, info); ix++)
     {
-      struct so_list *new_solib = XZALLOC (struct so_list);
+      struct so_list *new_solib = XCNEW (struct so_list);
       char *so_name;
 
       if (info->member_name == NULL)
index ba807a2746cba1a00052b69b3e1e82c61db99da6..e8d46672189c02e42b2caee6f10e5d57d289f87d 100644 (file)
@@ -103,7 +103,7 @@ get_darwin_info (void)
   if (info != NULL)
     return info;
 
-  info = XZALLOC (struct darwin_info);
+  info = XCNEW (struct darwin_info);
   set_program_space_data (current_program_space,
                          solib_darwin_pspace_data, info);
   return info;
@@ -304,7 +304,7 @@ darwin_current_sos (void)
        break;
 
       /* Create and fill the new so_list element.  */
-      dnew = XZALLOC (struct darwin_so_list);
+      dnew = XCNEW (struct darwin_so_list);
       new = &dnew->sl;
       old_chain = make_cleanup (xfree, dnew);
 
index 075c92ef2b327ac2013e6cc5df58405e3d747030..713fa5195721c0a80092f984f3c0104b063e7100 100644 (file)
@@ -181,7 +181,7 @@ get_dsbt_info (void)
   if (info != NULL)
     return info;
 
-  info = XZALLOC (struct dsbt_info);
+  info = XCNEW (struct dsbt_info);
   set_program_space_data (current_program_space, solib_dsbt_pspace_data, info);
 
   info->lm_base_cache = 0;
index d91b2a134e6cad250125d6bb6fed29a53d01e71d..b53caa8e5d9da10775e6a340b9d01184ba03df17 100644 (file)
@@ -86,8 +86,8 @@ new_so_list (char *so_name, struct load_module_desc module_desc)
 {
   struct so_list *new_so;
 
-  new_so = (struct so_list *) XZALLOC (struct so_list);
-  new_so->lm_info = (struct lm_info *) XZALLOC (struct lm_info);
+  new_so = (struct so_list *) XCNEW (struct so_list);
+  new_so->lm_info = (struct lm_info *) XCNEW (struct lm_info);
   new_so->lm_info->module_desc = module_desc;
 
   strncpy (new_so->so_name, so_name, SO_NAME_MAX_PATH_SIZE - 1);
@@ -677,7 +677,7 @@ ia64_hpux_get_solib_linkage_addr (CORE_ADDR faddr)
 static struct target_so_ops *
 ia64_hpux_target_so_ops (void)
 {
-  struct target_so_ops *ops = XZALLOC (struct target_so_ops);
+  struct target_so_ops *ops = XCNEW (struct target_so_ops);
 
   ops->relocate_section_addresses = ia64_hpux_relocate_section_addresses;
   ops->free_so = ia64_hpux_free_so;
index abb8c159db90a328c06c378f609f028a567f2c45..b8e5e2359b7c91eb84bbd407e9a9a6ec337367e2 100644 (file)
@@ -125,7 +125,7 @@ append_ocl_sos (struct so_list **link_ptr)
                  struct so_list *new;
 
                  /* Allocate so_list structure.  */
-                 new = XZALLOC (struct so_list);
+                 new = XCNEW (struct so_list);
 
                  /* Encode FD and object ID in path name.  */
                  xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>",
@@ -217,7 +217,7 @@ spu_current_sos (void)
        continue;
 
       /* Allocate so_list structure.  */
-      new = XZALLOC (struct so_list);
+      new = XCNEW (struct so_list);
 
       /* Encode FD and object ID in path name.  Choose the name so as not
         to conflict with any (normal) SVR4 library path name.  */
index cf9d65140e967230c5546c4e785212732f0c59c0..55572d4e93f55fb3836e46678fe80f9becbb7502 100644 (file)
@@ -427,7 +427,7 @@ get_svr4_info (void)
   if (info != NULL)
     return info;
 
-  info = XZALLOC (struct svr4_info);
+  info = XCNEW (struct svr4_info);
   set_program_space_data (current_program_space, solib_svr4_pspace_data, info);
   return info;
 }
@@ -949,7 +949,7 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
   if (!ldsomap)
     return 0;
 
-  new = XZALLOC (struct so_list);
+  new = XCNEW (struct so_list);
   old_chain = make_cleanup (xfree, new);
   new->lm_info = lm_info_read (ldsomap);
   make_cleanup (xfree, new->lm_info);
@@ -1126,8 +1126,8 @@ library_list_start_library (struct gdb_xml_parser *parser,
   ULONGEST *l_ldp = xml_find_attribute (attributes, "l_ld")->value;
   struct so_list *new_elem;
 
-  new_elem = XZALLOC (struct so_list);
-  new_elem->lm_info = XZALLOC (struct lm_info);
+  new_elem = XCNEW (struct so_list);
+  new_elem->lm_info = XCNEW (struct lm_info);
   new_elem->lm_info->lm_addr = *lmp;
   new_elem->lm_info->l_addr_inferior = *l_addrp;
   new_elem->lm_info->l_ld = *l_ldp;
@@ -1279,7 +1279,7 @@ svr4_default_sos (void)
   if (!info->debug_loader_offset_p)
     return NULL;
 
-  new = XZALLOC (struct so_list);
+  new = XCNEW (struct so_list);
 
   new->lm_info = xzalloc (sizeof (struct lm_info));
 
@@ -1316,7 +1316,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
       int errcode;
       char *buffer;
 
-      new = XZALLOC (struct so_list);
+      new = XCNEW (struct so_list);
       old_chain = make_cleanup_free_so (new);
 
       new->lm_info = lm_info_read (lm);
index fb12934238f1cb010b7289d1cf031b0a39d3ed5a..bb34e4b7918ff8cd717b2f58e8a1c1d49f7b4222 100644 (file)
@@ -119,7 +119,7 @@ library_list_start_library (struct gdb_xml_parser *parser,
                            void *user_data, VEC(gdb_xml_value_s) *attributes)
 {
   VEC(lm_info_p) **list = user_data;
-  struct lm_info *item = XZALLOC (struct lm_info);
+  struct lm_info *item = XCNEW (struct lm_info);
   const char *name = xml_find_attribute (attributes, "name")->value;
 
   item->name = xstrdup (name);
@@ -274,7 +274,7 @@ solib_target_current_sos (void)
   /* Build a struct so_list for each entry on the list.  */
   for (ix = 0; VEC_iterate (lm_info_p, library_list, ix, info); ix++)
     {
-      new_solib = XZALLOC (struct so_list);
+      new_solib = XCNEW (struct so_list);
       strncpy (new_solib->so_name, info->name, SO_NAME_MAX_PATH_SIZE - 1);
       new_solib->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
       strncpy (new_solib->so_original_name, info->name,
index 66ef84e9ffc6d78368c68b50485a5ed5de4d6602..38b345b888dd6a0509638f374d3397ac8b989ac9 100644 (file)
@@ -1653,7 +1653,7 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     return arches->gdbarch;
 
   /* Allocate space for the new architecture.  */
-  tdep = XZALLOC (struct gdbarch_tdep);
+  tdep = XCNEW (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   tdep->pc_regnum = SPARC32_PC_REGNUM;
index 57d4af04f48cde59127d7607abc8373690da74b7..705d9cb4bf812e1ffbf3e10c57bb6f2461a2a470 100644 (file)
@@ -575,7 +575,7 @@ install_symfile_debug_logging (struct objfile *objfile)
   real_sf = objfile->sf;
 
   /* Alas we have to preserve NULL entries in REAL_SF.  */
-  debug_data = XZALLOC (struct debug_sym_fns_data);
+  debug_data = XCNEW (struct debug_sym_fns_data);
 
 #define COPY_SF_PTR(from, to, name, func)      \
   do {                                         \
index ddeefb7877307a8f3e2fef097209b9e2902cb77d..02471a4f9b28fbc8ab4aef28999d4c83ee6f38e3 100644 (file)
@@ -799,7 +799,7 @@ default_symfile_segments (bfd *abfd)
   low = bfd_get_section_vma (abfd, sect);
   high = low + bfd_get_section_size (sect);
 
-  data = XZALLOC (struct symfile_segment_data);
+  data = XCNEW (struct symfile_segment_data);
   data->num_segments = 1;
   data->segment_bases = XCALLOC (1, CORE_ADDR);
   data->segment_sizes = XCALLOC (1, CORE_ADDR);
index 9147dbe944a61f04f1f280167aa15bcd66878ccf..953748be706bf4de78026d29f49c4a587b109f50 100644 (file)
@@ -804,7 +804,7 @@ tdesc_data_init (struct obstack *obstack)
 struct tdesc_arch_data *
 tdesc_data_alloc (void)
 {
-  return XZALLOC (struct tdesc_arch_data);
+  return XCNEW (struct tdesc_arch_data);
 }
 
 /* Free something allocated by tdesc_data_alloc, if it is not going
@@ -1242,7 +1242,7 @@ tdesc_create_reg (struct tdesc_feature *feature, const char *name,
                  int regnum, int save_restore, const char *group,
                  int bitsize, const char *type)
 {
-  struct tdesc_reg *reg = XZALLOC (struct tdesc_reg);
+  struct tdesc_reg *reg = XCNEW (struct tdesc_reg);
 
   reg->name = xstrdup (name);
   reg->target_regnum = regnum;
@@ -1304,7 +1304,7 @@ struct tdesc_type *
 tdesc_create_vector (struct tdesc_feature *feature, const char *name,
                     struct tdesc_type *field_type, int count)
 {
-  struct tdesc_type *type = XZALLOC (struct tdesc_type);
+  struct tdesc_type *type = XCNEW (struct tdesc_type);
 
   type->name = xstrdup (name);
   type->kind = TDESC_TYPE_VECTOR;
@@ -1318,7 +1318,7 @@ tdesc_create_vector (struct tdesc_feature *feature, const char *name,
 struct tdesc_type *
 tdesc_create_struct (struct tdesc_feature *feature, const char *name)
 {
-  struct tdesc_type *type = XZALLOC (struct tdesc_type);
+  struct tdesc_type *type = XCNEW (struct tdesc_type);
 
   type->name = xstrdup (name);
   type->kind = TDESC_TYPE_STRUCT;
@@ -1341,7 +1341,7 @@ tdesc_set_struct_size (struct tdesc_type *type, LONGEST size)
 struct tdesc_type *
 tdesc_create_union (struct tdesc_feature *feature, const char *name)
 {
-  struct tdesc_type *type = XZALLOC (struct tdesc_type);
+  struct tdesc_type *type = XCNEW (struct tdesc_type);
 
   type->name = xstrdup (name);
   type->kind = TDESC_TYPE_UNION;
@@ -1354,7 +1354,7 @@ struct tdesc_type *
 tdesc_create_flags (struct tdesc_feature *feature, const char *name,
                    LONGEST size)
 {
-  struct tdesc_type *type = XZALLOC (struct tdesc_type);
+  struct tdesc_type *type = XCNEW (struct tdesc_type);
 
   type->name = xstrdup (name);
   type->kind = TDESC_TYPE_FLAGS;
@@ -1436,7 +1436,7 @@ tdesc_free_feature (struct tdesc_feature *feature)
 struct tdesc_feature *
 tdesc_create_feature (struct target_desc *tdesc, const char *name)
 {
-  struct tdesc_feature *new_feature = XZALLOC (struct tdesc_feature);
+  struct tdesc_feature *new_feature = XCNEW (struct tdesc_feature);
 
   new_feature->name = xstrdup (name);
 
@@ -1447,7 +1447,7 @@ tdesc_create_feature (struct target_desc *tdesc, const char *name)
 struct target_desc *
 allocate_target_description (void)
 {
-  return XZALLOC (struct target_desc);
+  return XCNEW (struct target_desc);
 }
 
 static void
index 6cd2c469ba16be8276f3021a49f05e33a44c9157..b42e5df1557a1f9509fa4afad085d64c00204a89 100644 (file)
@@ -341,7 +341,7 @@ windows_add_thread (ptid_t ptid, HANDLE h, void *tlb)
   if ((th = thread_rec (id, FALSE)))
     return th;
 
-  th = XZALLOC (thread_info);
+  th = XCNEW (thread_info);
   th->id = id;
   th->h = h;
   th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb;
@@ -728,7 +728,7 @@ windows_make_so (const char *name, LPVOID load_addr)
 #endif
     }
 #endif
-  so = XZALLOC (struct so_list);
+  so = XCNEW (struct so_list);
   so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
   so->lm_info->load_addr = load_addr;
   strcpy (so->so_original_name, name);
index 5d058b4a660a5a5f279463f55f8fea23a6c4d061..5062bc155f841361d8aec16066b18ab04fc72977 100644 (file)
@@ -94,7 +94,7 @@ gdb_xml_body_text (void *data, const XML_Char *text, int length)
 
   if (scope->body == NULL)
     {
-      scope->body = XZALLOC (struct obstack);
+      scope->body = XCNEW (struct obstack);
       obstack_init (scope->body);
     }
 
@@ -454,7 +454,7 @@ gdb_xml_create_parser_and_cleanup (const char *name,
   struct cleanup *result;
 
   /* Initialize the parser.  */
-  parser = XZALLOC (struct gdb_xml_parser);
+  parser = XCNEW (struct gdb_xml_parser);
   parser->expat_parser = XML_ParserCreateNS (NULL, '!');
   if (parser->expat_parser == NULL)
     {
@@ -877,7 +877,7 @@ xml_process_xincludes (const char *name, const char *text,
   struct cleanup *back_to;
   char *result = NULL;
 
-  data = XZALLOC (struct xinclude_parsing_data);
+  data = XCNEW (struct xinclude_parsing_data);
   obstack_init (&data->obstack);
   back_to = make_cleanup (xml_xinclude_cleanup, data);
 
index 986b75c1b895a5c02f301d7f9a971cc0ae45a21f..31d4ae63ef3f195c422a5dbafcbd92abc43cbef2 100644 (file)
@@ -126,7 +126,7 @@ static const char *xml_syscall_file = NULL;
 static struct syscalls_info *
 allocate_syscalls_info (void)
 {
-  return XZALLOC (struct syscalls_info);
+  return XCNEW (struct syscalls_info);
 }
 
 static void
@@ -161,7 +161,7 @@ static void
 syscall_create_syscall_desc (struct syscalls_info *sysinfo,
                              const char *name, int number)
 {
-  struct syscall_desc *sysdesc = XZALLOC (struct syscall_desc);
+  struct syscall_desc *sysdesc = XCNEW (struct syscall_desc);
 
   sysdesc->name = xstrdup (name);
   sysdesc->number = number;