Changes to allow the debugger to notify the editor when a breakpoint is encountered.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@27428 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2008-12-26 06:38:46 +00:00
parent 43e24cad84
commit 466f1709f2
4 changed files with 50 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2008-12-25 23:46-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Framework/PCProject.m
* Headers/ProjectCenter/PCProject.h: Added notification
for hitting a breakpoint.
* Modules/Debuggers/ProjectCenter/PCDebuggerView.m: Added code
to detect when a breakpoint is hit.
2008-12-25 10:30-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Modules/Debuggers/ProjectCenter/GNUmakefile: Added PTYView.[hm]

View file

@ -49,6 +49,8 @@ NSString
*PCProjectDictDidChangeNotification = @"PCProjectDictDidChangeNotification";
NSString
*PCProjectDictDidSaveNotification = @"PCProjectDictDidSaveNotification";
NSString
*PCProjectBreakpointNotification = @"PCProjectBreakpointNotification";
@implementation PCProject

View file

@ -40,6 +40,7 @@
extern NSString *PCProjectDictDidChangeNotification;
extern NSString *PCProjectDictDidSaveNotification;
extern NSString *PCProjectBreakpointNotification;
@interface PCProject : NSObject
{

View file

@ -21,6 +21,12 @@
*/
#include "PCDebuggerView.h"
#include <ProjectCenter/PCProject.h>
#include <Foundation/NSScanner.h>
#ifndef NOTIFICATION_CENTER
#define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter]
#endif
@implementation PCDebuggerView
@ -43,5 +49,38 @@
{
[super logString: str newLine: newLine];
}
range = [str rangeOfString: @"Breakpoint"];
if (range.location != NSNotFound)
{
NSScanner *scanner = [NSScanner scannerWithString: str];
NSCharacterSet *cs = [NSCharacterSet
characterSetWithCharactersInString: @""];
NSString *file;
NSString *line;
int l = 0;
[scanner setCharactersToBeSkipped: cs];
[scanner scanUpToString: @" at " intoString: NULL];
[scanner scanString: @" at " intoString: NULL];
[scanner scanUpToString: @":" intoString: &file];
[scanner scanString: @":" intoString: NULL];
[scanner setCharactersToBeSkipped:
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
[scanner scanUpToCharactersFromSet:
[NSCharacterSet whitespaceAndNewlineCharacterSet]
intoString: &line];
l = [line intValue];
if (l != 0) // if the line is parsable, then send the notification.
{
NSDictionary *dict = [NSDictionary
dictionaryWithObjectsAndKeys:
file, @"file", line, @"line", nil];
NSLog(@"dict = %@, Line = %@", dict);
[NOTIFICATION_CENTER
postNotificationName: PCProjectBreakpointNotification
object: dict];
}
}
}
@end