aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/tcg-all.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2022-09-29 12:42:23 +0100
committerAlex Bennée <alex.bennee@linaro.org>2022-10-06 11:53:41 +0100
commit3b7a93880a88fb2e3c0e71378a7d39d25103d734 (patch)
tree5dcaa148ff39601c313147703495d926cb2c402d /accel/tcg/tcg-all.c
parent842b42df2b5d3bf5ccbafba19dc756d531dcce23 (diff)
downloadqemu-3b7a93880a88fb2e3c0e71378a7d39d25103d734.zip
qemu-3b7a93880a88fb2e3c0e71378a7d39d25103d734.tar.gz
qemu-3b7a93880a88fb2e3c0e71378a7d39d25103d734.tar.bz2
gdbstub: move sstep flags probing into AccelClass
The support of single-stepping is very much dependent on support from the accelerator we are using. To avoid special casing in gdbstub move the probing out to an AccelClass function so future accelerators can put their code there. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Mads Ynddal <mads@ynddal.dk> Message-Id: <20220929114231.583801-44-alex.bennee@linaro.org>
Diffstat (limited to 'accel/tcg/tcg-all.c')
-rw-r--r--accel/tcg/tcg-all.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 47952ee..30b503f 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include "sysemu/tcg.h"
+#include "sysemu/replay.h"
#include "sysemu/cpu-timers.h"
#include "tcg/tcg.h"
#include "qapi/error.h"
@@ -207,12 +208,28 @@ static void tcg_set_splitwx(Object *obj, bool value, Error **errp)
s->splitwx_enabled = value;
}
+static int tcg_gdbstub_supported_sstep_flags(void)
+{
+ /*
+ * In replay mode all events will come from the log and can't be
+ * suppressed otherwise we would break determinism. However as those
+ * events are tied to the number of executed instructions we won't see
+ * them occurring every time we single step.
+ */
+ if (replay_mode != REPLAY_MODE_NONE) {
+ return SSTEP_ENABLE;
+ } else {
+ return SSTEP_ENABLE | SSTEP_NOIRQ | SSTEP_NOTIMER;
+ }
+}
+
static void tcg_accel_class_init(ObjectClass *oc, void *data)
{
AccelClass *ac = ACCEL_CLASS(oc);
ac->name = "tcg";
ac->init_machine = tcg_init_machine;
ac->allowed = &tcg_allowed;
+ ac->gdbstub_supported_sstep_flags = tcg_gdbstub_supported_sstep_flags;
object_class_property_add_str(oc, "thread",
tcg_get_thread,