From 4336887163e676933a4bad394f3ff22e9bb771f9 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Fri, 7 Jun 2019 09:20:15 +0100 Subject: [PATCH] Pass debug settings to child --- Command.m | 14 ++++++++++++++ Control.m | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Command.m b/Command.m index cfea157..b740f86 100644 --- a/Command.m +++ b/Command.m @@ -87,6 +87,8 @@ main(int argc, char *argv[]) { NSMutableArray *args = AUTORELEASE([pArgs mutableCopy]); NSString *path = [[NSBundle mainBundle] executablePath]; + NSEnumerator *dbg; + NSString *key; NSAutoreleasePool *inner = nil; BOOL done = NO; int status = 0; @@ -95,6 +97,18 @@ main(int argc, char *argv[]) [args removeObjectAtIndex: 0]; + /* Pass debug settings to child + * qdddd + * q + */ + dbg = [[[NSProcessInfo processInfo] debugSet] objectEnumerator]; + while (nil != (key = [dbg nextObject])) + { + NSString *arg = [@"--GNU-Debug=" stringByAppendingString: key]; + + [args addObject: arg]; + } + if ([pArgs containsObject: @"--Watcher"] == NO) { /* In the top level task ... set flags to create a subtask diff --git a/Control.m b/Control.m index ae856bd..eb7274c 100644 --- a/Control.m +++ b/Control.m @@ -69,6 +69,8 @@ main(int argc, char *argv[]) { NSMutableArray *args = AUTORELEASE([pArgs mutableCopy]); NSString *path = [[NSBundle mainBundle] executablePath]; + NSEnumerator *dbg; + NSString *key; NSAutoreleasePool *inner = nil; BOOL done = NO; NSUInteger index = NSNotFound; @@ -77,6 +79,16 @@ main(int argc, char *argv[]) [args removeObjectAtIndex: 0]; + /* Pass debug settings to child + */ + dbg = [[[NSProcessInfo processInfo] debugSet] objectEnumerator]; + while (nil != (key = [dbg nextObject])) + { + NSString *arg = [@"--GNU-Debug=" stringByAppendingString: key]; + + [args addObject: arg]; + } + if ([pArgs containsObject: @"--Watcher"] == NO) { NSUserDefaults *defs;