Add handler for LibAFL breakpoint (#17)

This commit is contained in:
Sparrrgh 2023-01-16 16:50:36 +01:00 committed by GitHub
parent 241ec5977a
commit f49d184a90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,12 +71,29 @@ void cpu_loop(CPUMIPSState *env)
# endif
for(;;) {
//// --- Begin LibAFL code ---
if (libafl_qemu_break_asap) return;
//// --- End LibAFL code ---
cpu_exec_start(cs);
trapnr = cpu_exec(cs);
cpu_exec_end(cs);
process_queued_cpu_work(cs);
switch(trapnr) {
//// --- Begin LibAFL code ---
#define EXCP_LIBAFL_BP 0xf4775747
case EXCP_LIBAFL_BP:
return;
//// --- End LibAFL code ---
case EXCP_SYSCALL:
env->active_tc.PC += 4;
# ifdef TARGET_ABI_MIPSO32