return (value ? 1 : 0);
}
-/* Do memory copies for bytecodes. */
-/* Do the recording of memory blocks for actions and bytecodes. */
+/* See tracepoint.h. */
int
agent_mem_read (struct eval_agent_expr_context *ctx,
/* If a 'to' buffer is specified, use it. */
if (to != NULL)
- {
- read_inferior_memory (from, to, len);
- return 0;
- }
+ return read_inferior_memory (from, to, len);
/* Otherwise, create a new memory block in the trace buffer. */
while (remaining > 0)
memcpy (mspace, &blocklen, sizeof (blocklen));
mspace += sizeof (blocklen);
/* Record the memory block proper. */
- read_inferior_memory (from, mspace, blocklen);
+ if (read_inferior_memory (from, mspace, blocklen) != 0)
+ return 1;
trace_debug ("%d bytes recorded", blocklen);
remaining -= blocklen;
from += blocklen;
struct traceframe;
struct eval_agent_expr_context;
-/* Do memory copies for bytecodes. */
-/* Do the recording of memory blocks for actions and bytecodes. */
+/* When TO is not NULL, do memory copies for bytecodes, read LEN bytes
+ starting at address FROM, and place the result in the buffer TO.
+ Return 0 on success, otherwise a non-zero error code.
+
+ When TO is NULL, do the recording of memory blocks for actions and
+ bytecodes into a new traceframe block. Return 0 on success, otherwise,
+ return 1 if there is an error. */
int agent_mem_read (struct eval_agent_expr_context *ctx,
unsigned char *to, CORE_ADDR from,