From 587f6f0f91277f25f4ebc1f4c929df96fc39e560 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 2 Nov 2017 14:49:08 +0200 Subject: [PATCH] Added wait for debugger feature to Cocoa backend Use -wait_for_debugger command line switch to display message box on startup It's available in Debug configuration only --- src/posix/cocoa/i_main.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index 4ac42261a..fd3e9a737 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -551,6 +551,16 @@ int main(int argc, char** argv) { s_restartedFromWADPicker = true; } +#if _DEBUG + else if (0 == strcmp(argument, "-wait_for_debugger")) + { + NSAlert* alert = [[NSAlert alloc] init]; + [alert setMessageText:@GAMENAME]; + [alert setInformativeText:@"Waiting for debugger..."]; + [alert addButtonWithTitle:@"Continue"]; + [alert runModal]; + } +#endif // _DEBUG else { s_argvStorage.Push(argument);