aboutsummaryrefslogtreecommitdiff
path: root/include/exec/gdbstub.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-05-15 19:19:58 +0100
committerLaurent Vivier <laurent@vivier.eu>2018-05-25 10:10:55 +0200
commit4f71086665360eb15cb0cc3392bd5063f26ee934 (patch)
tree62bf6efeeeb4e4baae4192d36da17728964acc7e /include/exec/gdbstub.h
parentb0a7413dd53cbb75227152374689c3bde39c89db (diff)
gdbstub: Clarify what gdb_handlesig() is doing
gdb_handlesig()'s behaviour is not entirely obvious at first glance. Add a doc comment for it, and also add a comment explaining why it's ok for gdb_do_syscallv() to ignore gdb_handlesig()'s return value. (Coverity complains about this: CID 1390850.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180515181958.25837-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'include/exec/gdbstub.h')
-rw-r--r--include/exec/gdbstub.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 2e8a4b83b9..08363969c1 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -48,6 +48,21 @@ int use_gdb_syscalls(void);
void gdb_set_stop_cpu(CPUState *cpu);
void gdb_exit(CPUArchState *, int);
#ifdef CONFIG_USER_ONLY
+/**
+ * gdb_handlesig: yield control to gdb
+ * @cpu: CPU
+ * @sig: if non-zero, the signal number which caused us to stop
+ *
+ * This function yields control to gdb, when a user-mode-only target
+ * needs to stop execution. If @sig is non-zero, then we will send a
+ * stop packet to tell gdb that we have stopped because of this signal.
+ *
+ * This function will block (handling protocol requests from gdb)
+ * until gdb tells us to continue target execution. When it does
+ * return, the return value is a signal to deliver to the target,
+ * or 0 if no signal should be delivered, ie the signal that caused
+ * us to stop should be ignored.
+ */
int gdb_handlesig(CPUState *, int);
void gdb_signalled(CPUArchState *, int);
void gdbserver_fork(CPUState *);