diff --git a/shell/apple/emulator-ios/emulator/ios_main.mm b/shell/apple/emulator-ios/emulator/ios_main.mm index a681916f0..e2e1691e2 100644 --- a/shell/apple/emulator-ios/emulator/ios_main.mm +++ b/shell/apple/emulator-ios/emulator/ios_main.mm @@ -20,6 +20,8 @@ #import #include +#include +#include int darw_printf(const char* text,...) { @@ -42,6 +44,10 @@ void os_SetWindowText(const char* t) { } void os_CreateWindow() { + if (getppid() != 1) { + /* Make LLDB ignore EXC_BAD_ACCESS for debugging */ + task_set_exception_ports(mach_task_self(), EXC_MASK_BAD_ACCESS, MACH_PORT_NULL, EXCEPTION_DEFAULT, 0); + } } void UpdateInputState() { diff --git a/shell/apple/emulator-osx/emulator-osx/SDLMain.mm b/shell/apple/emulator-osx/emulator-osx/SDLMain.mm index 258f0f978..9149f1777 100644 --- a/shell/apple/emulator-osx/emulator-osx/SDLMain.mm +++ b/shell/apple/emulator-osx/emulator-osx/SDLMain.mm @@ -449,6 +449,11 @@ int main (int argc, char **argv) gFinderLaunch = NO; } + if (getppid() != 1) { + /* Make LLDB ignore EXC_BAD_ACCESS for debugging */ + task_set_exception_ports(mach_task_self(), EXC_MASK_BAD_ACCESS, MACH_PORT_NULL, EXCEPTION_DEFAULT, 0); + } + #if SDL_USE_NIB_FILE NSApplicationMain (argc, argv); #else