aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/tracepoint.h
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-10-20 10:58:02 +0100
committerAndrew Burgess <aburgess@redhat.com>2023-04-03 14:46:32 +0100
commit0576dff20f052ab6d1ddba861235c7dc2584a145 (patch)
treebf13ca4bf84057252c0be0c31d44ca51eff6c41b /gdbserver/tracepoint.h
parent2dc3457a454a35d0617dc1f9cc1db77468471f95 (diff)
downloadfsf-binutils-gdb-0576dff20f052ab6d1ddba861235c7dc2584a145.zip
fsf-binutils-gdb-0576dff20f052ab6d1ddba861235c7dc2584a145.tar.gz
fsf-binutils-gdb-0576dff20f052ab6d1ddba861235c7dc2584a145.tar.bz2
gdbserver: allows agent_mem_read to return an error code
Currently the gdbserver function agent_mem_read ignores any errors from calling read_inferior_memory. This means that if there is an attempt to access invalid memory then this will appear to succeed. In this patch I update agent_mem_read so that if read_inferior_memory fails, agent_mem_read will return an error code. However, none of the callers of agent_mem_read actually check the return value, so this commit will have no effect on anything. In the next commit I will update the users of agent_mem_read to check for the error code. I've also updated the header comments on agent_mem_read to better reflect what the function does, and its possible return values.
Diffstat (limited to 'gdbserver/tracepoint.h')
-rw-r--r--gdbserver/tracepoint.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdbserver/tracepoint.h b/gdbserver/tracepoint.h
index 060d44d..1f40d7b 100644
--- a/gdbserver/tracepoint.h
+++ b/gdbserver/tracepoint.h
@@ -161,8 +161,13 @@ void gdb_agent_about_to_close (int pid);
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,