Remove the need for ios-include.tar.gz ##build

This commit is contained in:
pancake 2023-01-10 21:43:09 +01:00 committed by pancake
parent c3a1fe170d
commit d195f7cdbc
7 changed files with 50 additions and 21 deletions

View File

@ -26,7 +26,7 @@ bool linux_generate_corefile(RDebug *dbg, RBuffer *dest);
#if R2__UNIX__
# include <errno.h>
# if !defined (__HAIKU__) && !defined (__sun)
# if !defined (__HAIKU__) && !defined (__sun) && !APPLE_SDK_IPHONEOS
# include <sys/ptrace.h>
# endif
# include <sys/wait.h>

View File

@ -12,6 +12,7 @@
#endif
// ------------------------------------
#include <r_debug.h>
#include <r_asm.h>
#include <r_reg.h>
@ -20,10 +21,29 @@
#include <string.h>
#include <mach/mach_host.h>
#include <mach/host_priv.h>
#include <mach/mach_vm.h>
#include <mach/thread_status.h>
#include <mach/vm_statistics.h>
#if APPLE_SDK_IPHONEOS
kern_return_t mach_vm_protect
(
vm_map_t target_task,
mach_vm_address_t address,
mach_vm_size_t size,
boolean_t set_maximum,
vm_prot_t new_protection
);
kern_return_t mach_vm_read
(
vm_map_t target_task,
mach_vm_address_t address,
mach_vm_size_t size,
vm_offset_t *data,
mach_msg_type_number_t *dataCnt
);
#else
#include <mach/mach_vm.h>
#endif
static task_t task_dbg = 0;
#include "xnu_debug.h"
#include "xnu_threads.c"

View File

@ -43,7 +43,7 @@
#if __sun
#include <sys/types.h>
#else
#if DEBUGGER && HAVE_PTRACE && !R2__WINDOWS__
#if DEBUGGER && HAVE_PTRACE && !R2__WINDOWS__ && !APPLE_SDK_IPHONEOS
#include <sys/ptrace.h>
#endif
#endif

View File

@ -19,6 +19,9 @@
#if HAVE_LIB_SSL
#include <openssl/bn.h>
#endif
#if APPLE_SDK_IPHONEOS
extern int ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
#endif
#ifdef _MSC_VER
#include <windows.h>
int gettimeofday (struct timeval* p, void* tz);

View File

@ -14,7 +14,7 @@
#define MAGIC_EXIT 123
#include <signal.h>
#if R2__UNIX__
#if R2__UNIX__ && !APPLE_SDK_IPHONEOS
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>

View File

@ -8,31 +8,36 @@
#if __APPLE__ && DEBUGGER
static int __get_pid(RIODesc *desc);
#define EXCEPTION_PORT 0
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
// NOTE: mach/mach_vm is not available for iOS
#include <mach/exception_types.h>
#include <mach/mach_host.h>
#include <mach/host_priv.h>
#include <mach/processor_set.h>
#include <mach/mach_init.h>
#include <mach/mach_port.h>
#include <mach/vm_map.h>
static int __get_pid(RIODesc *desc);
#if APPLE_SDK_IPHONEOS
// missing includes
#else
#define EXCEPTION_PORT 0
// NOTE: mach/mach_vm is not available for iOS
#include <mach/mach_traps.h>
#include <mach/processor_set.h>
#include <mach/mach_error.h>
#include <mach/task.h>
#include <mach/task_info.h>
#include <mach/thread_act.h>
#include <mach/thread_info.h>
#include <mach/vm_map.h>
#include <mach-o/loader.h>
#include <mach-o/nlist.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/wait.h>
#include <errno.h>
#endif
#include <mach/task.h>
#include <mach/task_info.h>
#define MACH_ERROR_STRING(ret) \
(mach_error_string (ret) ? mach_error_string (ret) : "(unknown)")

View File

@ -22,11 +22,12 @@ fi
export BUILD=1
if [ ! -d sys/ios-include/mach/vm_behavior.h ]; then
(
cd sys && \
wget -c https://lolcathost.org/b/ios-include.tar.gz && \
tar xzvf ios-include.tar.gz
)
#(
# cd sys && \
# wget -c https://lolcathost.org/b/ios-include.tar.gz && \
# tar xzvf ios-include.tar.gz
#)
echo je
fi
. sys/ios-env.sh