Make LLDB ignore EXC_BAD_ACCESS for debugging

This commit is contained in:
Edward Li 2021-12-03 04:06:23 +08:00 committed by flyinghead
parent 191f1c38df
commit bc1a5fdd8d
2 changed files with 11 additions and 0 deletions

View File

@ -20,6 +20,8 @@
#import <Foundation/Foundation.h>
#include <string>
#include <mach/task.h>
#include <mach/mach_init.h>
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() {

View File

@ -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