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.
+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
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);
}
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);
}
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);
}
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);
}
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);
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");
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);
}
{
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;
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";
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,
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;
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)
/* 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)))
{
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;
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.
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;
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);
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;
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;
/* 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;
/* 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);
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
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";
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);
}
}
}
- inf_state = XZALLOC (struct infcall_suspend_state);
+ inf_state = XCNEW (struct infcall_suspend_state);
if (siginfo_data)
{
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;
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);
}
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);
}
/* 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,
/* 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;
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;
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)),
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;
&& !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;
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);
}
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;
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;
}
{
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);
{
struct program_space *pspace;
- pspace = XZALLOC (struct program_space);
+ pspace = XCNEW (struct program_space);
pspace->num = ++last_program_space_num;
pspace->aspace = aspace;
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. */
/* 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);
filename = arg;
}
- e = XZALLOC (struct skiplist_entry);
+ e = XCNEW (struct skiplist_entry);
e->filename = xstrdup (filename);
e->enabled = 1;
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);
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);
}
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");
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)
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;
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);
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;
{
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);
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;
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>",
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. */
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;
}
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);
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;
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));
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);
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);
/* 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,
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;
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 { \
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);
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
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;
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;
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;
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;
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;
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);
struct target_desc *
allocate_target_description (void)
{
- return XZALLOC (struct target_desc);
+ return XCNEW (struct target_desc);
}
static void
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;
#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);
if (scope->body == NULL)
{
- scope->body = XZALLOC (struct obstack);
+ scope->body = XCNEW (struct obstack);
obstack_init (scope->body);
}
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)
{
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);
static struct syscalls_info *
allocate_syscalls_info (void)
{
- return XZALLOC (struct syscalls_info);
+ return XCNEW (struct syscalls_info);
}
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;