aboutsummaryrefslogtreecommitdiff
path: root/include/exec/gdbstub.h
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2025-01-16 16:02:39 +0000
committerAlex Bennée <alex.bennee@linaro.org>2025-01-17 10:44:25 +0000
commitc0e6b8b798bee5d8772ca8db19638ec89b47c946 (patch)
tree377b31ac2186076bc2f9eeaebdc68ad9c14bb238 /include/exec/gdbstub.h
parent05cdd648a846bd60e300fcfa1eabf8f20e589cba (diff)
downloadqemu-c0e6b8b798bee5d8772ca8db19638ec89b47c946.zip
qemu-c0e6b8b798bee5d8772ca8db19638ec89b47c946.tar.gz
qemu-c0e6b8b798bee5d8772ca8db19638ec89b47c946.tar.bz2
system: propagate Error to gdbserver_start (and other device setups)
This started as a clean-up to properly pass a Error handler to the gdbserver_start so we could do the right thing for command line and HMP invocations. Now that we have cleaned up foreach_device_config_or_exit() in earlier patches we can further simplify by it by passing &error_fatal instead of checking the return value. Having a return value is still useful for HMP though so tweak the return to use a simple bool instead. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20250116160306.1709518-11-alex.bennee@linaro.org>
Diffstat (limited to 'include/exec/gdbstub.h')
-rw-r--r--include/exec/gdbstub.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index d73f424..0675b0b 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -49,12 +49,18 @@ void gdb_unregister_coprocessor_all(CPUState *cpu);
/**
* gdbserver_start: start the gdb server
* @port_or_device: connection spec for gdb
+ * @errp: error handle
*
* For CONFIG_USER this is either a tcp port or a path to a fifo. For
* system emulation you can use a full chardev spec for your gdbserver
* port.
+ *
+ * The error handle should be either &error_fatal (for start-up) or
+ * &error_warn (for QMP/HMP initiated sessions).
+ *
+ * Returns true when server successfully started.
*/
-int gdbserver_start(const char *port_or_device);
+bool gdbserver_start(const char *port_or_device, Error **errp);
/**
* gdb_feature_builder_init() - Initialize GDBFeatureBuilder.