about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibc.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-07-22 20:45:16 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-07-22 20:45:16 +0200
commit67c9378fb8568b6104979e158ed690e4c6d3bc04 (patch)
tree883eb19b91fb4fa22ca01724ad0408cc8c72af1b /src/wrapped/wrappedlibc.c
parent7ab299b2465cda2b9fb0ce5c4014906cc7d20e31 (diff)
downloadbox64-67c9378fb8568b6104979e158ed690e4c6d3bc04.tar.gz
box64-67c9378fb8568b6104979e158ed690e4c6d3bc04.zip
Hacked wrapped ptrace to avoid crash when wine handle exception (and debug registers in general)
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
-rw-r--r--src/wrapped/wrappedlibc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index ff20404e..59953d9c 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -39,6 +39,7 @@
 #include <malloc.h>
 #include <getopt.h>
 #include <sys/prctl.h>
+#include <sys/ptrace.h>
 #undef LOG_INFO
 #undef LOG_DEBUG
 
@@ -2981,6 +2982,15 @@ EXPORT int my_semctl(int semid, int semnum, int cmd, union semun b)
     return ret;
 }
 
+EXPORT int my_ptrace(x64emu_t* emu, int request, pid_t pid, void* addr, void* data)
+{
+    if(request == PTRACE_POKEUSER) {
+        // lets just ignore this for now!
+        return 0;
+    }
+    return ptrace(request, pid, addr, data);
+}
+
 // Backtrace stuff
 
 #include "elfs/elfdwarf_private.h"