diff mbox series

[07/32] accel/tcg: Record when translator_fake_ldb is used

Message ID 20240405102459.462551-8-richard.henderson@linaro.org
State New
Headers show
Series accel/tcg: Improve disassembly for target and plugin | expand

Commit Message

Richard Henderson April 5, 2024, 10:24 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/exec/translator.h | 2 ++
 accel/tcg/translator.c    | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/include/exec/translator.h b/include/exec/translator.h
index b341dfbf02..2d42a4e7ed 100644
--- a/include/exec/translator.h
+++ b/include/exec/translator.h
@@ -74,6 +74,7 @@  typedef enum DisasJumpType {
  * @singlestep_enabled: "Hardware" single stepping enabled.
  * @saved_can_do_io: Known value of cpu->neg.can_do_io, or -1 for unknown.
  * @plugin_enabled: TCG plugin enabled in this TB.
+ * @fake_insn: True if translator_fake_ldb used.
  *
  * Architecture-agnostic disassembly context.
  */
@@ -87,6 +88,7 @@  typedef struct DisasContextBase {
     bool singlestep_enabled;
     int8_t saved_can_do_io;
     bool plugin_enabled;
+    bool fake_insn;
     void *host_addr[2];
 
     /*
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index 401c0ca30c..4a1c98cb63 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -141,6 +141,7 @@  void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,
     db->max_insns = *max_insns;
     db->singlestep_enabled = cflags & CF_SINGLE_STEP;
     db->saved_can_do_io = -1;
+    db->fake_insn = false;
     db->host_addr[0] = host_pc;
     db->host_addr[1] = NULL;
     db->record_start = 0;
@@ -430,6 +431,7 @@  uint64_t translator_ldq(CPUArchState *env, DisasContextBase *db, vaddr pc)
 void translator_fake_ldb(DisasContextBase *db, vaddr pc, uint8_t insn8)
 {
     assert(pc >= db->pc_first);
+    db->fake_insn = true;
     record_save(db, pc, &insn8, sizeof(insn8));
     plugin_insn_append(pc, &insn8, sizeof(insn8));
 }