diff --git a/Modules/Debuggers/ProjectCenter/PCDebugger.h b/Modules/Debuggers/ProjectCenter/PCDebugger.h index 9e54fcf..bb2fafe 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebugger.h +++ b/Modules/Debuggers/ProjectCenter/PCDebugger.h @@ -34,6 +34,7 @@ id statusField; NSString *executablePath; NSString *debuggerPath; + int subProcessId; } - (void) setStatus: (NSString *) status; @@ -41,5 +42,7 @@ - (NSString *)executablePath; - (void)setExecutablePath:(NSString *)p; - (void) interrupt; +- (int) subProcessId; +- (void) setSubProcessId:(int)pid; @end diff --git a/Modules/Debuggers/ProjectCenter/PCDebugger.m b/Modules/Debuggers/ProjectCenter/PCDebugger.m index 8b371ce..5e1040e 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebugger.m +++ b/Modules/Debuggers/ProjectCenter/PCDebugger.m @@ -208,6 +208,16 @@ static NSImage *downImage = nil; ASSIGN(executablePath,p); } +- (int) subProcessId +{ + return subProcessId; +} + +- (void) setSubProcessId: (int)pid +{ + subProcessId = pid; +} + // kill process - (void) interrupt { diff --git a/Modules/Debuggers/ProjectCenter/PCDebuggerView.h b/Modules/Debuggers/ProjectCenter/PCDebuggerView.h index 45ee294..fd34e7f 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebuggerView.h +++ b/Modules/Debuggers/ProjectCenter/PCDebuggerView.h @@ -33,14 +33,13 @@ PCDebugger *debugger; id viewDelegate; NSString *currentFile; - int subProcessId; } - (void) setDebugger:(PCDebugger *)theDebugger; - (void) setDelegate:(id ) vd; - (void) setCurrentFile: (NSString *)fileName; - (NSString *) currentFile; -- (int) subProcessId; + - (void) runProgram: (NSString *)path inCurrentDirectory: (NSString *)directory diff --git a/Modules/Debuggers/ProjectCenter/PCDebuggerView.m b/Modules/Debuggers/ProjectCenter/PCDebuggerView.m index 9212b91..6cdea58 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebuggerView.m +++ b/Modules/Debuggers/ProjectCenter/PCDebuggerView.m @@ -104,20 +104,6 @@ } } - // NOTE: This works on certain versions of gdb, but we need to come up with another way of getting - // the process id in a more generic way. - range = [str rangeOfString: @"[New Thread"]; - if (range.location != NSNotFound) - { - NSScanner *scanner = [NSScanner scannerWithString: str]; - NSString *process = nil; - - [scanner scanUpToString: @"(LWP" intoString: NULL]; - [scanner scanString: @"(LWP" intoString: NULL]; - [scanner scanUpToString: @")" intoString: &process]; - subProcessId = [process intValue]; - } - // Check certain status messages from GDB and set the state correctly. range = [str rangeOfString: @"Starting program:"]; if (range.location != NSNotFound) @@ -170,10 +156,6 @@ return currentFile; } -- (int) subProcessId -{ - return subProcessId; -} - (void) terminate {