re-introduce native breakpoints
This commit is contained in:
parent
febb739d00
commit
deb5286724
@ -62,3 +62,8 @@ void libafl_exit_request_internal(CPUState* cpu, uint64_t pc, ShutdownCause caus
|
||||
void libafl_exit_request_sync_backdoor(CPUState* cpu, target_ulong pc);
|
||||
void libafl_exit_request_breakpoint(CPUState* cpu, target_ulong pc);
|
||||
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
|
||||
|
@ -143,3 +143,21 @@ struct libafl_exit_reason* libafl_get_exit_reason(void)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#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
|
@ -333,7 +333,10 @@ void cpu_handle_guest_debug(CPUState *cpu)
|
||||
cpu_single_step(cpu, 0);
|
||||
}
|
||||
} 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();
|
||||
cpu->stopped = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user