* Modules/Debuggers/ProjectCenter/PCDebugger.m: Added code

to do the restart and pause actions in the debugger.
	* Modules/Debuggers/ProjectCenter/PCDebuggerView.[hm]: Added
	method subProcessId and an ivar and the logic to parse the
	process id from debugger output.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@27444 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2008-12-28 16:19:27 +00:00
parent eefe748587
commit fc1d806411
4 changed files with 37 additions and 11 deletions

View file

@ -1,3 +1,11 @@
2008-12-28 11:25-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Modules/Debuggers/ProjectCenter/PCDebugger.m: Added code
to do the restart and pause actions in the debugger.
* Modules/Debuggers/ProjectCenter/PCDebuggerView.[hm]: Added
method subProcessId and an ivar and the logic to parse the
process id from debugger output.
2008-12-28 02:23-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Framework/PCEditorManager.m: Remove log.

View file

@ -168,12 +168,16 @@ static NSImage *stepOutImage = nil;
- (void) pause: (id) sender
{
[self setStatus: @"Stopped."];
[debuggerView interrupt];
}
- (void) restart: (id) sender
{
[self setStatus: @"Running..."];
[self setStatus: @"Restarting..."];
[debuggerView interrupt];
[debuggerView putString: @"run\n"];
[self setStatus: @"Running..."];
}
- (void) next: (id) sender

View file

@ -25,20 +25,15 @@
@class PCDebugger;
@class NSString;
typedef enum _PCDebuggerState {
PCDebuggerPrePrompt,
PCDebuggerPrompt,
PCDebuggerPostPrompt
} PCDebuggerState;
@interface PCDebuggerView : PTYView
{
PCDebugger *debugger;
NSString *currentFile;
PCDebuggerState debuggerState;
int subProcessId;
}
- (void) setDebugger:(PCDebugger *)theDebugger;
- (void) setCurrentFile: (NSString *)fileName;
- (NSString *) currentFile;
- (int) subProcessId;
@end

View file

@ -92,6 +92,20 @@
}
}
// 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];
}
// FIXME: Filter this error, until we find a better way to deal with it.
range = [str rangeOfString: @"[tcsetpgrp failed in terminal_inferior:"];
if (range.location != NSNotFound)
@ -120,7 +134,7 @@
* lookup the process id.
*/
/*
- (int) lookupProcessId
- (int) subProcessId
{
int task_pid = [task processIdentifier];
int child_pid = 0;
@ -146,13 +160,18 @@
return child_pid;
}
*/
- (int) subProcessId
{
return subProcessId;
}
- (void) interrupt
{
int pid = [self lookupProcessId];
int pid = [self subProcessId];
kill(pid,SIGINT);
}
*/
- (void) terminate
{