return bp;
}
- bp = xcalloc (1, sizeof (*bp));
+ bp = XCNEW (struct raw_breakpoint);
bp->pc = where;
bp->size = size;
bp->refcount = 1;
return NULL;
}
- bp = xcalloc (1, sizeof (struct breakpoint));
+ bp = XCNEW (struct breakpoint);
bp->type = type;
bp->raw = raw;
struct point_cond_list *new_cond;
/* Create new condition. */
- new_cond = xcalloc (1, sizeof (*new_cond));
+ new_cond = XCNEW (struct point_cond_list);
new_cond->cond = condition;
/* Add condition to the list. */
struct point_command_list *new_cmd;
/* Create new command. */
- new_cmd = xcalloc (1, sizeof (*new_cmd));
+ new_cmd = XCNEW (struct point_command_list);
new_cmd->cmd = commands;
new_cmd->persistence = persist;
{
struct agent_expr *ax;
- ax = xcalloc (1, sizeof (*ax));
+ ax = XCNEW (struct agent_expr);
ax->length = src_ax->length;
ax->bytes = xcalloc (ax->length, 1);
memcpy (ax->bytes, src_ax->bytes, ax->length);
struct point_command_list *cmd_tail = NULL;
/* Clone the raw breakpoint. */
- dest_raw = xcalloc (1, sizeof (*dest_raw));
+ dest_raw = XCNEW (struct raw_breakpoint);
dest_raw->raw_type = src->raw->raw_type;
dest_raw->refcount = src->raw->refcount;
dest_raw->pc = src->raw->pc;
dest_raw->inserted = src->raw->inserted;
/* Clone the high-level breakpoint. */
- dest = xcalloc (1, sizeof (*dest));
+ dest = XCNEW (struct breakpoint);
dest->type = src->type;
dest->raw = dest_raw;
dest->handler = src->handler;
for (current_cond = src->cond_list; current_cond != NULL;
current_cond = current_cond->next)
{
- new_cond = xcalloc (1, sizeof (*new_cond));
+ new_cond = XCNEW (struct point_cond_list);
new_cond->cond = clone_agent_expr (current_cond->cond);
APPEND_TO_LIST (&dest->cond_list, new_cond, cond_tail);
}
for (current_cmd = src->command_list; current_cmd != NULL;
current_cmd = current_cmd->next)
{
- new_cmd = xcalloc (1, sizeof (*new_cmd));
+ new_cmd = XCNEW (struct point_command_list);
new_cmd->cmd = clone_agent_expr (current_cmd->cmd);
new_cmd->persistence = current_cmd->persistence;
APPEND_TO_LIST (&dest->command_list, new_cmd, cmd_tail);