Non thread local bpt globals in fullsystem

This commit is contained in:
Andrea Fioraldi 2023-10-31 16:36:33 +01:00
parent e42124c0c8
commit 9bdf5e5843
3 changed files with 11 additions and 2 deletions

View File

@ -132,10 +132,15 @@ void libafl_load_qemu_snapshot(char *name, bool sync)
#define EXCP_LIBAFL_BP 0xf4775747
#ifdef CONFIG_USER_ONLY
__thread int libafl_qemu_break_asap = 0;
__thread CPUState* libafl_breakpoint_cpu;
__thread vaddr libafl_breakpoint_pc;
#else
int libafl_qemu_break_asap = 0;
CPUState* libafl_breakpoint_cpu;
vaddr libafl_breakpoint_pc;
#endif
#ifdef TARGET_ARM
#define THUMB_MASK(value) (value | cpu_env(libafl_breakpoint_cpu)->thumb)

View File

@ -96,7 +96,11 @@ int libafl_qemu_remove_hook(size_t num, int invalidate);
struct libafl_hook* libafl_search_hook(target_ulong addr);
void libafl_flush_jit(void);
#ifdef CONFIG_USER_ONLY
extern __thread CPUState* libafl_breakpoint_cpu;
#else
extern CPUState* libafl_breakpoint_cpu;
#endif
extern int libafl_restoring_devices;

View File

@ -714,7 +714,7 @@ int vm_prepare_start(bool step_pending)
//// --- Begin LibAFL code ---
extern __thread CPUState* libafl_breakpoint_cpu;
extern CPUState* libafl_breakpoint_cpu;
//// --- End LibAFL code ---