Skip to content

Commit

Permalink
Docs: Add description of after_insn_exec callback
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFasano committed Jul 1, 2021
1 parent 60e31e6 commit 46a1a96
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion panda/docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,8 @@ bool (*insn_translate)(CPUState *env, target_ulong pc);
---

`insn_exec`: called before execution of any instruction identified
by the `PANDA_CB_INSN_TRANSLATE` callback
by the `PANDA_CB_INSN_TRANSLATE` callback. Only enabled for blocks where
the `insn_translate` callback returns true.

**Callback ID**: `PANDA_CB_INSN_EXEC`

Expand All @@ -1420,6 +1421,34 @@ int (*insn_exec)(CPUState *env, target_ulong pc);
```
---

`after_insn_exec`: called after execution of any instruction identified
by the `PANDA_CB_INSN_TRANSLATE` callback. Only enabled for blocks where
the `after_insn_translate` callback returns true.

**Callback ID**: `PANDA_CB_AFTER_INSN_EXEC`

**Arguments**:

* `CPUState *env`: the current CPU state
* `target_ulong pc`: the guest PC we are about to execute

**Return value**:

unused

**Notes**:

This instrumentation is implemented by generating a call to a
helper function just after the instruction itself is generated.
This is fairly expensive, which is why it's only enabled via
the `PANDA_CB_AFTER_INSN_TRANSLATE` callback.

**Signature**:
```C
int (*after_insn_exec)(CPUState *env, target_ulong pc);
```
---

`virt_mem_before_read`: called before memory is read

**Callback ID**: `PANDA_CB_VIRT_MEM_BEFORE_READ`
Expand Down

0 comments on commit 46a1a96

Please sign in to comment.