Merge pull request #77 from saibotk/add-riscv-support

feat(riscv): add libafl support
This commit is contained in:
Romain Malmain 2024-07-16 16:44:00 +02:00 committed by GitHub
commit 307991919b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,13 +32,34 @@ void cpu_loop(CPURISCVState *env)
int trapnr;
target_ulong ret;
//// --- Begin LibAFL code ---
libafl_exit_signal_vm_start();
//// --- End LibAFL code ---
for (;;) {
//// --- Begin LibAFL code ---
if (libafl_exit_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 ---
case EXCP_LIBAFL_EXIT:
return;
//// --- End LibAFL code ---
case EXCP_INTERRUPT:
/* just indicate that signals should be handled asap */
break;