re-introduce native breakpoints
This commit is contained in:
parent
93bdbe3e18
commit
d3fca27481
@ -85,3 +85,8 @@ void libafl_exit_request_crash(CPUState* cpu);
|
|||||||
void libafl_exit_request_timeout(void);
|
void libafl_exit_request_timeout(void);
|
||||||
|
|
||||||
struct libafl_exit_reason* libafl_get_exit_reason(void);
|
struct libafl_exit_reason* libafl_get_exit_reason(void);
|
||||||
|
|
||||||
|
#ifndef CONFIG_USER_ONLY
|
||||||
|
void libafl_qemu_set_native_breakpoint(vaddr pc);
|
||||||
|
void libafl_qemu_remove_native_breakpoint(vaddr pc);
|
||||||
|
#endif
|
||||||
|
@ -182,3 +182,20 @@ void libafl_qemu_breakpoint_run(vaddr pc_next)
|
|||||||
bp = bp->next;
|
bp = bp->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifndef CONFIG_USER_ONLY
|
||||||
|
void libafl_qemu_set_native_breakpoint(vaddr pc)
|
||||||
|
{
|
||||||
|
CPUState *cpu;
|
||||||
|
CPU_FOREACH(cpu) {
|
||||||
|
cpu_breakpoint_insert(cpu, pc, BP_GDB, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void libafl_qemu_remove_native_breakpoint(vaddr pc)
|
||||||
|
{
|
||||||
|
CPUState *cpu;
|
||||||
|
CPU_FOREACH(cpu) {
|
||||||
|
cpu_breakpoint_remove(cpu, pc, BP_GDB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -345,7 +345,10 @@ void cpu_handle_guest_debug(CPUState *cpu)
|
|||||||
cpu_single_step(cpu, 0);
|
cpu_single_step(cpu, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
gdb_set_stop_cpu(cpu);
|
/* Begin LibAFL changes */
|
||||||
|
// With LibAFL Breakpoints there is no gdb attached.
|
||||||
|
// gdb_set_stop_cpu(cpu);
|
||||||
|
/* End LibAFL changes */
|
||||||
qemu_system_debug_request();
|
qemu_system_debug_request();
|
||||||
cpu->stopped = true;
|
cpu->stopped = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user