Crash hook
This commit is contained in:
parent
ead06288fd
commit
ea630b4375
@ -132,10 +132,10 @@ void libafl_load_qemu_snapshot(char *name, bool sync)
|
||||
|
||||
#define EXCP_LIBAFL_BP 0xf4775747
|
||||
|
||||
int libafl_qemu_break_asap = 0;
|
||||
__thread int libafl_qemu_break_asap = 0;
|
||||
|
||||
CPUState* libafl_breakpoint_cpu;
|
||||
vaddr libafl_breakpoint_pc;
|
||||
__thread CPUState* libafl_breakpoint_cpu;
|
||||
__thread vaddr libafl_breakpoint_pc;
|
||||
|
||||
#ifdef TARGET_ARM
|
||||
#define THUMB_MASK(value) (value | libafl_breakpoint_cpu->env_ptr->thumb)
|
||||
@ -167,7 +167,7 @@ void libafl_qemu_trigger_breakpoint(CPUState* cpu)
|
||||
cpu->exception_index = EXCP_LIBAFL_BP;
|
||||
cpu_loop_exit(cpu);
|
||||
} else {
|
||||
libafl_qemu_break_asap = 1;
|
||||
libafl_qemu_break_asap = 1;//TODO add a field to CPU
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
//// --- Begin LibAFL code ---
|
||||
|
||||
extern int libafl_qemu_break_asap;
|
||||
extern __thread int libafl_qemu_break_asap;
|
||||
|
||||
//// --- End LibAFL code ---
|
||||
|
||||
|
@ -695,8 +695,7 @@ void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr,
|
||||
|
||||
//// --- Begin LibAFL code ---
|
||||
|
||||
__attribute__((weak)) void libafl_executor_reinstall_handlers(void);
|
||||
__attribute__((weak)) void libafl_executor_reinstall_handlers(void) {}
|
||||
void (*libafl_dump_core_hook)(int target_sig);
|
||||
|
||||
//// --- End LibAFL code ---
|
||||
|
||||
@ -746,7 +745,7 @@ void dump_core_and_abort(CPUArchState *cpu_env, int target_sig)
|
||||
|
||||
//// --- Begin LibAFL code ---
|
||||
|
||||
libafl_executor_reinstall_handlers();
|
||||
if (libafl_dump_core_hook) libafl_dump_core_hook(target_sig);
|
||||
|
||||
//// --- End LibAFL code ---
|
||||
|
||||
|
@ -714,7 +714,7 @@ int vm_prepare_start(bool step_pending)
|
||||
|
||||
//// --- Begin LibAFL code ---
|
||||
|
||||
extern CPUState* libafl_breakpoint_cpu;
|
||||
extern __thread CPUState* libafl_breakpoint_cpu;
|
||||
|
||||
//// --- End LibAFL code ---
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user