# Linux Kernel Module Cheat

#### 23.9.2. QEMU trace register values

TODO: is it possible to show the register values for each instruction?

This would include the memory values read into the registers.

Asked at: https://superuser.com/questions/1377764/how-to-trace-the-register-values-of-executed-instructions-in-qemu

Seems impossible due to optimizations that QEMU does:

- https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg07479.html

- https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg02856.html

- https://lists.gnu.org/archive/html/qemu-devel/2012-08/msg03057.html

PANDA can list memory addresses, so I bet it can also decode the instructions: https://github.com/panda-re/panda/blob/883c85fa35f35e84a323ed3d464ff40030f06bd6/panda/docs/LINE_Censorship.md I wonder why they don’t just upstream those things to QEMU’s tracing: https://github.com/panda-re/panda/issues/290

gem5 can do it as shown at: Section 23.9.8, “gem5 tracing”.