From 8b56536bb1e38cfa83346544ec62e2e2003dd071 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 2 Mar 2021 15:49:33 +0100 Subject: More preparation on main x64emu_t structure --- src/include/box64context.h | 4 ++-- src/main.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/include/box64context.h b/src/include/box64context.h index 8422a765..0ffd0651 100755 --- a/src/include/box64context.h +++ b/src/include/box64context.h @@ -98,7 +98,7 @@ int AddElfHeader(box64context_t* ctx, elfheader_t* head); int AddTLSPartition(box64context_t* context, int tlssize); // defined in fact in threads.c -//void thread_set_emu(x64emu_t* emu); -//x64emu_t* thread_get_emu(); +void thread_set_emu(x64emu_t* emu); +x64emu_t* thread_get_emu(); #endif //__BOX64CONTEXT_H_ \ No newline at end of file diff --git a/src/main.c b/src/main.c index 3dc3a829..7ed01e90 100755 --- a/src/main.c +++ b/src/main.c @@ -827,6 +827,12 @@ int main(int argc, const char **argv, const char **env) { SetRAX(emu, my_context->argc); SetRBX(emu, (uintptr_t)my_context->argv); + // child fork to handle traces + pthread_atfork(NULL, NULL, my_child_fork); + + thread_set_emu(emu); + + setupTraceInit(my_context); return 0; } -- cgit 1.4.1