}
static CORE_ADDR target_malloc (ULONGEST size);
-static int write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr);
#define COPY_FIELD_TO_BUF(BUF, OBJ, FIELD) \
do { \
write_inferior_memory (ipa_action, (unsigned char *) action,
sizeof (struct eval_expr_action));
expr = download_agent_expr (((struct eval_expr_action *) action)->expr);
- write_inferior_data_ptr (ipa_action
- + offsetof (struct eval_expr_action, expr),
- expr);
+ write_inferior_data_pointer (ipa_action
+ + offsetof (struct eval_expr_action, expr),
+ expr);
return ipa_action;
}
/* Start out empty. */
if (agent_loaded_p ())
- write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints, 0);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_tracepoints, 0);
/* Download and install tracepoints. */
for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
if (tpoint == tracepoints)
/* First object in list, set the head pointer in the
inferior. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints, tpptr);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_tracepoints, tpptr);
else
- write_inferior_data_ptr (prev_tpptr + offsetof (struct tracepoint,
- next),
- tpptr);
+ write_inferior_data_pointer (prev_tpptr
+ + offsetof (struct tracepoint, next),
+ tpptr);
}
/* Any failure in the inner loop is sufficient cause to give
*jump_entry += 16;
}
-/* We'll need to adjust these when we consider bi-arch setups. */
-
-static int
-write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr)
-{
- uintptr_t pptr = ptr;
-
- return write_inferior_memory (where,
- (unsigned char *) &pptr, sizeof pptr);
-}
-
/* The base pointer of the IPA's heap. This is the only memory the
IPA is allowed to use. The IPA should _not_ call the inferior's
`malloc' during operation. That'd be slow, and, most importantly,
write_inferior_memory (expr_addr, (unsigned char *) expr, sizeof (*expr));
expr_bytes = target_malloc (expr->length);
- write_inferior_data_ptr (expr_addr + offsetof (struct agent_expr, bytes),
- expr_bytes);
+ write_inferior_data_pointer (expr_addr + offsetof (struct agent_expr, bytes),
+ expr_bytes);
write_inferior_memory (expr_bytes, expr->bytes, expr->length);
return expr_addr;
sizeof (target_tracepoint));
if (tpoint->cond)
- write_inferior_data_ptr (tpptr + offsetof (struct tracepoint,
- cond),
- download_agent_expr (tpoint->cond));
+ write_inferior_data_pointer (tpptr
+ + offsetof (struct tracepoint, cond),
+ download_agent_expr (tpoint->cond));
if (tpoint->numactions)
{
/* The pointers array. */
actions_array
= target_malloc (sizeof (*tpoint->actions) * tpoint->numactions);
- write_inferior_data_ptr (tpptr + offsetof (struct tracepoint,
- actions),
- actions_array);
+ write_inferior_data_pointer (tpptr + offsetof (struct tracepoint,
+ actions),
+ actions_array);
/* Now for each pointer, download the action. */
for (i = 0; i < tpoint->numactions; i++)
CORE_ADDR ipa_action = tracepoint_action_download (action);
if (ipa_action != 0)
- write_inferior_data_ptr
- (actions_array + i * sizeof (*tpoint->actions),
- ipa_action);
+ write_inferior_data_pointer (actions_array
+ + i * sizeof (*tpoint->actions),
+ ipa_action);
}
}
}
}
/* tpoint->next = tp_prev->next */
- write_inferior_data_ptr (tpoint->obj_addr_on_target
- + offsetof (struct tracepoint, next),
- tp_prev_target_next_addr);
+ write_inferior_data_pointer (tpoint->obj_addr_on_target
+ + offsetof (struct tracepoint, next),
+ tp_prev_target_next_addr);
/* tp_prev->next = tpoint */
- write_inferior_data_ptr (tp_prev->obj_addr_on_target
- + offsetof (struct tracepoint, next),
- tpoint->obj_addr_on_target);
+ write_inferior_data_pointer (tp_prev->obj_addr_on_target
+ + offsetof (struct tracepoint, next),
+ tpoint->obj_addr_on_target);
}
else
/* First object in list, set the head pointer in the
inferior. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints,
- tpoint->obj_addr_on_target);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_tracepoints,
+ tpoint->obj_addr_on_target);
}
struct trace_state_variable *tsv;
/* Start out empty. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_trace_state_variables, 0);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_trace_state_variables, 0);
for (tsv = trace_state_variables; tsv != NULL; tsv = tsv->next)
{
/* First object in list, set the head pointer in the
inferior. */
- write_inferior_data_ptr (ipa_sym_addrs.addr_trace_state_variables,
- ptr);
+ write_inferior_data_pointer (ipa_sym_addrs.addr_trace_state_variables,
+ ptr);
}
else
{
- write_inferior_data_ptr (prev_ptr
- + offsetof (struct trace_state_variable,
- next),
- ptr);
+ write_inferior_data_pointer (prev_ptr
+ + offsetof (struct trace_state_variable,
+ next),
+ ptr);
}
/* Write the whole object. We'll fix up its pointers in a bit.
CORE_ADDR name_addr = target_malloc (size);
write_inferior_memory (name_addr,
(unsigned char *) tsv->name, size);
- write_inferior_data_ptr (ptr
- + offsetof (struct trace_state_variable,
- name),
- name_addr);
+ write_inferior_data_pointer (ptr
+ + offsetof (struct trace_state_variable,
+ name),
+ name_addr);
}
gdb_assert (tsv->getter == NULL);
if (prev_ptr != 0)
{
/* Fixup the next pointer in the last item in the list. */
- write_inferior_data_ptr (prev_ptr
- + offsetof (struct trace_state_variable,
- next), 0);
+ write_inferior_data_pointer (prev_ptr
+ + offsetof (struct trace_state_variable,
+ next), 0);
}
}