move interrupt method to the debugger class and add windows implementation through tskill

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@39714 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2016-05-03 16:37:37 +00:00
parent 9396623f6f
commit 1ab5955e3d
3 changed files with 23 additions and 12 deletions

View file

@ -40,5 +40,6 @@
- (NSString *) status;
- (NSString *)executablePath;
- (void)setExecutablePath:(NSString *)p;
- (void) interrupt;
@end

View file

@ -208,6 +208,28 @@ static NSImage *downImage = nil;
ASSIGN(executablePath,p);
}
// kill process
- (void) interrupt
{
int pid = [debuggerView subProcessId];
if(pid != 0)
{
#ifndef __MINGW32__
kill(pid,SIGINT);
#else
// on windows we run tskill as a shell command
NSTask *t;
NSArray *args;
args = [NSArray arrayWithObjects:[NSString stringWithFormat:@"%d", pid], nil];
t = [NSTask new];
[t setLaunchPath:@"tskill.exe"];
[t launch];
[t release];
#endif
}
}
// action methods for toolbar...
- (void) go: (id) sender
{

View file

@ -175,18 +175,6 @@
return subProcessId;
}
- (void) interrupt
{
int pid = [self subProcessId];
if(pid != 0)
{
#ifndef __MINGW32__
kill(pid,SIGINT);
#endif
}
[viewDelegate putString:@"-exec-interrupt"];
}
- (void) terminate
{
[viewDelegate terminate];