mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-17 08:01:24 +00:00
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:
parent
9396623f6f
commit
1ab5955e3d
3 changed files with 23 additions and 12 deletions
|
@ -40,5 +40,6 @@
|
|||
- (NSString *) status;
|
||||
- (NSString *)executablePath;
|
||||
- (void)setExecutablePath:(NSString *)p;
|
||||
- (void) interrupt;
|
||||
|
||||
@end
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue