unicorn-engine / unicorn

Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86)
http://www.unicorn-engine.org
GNU General Public License v2.0
7.33k stars 1.31k forks source link

A way to get the type of CPU exception? #1905

Open HarukaMa opened 8 months ago

HarukaMa commented 8 months ago

When a CPU exception is thrown, what we have is an error code from unicorn, however I can't find a way to directly get the exact exception (#DBG for flag TF on x86 for example). Guessing doesn't always work.

I know there are cross-arch issues, but is this even possible?

wtdcode commented 6 months ago

The error code, in most cases, is enough to reflect the exception type itself. More detailed information is strongly tight to QEMU target implementation and I'm afraid it's hard to retrieve in an arch agonistic way.