@interface AppDelegate : NSObject
{
- IBOutlet DebuggerController *debugger;
- IBOutlet BreakpointController *breakpoint;
- PreferencesController *prefs;
+ IBOutlet DebuggerController* debugger;
+ IBOutlet BreakpointController* breakpoint;
+ PreferencesController* prefs;
}
-@property(readonly) DebuggerController *debugger;
-@property(readonly) BreakpointController *breakpoint;
+@property(readonly) DebuggerController* debugger;
+@property(readonly) BreakpointController* breakpoint;
- (IBAction)showDebuggerWindow:(id)sender;
- (IBAction)showInspectorWindow:(id)sender;
{
NSAutoreleasePool* pool = [NSAutoreleasePool new];
- NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:
+ NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:9000], @"Port",
@"macgdbp", @"IDEKey",
[NSNumber numberWithBool:YES], @"BreakpointsWindowVisible",
@interface BSLineNumberView : NSView
{
- BSSourceView *sourceView;
+ BSSourceView* sourceView;
NSRange lineNumberRange;
- NSSet *markers;
+ NSSet* markers;
}
-@property(readwrite, assign) BSSourceView *sourceView;
+@property(readwrite, assign) BSSourceView* sourceView;
@property(readonly) NSRange lineNumberRange;
-@property(readwrite, retain) NSSet *markers;
+@property(readwrite, retain) NSSet* markers;
@end
[NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.size.height) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.size.height)];
// font attributes for the line number
- NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Monaco" size:9.0], NSFontAttributeName, [NSColor grayColor], NSForegroundColorAttributeName, nil];
+ NSDictionary* attrs = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Monaco" size:9.0], NSFontAttributeName, [NSColor grayColor], NSForegroundColorAttributeName, nil];
lineNumberRange = NSMakeRange(0, 0);
{
lineNumberRange.location = (lineNumberRange.length == 0 ? line : lineNumberRange.location);
lineNumberRange.length++;
- NSString *num = [NSString stringWithFormat:@"%u", line];
+ NSString* num = [NSString stringWithFormat:@"%u", line];
NSSize strSize = [num sizeWithAttributes:attrs];
[num drawAtPoint:NSMakePoint([self frame].size.width - strSize.width - 3, fragRect.origin.y + ((fragRect.size.height - strSize.height) / 2)) withAttributes:attrs];
- Breakpoint *test = [[Breakpoint alloc] initWithLine:line inFile:[sourceView file]];
+ Breakpoint* test = [[Breakpoint alloc] initWithLine:line inFile:[sourceView file]];
if ([markers containsObject:test])
{
[self drawMarkerInRect:fragRect];
/**
* Handles the mouse down event (which is adding, deleting, and toggling breakpoints)
*/
-- (void)mouseDown:(NSEvent *)event
+- (void)mouseDown:(NSEvent*)event
{
- NSTextView *textView = [sourceView textView];
+ NSTextView* textView = [sourceView textView];
NSPoint clickLoc = [self convertPoint:[event locationInWindow] fromView:nil];
*/
- (void)drawMarkerInRect:(NSRect)rect
{
- NSBezierPath *path = [NSBezierPath bezierPath];
+ NSBezierPath* path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(rect.origin.x + 2, rect.origin.y + 2)]; // initial origin
[path lineToPoint:NSMakePoint(rect.size.width - 7, rect.origin.y + 2)]; // upper right
@interface BSSourceView : NSView
{
- BSLineNumberView *numberView;
- BSSourceViewTextView *textView;
- NSScrollView *scrollView;
+ BSLineNumberView* numberView;
+ BSSourceViewTextView* textView;
+ NSScrollView* scrollView;
- NSString *file;
+ NSString* file;
int markedLine;
id delegate;
}
-@property(readwrite, assign) BSLineNumberView *numberView;
-@property(readwrite, assign) BSSourceViewTextView *textView;
-@property(readwrite, assign) NSScrollView *scrollView;
-@property(readwrite, assign) NSString *file;
+@property(readwrite, assign) BSLineNumberView* numberView;
+@property(readwrite, assign) BSSourceViewTextView* textView;
+@property(readwrite, assign) NSScrollView* scrollView;
+@property(readwrite, assign) NSString* file;
@property(readwrite, assign) int markedLine;
@property(readwrite, assign) id delegate;
-- (void)setFile:(NSString *)f;
-- (void)setString:(NSString *)source asFile:(NSString *)path;
+- (void)setFile:(NSString*)f;
+- (void)setString:(NSString*)source asFile:(NSString*)path;
- (void)scrollToLine:(int)line;
@end
@interface NSObject (BSSourceViewDelegate)
-- (void)gutterClickedAtLine:(int)line forFile:(NSString *)file;
+- (void)gutterClickedAtLine:(int)line forFile:(NSString*)file;
@end
@interface BSSourceView (Private)
- (void)setupViews;
-- (void)errorHighlightingFile:(NSNotification *)notif;
+- (void)errorHighlightingFile:(NSNotification*)notif;
@end
@implementation BSSourceView
/**
* Sets the file name as well as the text of the source view
*/
-- (void)setFile:(NSString *)f
+- (void)setFile:(NSString*)f
{
if (file != f)
{
@try
{
// Attempt to use the PHP CLI to highlight the source file as HTML
- NSPipe *outPipe = [NSPipe pipe];
- NSPipe *errPipe = [NSPipe pipe];
- NSTask *task = [[NSTask new] autorelease];
+ NSPipe* outPipe = [NSPipe pipe];
+ NSPipe* errPipe = [NSPipe pipe];
+ NSTask* task = [[NSTask new] autorelease];
[task setLaunchPath:@"/usr/bin/php"]; // This is the path to the default Leopard PHP executable
[task setArguments:[NSArray arrayWithObjects:@"-s", f, nil]];
[[errPipe fileHandleForReading] readToEndOfFileInBackgroundAndNotify];
- NSData *data = [[outPipe fileHandleForReading] readDataToEndOfFile];
- NSAttributedString *source = [[NSAttributedString alloc] initWithHTML:data documentAttributes:NULL];
+ NSData* data = [[outPipe fileHandleForReading] readDataToEndOfFile];
+ NSAttributedString* source = [[NSAttributedString alloc] initWithHTML:data documentAttributes:NULL];
[[textView textStorage] setAttributedString:source];
[source release];
}
- @catch (NSException *exception)
+ @catch (NSException* exception)
{
// If the PHP executable is not available then the NSTask will throw an exception
[textView setString:[NSString stringWithContentsOfFile:f]];
/**
* Sets the contents of the SourceView via a string rather than loading from a path
*/
-- (void)setString:(NSString *)source asFile:(NSString *)path
+- (void)setString:(NSString*)source asFile:(NSString*)path
{
// create the temp file
- NSError *error = nil;
- NSString *tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"MacGDBpHighlighter"];
+ NSError* error = nil;
+ NSString* tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"MacGDBpHighlighter"];
[source writeToFile:tmpPath atomically:NO encoding:NSUTF8StringEncoding error:&error];
if (error)
{
/**
* If an error occurs in reading the highlighted PHP source, this will merely set the string
*/
-- (void)errorHighlightingFile:(NSNotification *)notif
+- (void)errorHighlightingFile:(NSNotification*)notif
{
- NSData *data = [[notif userInfo] objectForKey:NSFileHandleNotificationDataItem];
+ NSData* data = [[notif userInfo] objectForKey:NSFileHandleNotificationDataItem];
if ([data length] > 0) // there's something on stderr, so the PHP CLI failed
[textView setString:[NSString stringWithContentsOfFile:file]];
}
@interface BSSourceViewTextView : NSTextView
{
- BSSourceView *sourceView;
+ BSSourceView* sourceView;
}
-@property(readwrite, assign) BSSourceView *sourceView;
+@property(readwrite, assign) BSSourceView* sourceView;
@end
- (void)drawDividerInRect:(NSRect)rect
{
// draw the gradient
- NSColor *startColor = [NSColor colorWithDeviceRed:0.875 green:0.875 blue:0.875 alpha:1.0];
- NSColor *endColor = [NSColor colorWithDeviceRed:0.812 green:0.812 blue:0.812 alpha:1.0];
- NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:startColor endingColor:endColor];
+ NSColor* startColor = [NSColor colorWithDeviceRed:0.875 green:0.875 blue:0.875 alpha:1.0];
+ NSColor* endColor = [NSColor colorWithDeviceRed:0.812 green:0.812 blue:0.812 alpha:1.0];
+ NSGradient* gradient = [[NSGradient alloc] initWithStartingColor:startColor endingColor:endColor];
[gradient drawInRect:rect angle:([self isVertical] ? 0.0 : 90.0)];
[gradient release];
[NSBezierPath strokeRect:rect];
// draw the dimple
- NSImage *dimple = [NSImage imageNamed:@"dimple.png"];
+ NSImage* dimple = [NSImage imageNamed:@"dimple.png"];
NSSize dmpSize = [dimple size];
NSPoint origin = NSMakePoint((rect.size.width / 2) + rect.origin.x - (dmpSize.width / 2), (rect.size.height / 2) + rect.origin.y + (dmpSize.height / 2));
[dimple compositeToPoint:origin operation:NSCompositeSourceOver];
@interface Breakpoint : NSObject
{
- NSString *file;
+ NSString* file;
int line;
int debuggerId;
}
-@property(readonly) NSString *file;
+@property(readonly) NSString* file;
@property(readonly) int line;
@property(readwrite, assign) int debuggerId;
-- (id)initWithLine:(int)l inFile:(NSString *)f;
-- (id)initWithDictionary:(NSDictionary *)dict;
+- (id)initWithLine:(int)l inFile:(NSString*)f;
+- (id)initWithDictionary:(NSDictionary*)dict;
-- (NSString *)transformedPath;
+- (NSString*)transformedPath;
-- (NSDictionary *)dictionary;
+- (NSDictionary*)dictionary;
@end
/**
* Initializes a breakpoint with a file and line
*/
-- (id)initWithLine:(int)l inFile:(NSString *)f
+- (id)initWithLine:(int)l inFile:(NSString*)f
{
if (self = [super init])
{
/**
* Creates a Breakpoint from the values of an NSDictionary
*/
-- (id)initWithDictionary:(NSDictionary *)dict
+- (id)initWithDictionary:(NSDictionary*)dict
{
if (self = [super init])
{
/**
* Returns the transformed path for the breakpoint, as Xdebug needs it
*/
-- (NSString *)transformedPath
+- (NSString*)transformedPath
{
- NSString *path = self.file;
+ NSString* path = self.file;
- NSMutableArray *transforms = [[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"PathReplacements"];
+ NSMutableArray* transforms = [[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"PathReplacements"];
if (!transforms || [transforms count] < 1)
return path;
- for (NSDictionary *replacement in transforms)
+ for (NSDictionary* replacement in transforms)
{
path = [path
stringByReplacingOccurrencesOfString:[replacement valueForKey:@"local"]
/**
* Returns an NSDictionary of the data so it can be stored in NSUserDefaults
*/
-- (NSDictionary *)dictionary
+- (NSDictionary*)dictionary
{
return [NSDictionary dictionaryWithObjectsAndKeys:file, @"file", [NSNumber numberWithInt:line], @"line", nil];
}
/**
* Pretty-print
*/
-- (NSString *)description
+- (NSString*)description
{
return [NSString stringWithFormat:@"%@:%i", file, line];
}
@interface BreakpointController : NSWindowController
{
- BreakpointManager *manager;
+ BreakpointManager* manager;
- IBOutlet NSArrayController *arrayController;
- IBOutlet BSSourceView *sourceView;
+ IBOutlet NSArrayController* arrayController;
+ IBOutlet BSSourceView* sourceView;
}
-@property(readonly) BSSourceView *sourceView;
-@property(readonly) NSArrayController *arrayController;
+@property(readonly) BSSourceView* sourceView;
+@property(readonly) NSArrayController* arrayController;
- (IBAction)addBreakpoint:(id)sender;
- (IBAction)removeBreakpoint:(id)sender;
*/
- (IBAction)addBreakpoint:(id)sender
{
- NSOpenPanel *panel = [NSOpenPanel openPanel];
+ NSOpenPanel* panel = [NSOpenPanel openPanel];
if ([panel runModal] != NSOKButton)
{
*/
- (IBAction)removeBreakpoint:(id)sender
{
- NSArray *selection = [arrayController selectedObjects];
+ NSArray* selection = [arrayController selectedObjects];
if ([selection count] < 1)
{
return;
}
- for (Breakpoint *bp in selection)
+ for (Breakpoint* bp in selection)
{
[manager removeBreakpointAt:[bp line] inFile:[bp file]];
}
* NSTableView delegate method that informs the controller that the stack selection did change and that
* we should update the source viewer
*/
-- (void)tableViewSelectionDidChange:(NSNotification *)notif
+- (void)tableViewSelectionDidChange:(NSNotification*)notif
{
- NSArray *selection = [arrayController selectedObjects];
+ NSArray* selection = [arrayController selectedObjects];
if ([selection count] < 1)
{
return;
}
- Breakpoint *bp = [selection objectAtIndex:0];
+ Breakpoint* bp = [selection objectAtIndex:0];
[sourceView setFile:[bp file]];
[sourceView scrollToLine:[bp line]];
[[sourceView numberView] setMarkers:[NSSet setWithArray:[manager breakpointsForFile:[bp file]]]];
/**
* The gutter was clicked, which indicates that a breakpoint needs to be changed
*/
-- (void)gutterClickedAtLine:(int)line forFile:(NSString *)file
+- (void)gutterClickedAtLine:(int)line forFile:(NSString*)file
{
if ([manager hasBreakpointAt:line inFile:file])
{
}
else
{
- Breakpoint *bp = [[Breakpoint alloc] initWithLine:line inFile:file];
+ Breakpoint* bp = [[Breakpoint alloc] initWithLine:line inFile:file];
[manager addBreakpoint:bp];
[bp release];
}
@interface BreakpointManager : NSObject
{
- NSMutableArray *breakpoints;
- NSMutableArray *savedBreakpoints;
+ NSMutableArray* breakpoints;
+ NSMutableArray* savedBreakpoints;
- GDBpConnection *connection;
+ GDBpConnection* connection;
}
-@property(readwrite, assign) GDBpConnection *connection;
-@property(readonly) NSMutableArray *breakpoints;
+@property(readwrite, assign) GDBpConnection* connection;
+@property(readonly) NSMutableArray* breakpoints;
-+ (BreakpointManager *)sharedManager;
-- (void)addBreakpoint:(Breakpoint *)bp;
-- (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file;
-- (NSArray *)breakpointsForFile:(NSString *)file;
-- (BOOL)hasBreakpointAt:(int)line inFile:(NSString *)file;
++ (BreakpointManager*)sharedManager;
+- (void)addBreakpoint:(Breakpoint*)bp;
+- (Breakpoint*)removeBreakpointAt:(int)line inFile:(NSString*)file;
+- (NSArray*)breakpointsForFile:(NSString*)file;
+- (BOOL)hasBreakpointAt:(int)line inFile:(NSString*)file;
@end
#import "AppDelegate.h"
@interface BreakpointManager (Private)
-- (void)updateDisplaysForFile:(NSString *)file;
+- (void)updateDisplaysForFile:(NSString*)file;
@end
@implementation BreakpointManager
savedBreakpoints = [[[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"Breakpoints"] retain];
if (savedBreakpoints)
{
- for (NSDictionary *d in savedBreakpoints)
+ for (NSDictionary* d in savedBreakpoints)
{
[breakpoints addObject:[[[Breakpoint alloc] initWithDictionary:d] autorelease]];
}
/**
* Returns the shared manager (singleton)
*/
-+ (BreakpointManager *)sharedManager
++ (BreakpointManager*)sharedManager
{
- static BreakpointManager *manager;
+ static BreakpointManager* manager;
if (!manager)
{
manager = [[BreakpointManager alloc] init];
/**
* Registers a breakpoint at a given line
*/
-- (void)addBreakpoint:(Breakpoint *)bp;
+- (void)addBreakpoint:(Breakpoint*)bp;
{
if (![breakpoints containsObject:bp])
{
/**
* Removes a breakpoint at a given line/file combination, or nil if nothing was removed
*/
-- (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file
+- (Breakpoint*)removeBreakpointAt:(int)line inFile:(NSString*)file
{
- for (Breakpoint *b in breakpoints)
+ for (Breakpoint* b in breakpoints)
{
if ([b line] == line && [[b file] isEqualToString:file])
{
/**
* Returns all the breakpoints for a given file
*/
-- (NSArray *)breakpointsForFile:(NSString *)file
+- (NSArray*)breakpointsForFile:(NSString*)file
{
- NSMutableArray *matches = [NSMutableArray array];
- for (Breakpoint *b in breakpoints)
+ NSMutableArray* matches = [NSMutableArray array];
+ for (Breakpoint* b in breakpoints)
{
if ([[b file] isEqualToString:file])
{
/**
* Checks to see if a given file has a breakpoint on a given line
*/
-- (BOOL)hasBreakpointAt:(int)line inFile:(NSString *)file
+- (BOOL)hasBreakpointAt:(int)line inFile:(NSString*)file
{
return [breakpoints containsObject:[[[Breakpoint alloc] initWithLine:line inFile:file] autorelease]];
}
* This marks BSSourceView needsDisplay, rearranges the objects in the breakpoints controller,
* and sets the markers for the BSLineNumberView
*/
-- (void)updateDisplaysForFile:(NSString *)file
+- (void)updateDisplaysForFile:(NSString*)file
{
- AppDelegate *appDel = [NSApp delegate];
+ AppDelegate* appDel = [NSApp delegate];
[[[appDel breakpoint] arrayController] rearrangeObjects];
[[[appDel breakpoint] sourceView] setNeedsDisplay:YES];
[[[[appDel breakpoint] sourceView] numberView] setMarkers:[NSSet setWithArray:[self breakpointsForFile:file]]];
@interface DebuggerController : NSWindowController
{
- GDBpConnection *connection;
+ GDBpConnection* connection;
- StackController *stackController;
- IBOutlet NSArrayController *stackArrayController;
+ StackController* stackController;
+ IBOutlet NSArrayController* stackArrayController;
- IBOutlet NSTreeController *variablesTreeController;
- IBOutlet NSOutlineView *variablesOutlineView;
- NSMutableSet *expandedVariables;
- NSXMLElement *selectedVariable;
+ IBOutlet NSTreeController* variablesTreeController;
+ IBOutlet NSOutlineView* variablesOutlineView;
+ NSMutableSet* expandedVariables;
+ NSXMLElement* selectedVariable;
- IBOutlet NSWindow *inspector;
+ IBOutlet NSWindow* inspector;
- IBOutlet NSTextField *statusmsg;
- IBOutlet NSTextField *errormsg;
+ IBOutlet NSTextField* statusmsg;
+ IBOutlet NSTextField* errormsg;
- IBOutlet BSSourceView *sourceViewer;
+ IBOutlet BSSourceView* sourceViewer;
}
-@property(readonly) GDBpConnection *connection;
-@property(readonly) BSSourceView *sourceViewer;
-@property(readonly) NSWindow *inspector;
+@property(readonly) GDBpConnection* connection;
+@property(readonly) BSSourceView* sourceViewer;
+@property(readonly) NSWindow* inspector;
- (void)resetDisplays;
-- (void)setError:(NSString *)anError;
+- (void)setError:(NSString*)anError;
- (void)startDebugger;
{
stackController = [[StackController alloc] init];
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
connection = [[GDBpConnection alloc] initWithPort:[defaults integerForKey:@"Port"] session:[defaults stringForKey:@"IDEKey"]];
expandedVariables = [[NSMutableSet alloc] init];
[[self window] makeKeyAndOrderFront:nil];
/**
* Called right before the window closes so that we can tell the socket to close down
*/
-- (void)windowWillClose:(NSNotification *)notif
+- (void)windowWillClose:(NSNotification*)notif
{
[[connection socket] close];
}
/**
* Sets the status to be "Error" and then displays the error message
*/
-- (void)setError:(NSString *)anError
+- (void)setError:(NSString*)anError
{
[errormsg setStringValue:anError];
[errormsg setHidden:NO];
/**
* Handles a GDBpConnection error
*/
-- (void)handleConnectionError:(NSNotification *)notif
+- (void)handleConnectionError:(NSNotification*)notif
{
[self setError:[[notif userInfo] valueForKey:@"NSString"]];
}
*/
- (IBAction)run:(id)sender
{
- NSArray *frames = [connection run];
+ NSArray* frames = [connection run];
if ([connection isConnected] && frames != nil)
{
if ([[variablesTreeController selectedObjects] count] > 0)
selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0];
- StackFrame *frame = [connection stepIn];
+ StackFrame* frame = [connection stepIn];
if ([frame isShiftedFrame:[stackController peek]])
[stackController pop];
[stackController push:frame];
if ([[variablesTreeController selectedObjects] count] > 0)
selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0];
- StackFrame *frame = [connection stepOut];
+ StackFrame* frame = [connection stepOut];
[stackController pop]; // frame we were out of
[stackController pop]; // frame we are returning to
[stackController push:frame];
if ([[variablesTreeController selectedObjects] count] > 0)
selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0];
- StackFrame *frame = [connection stepOver];
+ StackFrame* frame = [connection stepOver];
[stackController pop];
[stackController push:frame];
[self updateStackViewer];
* NSTableView delegate method that informs the controller that the stack selection did change and that
* we should update the source viewer
*/
-- (void)tableViewSelectionDidChange:(NSNotification *)notif
+- (void)tableViewSelectionDidChange:(NSNotification*)notif
{
[self updateSourceViewer];
[self expandVariables];
/**
* Called whenver an item is expanded. This allows us to determine if we need to fetch deeper
*/
-- (void)outlineViewItemDidExpand:(NSNotification *)notif
+- (void)outlineViewItemDidExpand:(NSNotification*)notif
{
- NSTreeNode *node = [[notif userInfo] objectForKey:@"NSObject"];
+ NSTreeNode* node = [[notif userInfo] objectForKey:@"NSObject"];
[expandedVariables addObject:[[node representedObject] fullname]];
}
/**
* Called when an item was collapsed. This allows us to remove it from the list of expanded items
*/
-- (void)outlineViewItemDidCollapse:(NSNotification *)notif
+- (void)outlineViewItemDidCollapse:(NSNotification*)notif
{
[expandedVariables removeObject:[[[[notif userInfo] objectForKey:@"NSObject"] representedObject] fullname]];
}
return;
// get the filename
- NSString *filename = [selection valueForKey:@"filename"];
+ NSString* filename = [selection valueForKey:@"filename"];
filename = [[NSURL URLWithString:filename] path];
if ([filename isEqualToString:@""])
return;
// replace the source if necessary
if (![sourceViewer.file isEqualToString:filename])
{
- NSString *source = [selection valueForKey:@"source"];
+ NSString* source = [selection valueForKey:@"source"];
[sourceViewer setString:source asFile:filename];
- NSSet *breakpoints = [NSSet setWithArray:[[BreakpointManager sharedManager] breakpointsForFile:filename]];
+ NSSet* breakpoints = [NSSet setWithArray:[[BreakpointManager sharedManager] breakpointsForFile:filename]];
[[sourceViewer numberView] setMarkers:breakpoints];
}
*/
- (void)expandVariables
{
- NSString *selection = [selectedVariable fullname];
+ NSString* selection = [selectedVariable fullname];
for (int i = 0; i < [variablesOutlineView numberOfRows]; i++)
{
- NSTreeNode *node = [variablesOutlineView itemAtRow:i];
- NSString *fullname = [[node representedObject] fullname];
+ NSTreeNode* node = [variablesOutlineView itemAtRow:i];
+ NSString* fullname = [[node representedObject] fullname];
// see if it needs expanding
if ([expandedVariables containsObject:fullname])
/**
* The gutter was clicked, which indicates that a breakpoint needs to be changed
*/
-- (void)gutterClickedAtLine:(int)line forFile:(NSString *)file
+- (void)gutterClickedAtLine:(int)line forFile:(NSString*)file
{
- BreakpointManager *mngr = [BreakpointManager sharedManager];
+ BreakpointManager* mngr = [BreakpointManager sharedManager];
if ([mngr hasBreakpointAt:line inFile:file])
{
}
else
{
- Breakpoint *bp = [[Breakpoint alloc] initWithLine:line inFile:file];
+ Breakpoint* bp = [[Breakpoint alloc] initWithLine:line inFile:file];
[mngr addBreakpoint:bp];
[bp release];
}
#import "Breakpoint.h"
#import "StackFrame.h"
-extern NSString *kErrorOccurredNotif;
+extern NSString* kErrorOccurredNotif;
@interface GDBpConnection : NSObject
{
int port;
- NSString *session;
+ NSString* session;
BOOL connected;
/**
* Human-readable status of the connection
*/
- NSString *status;
+ NSString* status;
- SocketWrapper *socket;
+ SocketWrapper* socket;
}
-@property(readonly, copy) NSString *status;
-@property(readonly) SocketWrapper *socket;
+@property(readonly, copy) NSString* status;
+@property(readonly) SocketWrapper* socket;
// initializer
-- (id)initWithPort:(int)aPort session:(NSString *)aSession;
+- (id)initWithPort:(int)aPort session:(NSString*)aSession;
// getter
- (int)port;
-- (NSString *)session;
-- (NSString *)remoteHost;
+- (NSString*)session;
+- (NSString*)remoteHost;
- (BOOL)isConnected;
// communication
- (void)reconnect;
-- (NSArray *)run;
-- (StackFrame *)stepIn;
-- (StackFrame *)stepOut;
-- (StackFrame *)stepOver;
-- (void)addBreakpoint:(Breakpoint *)bp;
-- (void)removeBreakpoint:(Breakpoint *)bp;
+- (NSArray*)run;
+- (StackFrame*)stepIn;
+- (StackFrame*)stepOut;
+- (StackFrame*)stepOver;
+- (void)addBreakpoint:(Breakpoint*)bp;
+- (void)removeBreakpoint:(Breakpoint*)bp;
// helpers
-- (NSArray *)getProperty:(NSString *)property;
+- (NSArray*)getProperty:(NSString*)property;
@end
#import "GDBpConnection.h"
#import "AppDelegate.h"
-NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification";
+NSString* kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification";
@interface GDBpConnection()
-@property(readwrite, copy) NSString *status;
+@property(readwrite, copy) NSString* status;
-- (NSString *)createCommand:(NSString *)cmd, ...;
-- (NSXMLDocument *)processData:(NSString *)data;
-- (StackFrame *)createStackFrame:(int)depth;
-- (StackFrame *)createCurrentStackFrame;
+- (NSString*)createCommand:(NSString*)cmd, ...;
+- (NSXMLDocument*)processData:(NSString*)data;
+- (StackFrame*)createStackFrame:(int)depth;
+- (StackFrame*)createCurrentStackFrame;
- (void)updateStatus;
@end
* Creates a new DebuggerConnection and initializes the socket from the given connection
* paramters.
*/
-- (id)initWithPort:(int)aPort session:(NSString *)aSession;
+- (id)initWithPort:(int)aPort session:(NSString*)aSession;
{
if (self = [super init])
{
/**
* Gets the session name
*/
-- (NSString *)session
+- (NSString*)session
{
return session;
}
/**
* Returns the name of the remote host
*/
-- (NSString *)remoteHost
+- (NSString*)remoteHost
{
if (!connected)
{
[self updateStatus];
// register any breakpoints that exist offline
- for (Breakpoint *bp in [[BreakpointManager sharedManager] breakpoints])
+ for (Breakpoint* bp in [[BreakpointManager sharedManager] breakpoints])
{
[self addBreakpoint:bp];
}
/**
* Receives errors from the SocketWrapper and updates the display
*/
-- (void)errorEncountered:(NSString *)error
+- (void)errorEncountered:(NSString*)error
{
[[NSNotificationCenter defaultCenter]
postNotificationName:kErrorOccurredNotif
/**
* Tells the debugger to continue running the script. Returns an NSArray of the new stack
*/
-- (NSArray *)run
+- (NSArray*)run
{
[socket send:[self createCommand:@"run"]];
[socket receive];
// get the total stack depth
[socket send:[self createCommand:@"stack_depth"]];
- NSXMLDocument *doc = [self processData:[socket receive]];
+ NSXMLDocument* doc = [self processData:[socket receive]];
int depth = [[[[doc rootElement] attributeForName:@"depth"] stringValue] intValue];
// get all stack frames
- NSMutableArray *stack = [NSMutableArray arrayWithCapacity:depth];
+ NSMutableArray* stack = [NSMutableArray arrayWithCapacity:depth];
for (int i = 0; i < depth; i++)
{
- StackFrame *frame = [self createStackFrame:i];
+ StackFrame* frame = [self createStackFrame:i];
[stack insertObject:frame atIndex:i];
}
/**
* Tells the debugger to step into the current command.
*/
-- (StackFrame *)stepIn
+- (StackFrame*)stepIn
{
[socket send:[self createCommand:@"step_into"]];
[socket receive];
/**
* Tells the debugger to step out of the current context
*/
-- (StackFrame *)stepOut
+- (StackFrame*)stepOut
{
[socket send:[self createCommand:@"step_out"]];
[socket receive];
/**
* Tells the debugger to step over the current function
*/
-- (StackFrame *)stepOver
+- (StackFrame*)stepOver
{
[socket send:[self createCommand:@"step_over"]];
[socket receive];
* Tells the debugger engine to get a specifc property. This also takes in the NSXMLElement
* that requested it so that the child can be attached.
*/
-- (NSArray *)getProperty:(NSString *)property
+- (NSArray*)getProperty:(NSString*)property
{
[socket send:[self createCommand:[NSString stringWithFormat:@"property_get -n \"%@\"", property]]];
- NSXMLDocument *doc = [self processData:[socket receive]];
+ NSXMLDocument* doc = [self processData:[socket receive]];
/*
<response>
*/
// we now have to detach all the children so we can insert them into another document
- NSXMLElement *parent = (NSXMLElement *)[[doc rootElement] childAtIndex:0];
- NSArray *children = [parent children];
+ NSXMLElement* parent = (NSXMLElement*)[[doc rootElement] childAtIndex:0];
+ NSArray* children = [parent children];
[parent setChildren:nil];
return children;
}
/**
* Send an add breakpoint command
*/
-- (void)addBreakpoint:(Breakpoint *)bp
+- (void)addBreakpoint:(Breakpoint*)bp
{
if (!connected)
{
return;
}
- NSString *cmd = [self createCommand:[NSString stringWithFormat:@"breakpoint_set -t line -f %@ -n %i", [bp transformedPath], [bp line]]];
+ NSString* cmd = [self createCommand:[NSString stringWithFormat:@"breakpoint_set -t line -f %@ -n %i", [bp transformedPath], [bp line]]];
[socket send:cmd];
- NSXMLDocument *info = [self processData:[socket receive]];
+ NSXMLDocument* info = [self processData:[socket receive]];
[bp setDebuggerId:[[[[info rootElement] attributeForName:@"id"] stringValue] intValue]];
}
/**
* Removes a breakpoint
*/
-- (void)removeBreakpoint:(Breakpoint *)bp
+- (void)removeBreakpoint:(Breakpoint*)bp
{
if (!connected)
{
* Helper method to create a string command with the -i <session> automatically tacked on. Takes
* a variable number of arguments and parses the given command with +[NSString stringWithFormat:]
*/
-- (NSString *)createCommand:(NSString *)cmd, ...
+- (NSString*)createCommand:(NSString*)cmd, ...
{
// collect varargs
va_list argList;
va_start(argList, cmd);
- NSString *format = [[NSString alloc] initWithFormat:cmd arguments:argList]; // format the command
+ NSString* format = [[NSString alloc] initWithFormat:cmd arguments:argList]; // format the command
va_end(argList);
return [NSString stringWithFormat:@"%@ -i %@", [format autorelease], session];
/**
* Helper function to parse the NSData into an NSXMLDocument
*/
-- (NSXMLDocument *)processData:(NSString *)data
+- (NSXMLDocument*)processData:(NSString*)data
{
if (data == nil)
return nil;
- NSError *parseError = nil;
- NSXMLDocument *doc = [[NSXMLDocument alloc] initWithXMLString:data options:0 error:&parseError];
+ NSError* parseError = nil;
+ NSXMLDocument* doc = [[NSXMLDocument alloc] initWithXMLString:data options:0 error:&parseError];
if (parseError)
{
NSLog(@"Could not parse XML? --- %@", parseError);
}
// check and see if there's an error
- NSArray *error = [[doc rootElement] elementsForName:@"error"];
+ NSArray* error = [[doc rootElement] elementsForName:@"error"];
if ([error count] > 0)
{
NSLog(@"Xdebug error: %@", error);
/**
* Generates a stack frame for the given depth
*/
-- (StackFrame *)createStackFrame:(int)stackDepth
+- (StackFrame*)createStackFrame:(int)stackDepth
{
// get the stack frame
[socket send:[self createCommand:@"stack_get -d %d", stackDepth]];
- NSXMLDocument *doc = [self processData:[socket receive]];
+ NSXMLDocument* doc = [self processData:[socket receive]];
if (doc == nil)
return nil;
- NSXMLElement *xmlframe = [[[doc rootElement] children] objectAtIndex:0];
+ NSXMLElement* xmlframe = [[[doc rootElement] children] objectAtIndex:0];
// get the names of all the contexts
[socket send:[self createCommand:@"context_names -d 0"]];
- NSXMLElement *contextNames = [[self processData:[socket receive]] rootElement];
- NSMutableArray *variables = [NSMutableArray array];
- for (NSXMLElement *context in [contextNames children])
+ NSXMLElement* contextNames = [[self processData:[socket receive]] rootElement];
+ NSMutableArray* variables = [NSMutableArray array];
+ for (NSXMLElement* context in [contextNames children])
{
- NSString *name = [[context attributeForName:@"name"] stringValue];
+ NSString* name = [[context attributeForName:@"name"] stringValue];
int cid = [[[context attributeForName:@"id"] stringValue] intValue];
// fetch the contexts
[socket send:[self createCommand:[NSString stringWithFormat:@"context_get -d %d -c %d", stackDepth, cid]]];
- NSArray *addVars = [[[self processData:[socket receive]] rootElement] children];
+ NSArray* addVars = [[[self processData:[socket receive]] rootElement] children];
if (addVars != nil && name != nil)
[variables addObjectsFromArray:addVars];
}
// get the source
- NSString *filename = [[xmlframe attributeForName:@"filename"] stringValue];
+ NSString* filename = [[xmlframe attributeForName:@"filename"] stringValue];
[socket send:[self createCommand:[NSString stringWithFormat:@"source -f %@", filename]]];
- NSString *source = [[[self processData:[socket receive]] rootElement] value]; // decode base64
+ NSString* source = [[[self processData:[socket receive]] rootElement] value]; // decode base64
// create stack frame
- StackFrame *frame = [[StackFrame alloc]
+ StackFrame* frame = [[StackFrame alloc]
initWithIndex:stackDepth
withFilename:filename
withSource:source
/**
* Creates a StackFrame based on the current position in the debugger
*/
-- (StackFrame *)createCurrentStackFrame
+- (StackFrame*)createCurrentStackFrame
{
return [self createStackFrame:0];
}
- (void)updateStatus
{
[socket send:[self createCommand:@"status"]];
- NSXMLDocument *doc = [self processData:[socket receive]];
+ NSXMLDocument* doc = [self processData:[socket receive]];
self.status = [[[[doc rootElement] attributeForName:@"status"] stringValue] capitalizedString];
if (status == nil || [status isEqualToString:@"Stopped"] || [status isEqualToString:@"Stopping"])
@interface NSXMLElement (GDBpAdditions)
-- (NSString *)fullname;
-- (NSString *)variable;
+- (NSString*)fullname;
+- (NSString*)variable;
- (BOOL)isLeaf;
-- (NSString *)value;
-- (NSString *)type;
-- (NSArray *)subnodes;
+- (NSString*)value;
+- (NSString*)type;
+- (NSArray*)subnodes;
@end
/**
* Return's the property's full name
*/
-- (NSString *)fullname
+- (NSString*)fullname
{
return [[self attributeForName:@"fullname"] stringValue];
}
/**
* Return's the property's name from the attributes list
*/
-- (NSString *)variable
+- (NSString*)variable
{
return [[self attributeForName:@"name"] stringValue];
}
/**
* Override children so we can fetch more depth as needed
*/
-- (NSArray *)subnodes
+- (NSArray*)subnodes
{
- NSArray *children = [self children];
+ NSArray* children = [self children];
if (![self isLeaf] && [children count] < 1)
{
- return [[[(AppDelegate *)[NSApp delegate] debugger] connection] getProperty:[self fullname]];
+ return [[[(AppDelegate*)[NSApp delegate] debugger] connection] getProperty:[self fullname]];
}
return children;
}
/**
* Returns the value of the property
*/
-- (NSString *)value
+- (NSString*)value
{
// not a leaf, so don't display any value
if (![self isLeaf])
// base64 encoded data
if ([[[self attributeForName:@"encoding"] stringValue] isEqualToString:@"base64"])
{
- char *str = (char *)[[self stringValue] cStringUsingEncoding:NSASCIIStringEncoding];
+ char* str = (char*)[[self stringValue] cStringUsingEncoding:NSASCIIStringEncoding];
int strlen = [[self stringValue] lengthOfBytesUsingEncoding:NSASCIIStringEncoding];
- char *data;
+ char* data;
size_t datalen;
if (!base64_decode_alloc(str, strlen, &data, &datalen))
NSLog(@"error in converting %@ to base64", self);
}
- NSString *ret = [NSString stringWithCString:data length:datalen];
+ NSString* ret = [NSString stringWithCString:data length:datalen];
free(data);
return ret;
/**
* Returns the type of variable this is
*/
-- (NSString *)type
+- (NSString*)type
{
- NSXMLNode *className = [self attributeForName:@"classname"];
- NSString *type = [[self attributeForName:@"type"] stringValue];
+ NSXMLNode* className = [self attributeForName:@"classname"];
+ NSString* type = [[self attributeForName:@"type"] stringValue];
if (className != nil)
{
return [NSString stringWithFormat:@"%@ (%@)", [className stringValue], type];
@interface PreferencesController : NSWindowController
{
- IBOutlet NSToolbar *toolbar;
+ IBOutlet NSToolbar* toolbar;
- NSView *blankView;
+ NSView* blankView;
- IBOutlet NSView *generalPreferencesView;
- IBOutlet NSToolbarItem *generalPreferencesItem;
+ IBOutlet NSView* generalPreferencesView;
+ IBOutlet NSToolbarItem* generalPreferencesItem;
- IBOutlet NSView *pathsPreferencesView;
- IBOutlet NSToolbarItem *pathsPreferencesItem;
+ IBOutlet NSView* pathsPreferencesView;
+ IBOutlet NSToolbarItem* pathsPreferencesItem;
}
- (void)showPreferencesWindow;
/**
* Returns the selection names
*/
-- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
+- (NSArray*)toolbarSelectableItemIdentifiers:(NSToolbar*)toolbar
{
return [NSArray arrayWithObjects:
[generalPreferencesItem itemIdentifier],
*/
- (id)newObject
{
- NSMutableDictionary *obj = (NSMutableDictionary *)[super newObject];
+ NSMutableDictionary* obj = (NSMutableDictionary*)[super newObject];
[obj setValue:@"Remote Path" forKey:@"remote"];
[obj setValue:@"Local Path" forKey:@"local"];
return obj;
@interface SocketWrapper : NSObject
{
- GDBpConnection *connection;
+ GDBpConnection* connection;
int port;
int sock;
- NSString *hostname;
+ NSString* hostname;
id delegate;
}
-- (id)initWithConnection:(GDBpConnection *)cnx;
+- (id)initWithConnection:(GDBpConnection*)cnx;
- (id)delegate;
- (void)setDelegate:(id)aDelegate;
- (void)connect;
- (void)close;
-- (NSString *)receive;
-- (BOOL)send:(NSString *)data;
+- (NSString*)receive;
+- (BOOL)send:(NSString*)data;
-- (NSString *)remoteHost;
+- (NSString*)remoteHost;
@end
@interface NSObject (SocketWrapperDelegate)
// error
-- (void)errorEncountered:(NSString *)error;
+- (void)errorEncountered:(NSString*)error;
// connection components
- (void)socketDidAccept:(id)obj;
#include <unistd.h>
@interface SocketWrapper ()
-@property (copy, readwrite, getter=remoteHost) NSString *hostname;
+@property (copy, readwrite, getter=remoteHost) NSString* hostname;
-- (void)error:(NSString *)msg;
+- (void)error:(NSString*)msg;
@end
@implementation SocketWrapper
/**
* Initializes the socket wrapper with a host and port
*/
-- (id)initWithConnection:(GDBpConnection *)cnx
+- (id)initWithConnection:(GDBpConnection*)cnx
{
if (self = [super init])
{
}
/**
- * Sets the delegate but does *not* retain it
+ * Sets the delegate but does* not* retain it
*/
- (void)setDelegate:(id)aDelegate
{
*/
- (void)connect:(id)obj
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
// create an INET socket that we'll be listen()ing on
int socketOpen = socket(PF_INET, SOCK_STREAM, 0);
// bind the socket... and don't give up until we've tried for a while
int tries = 0;
- while (bind(socketOpen, (struct sockaddr *)&address, sizeof(address)) < 0)
+ while (bind(socketOpen, (struct sockaddr*)&address, sizeof(address)) < 0)
{
if (tries >= 5)
{
// accept a connection
struct sockaddr_in remoteAddress;
socklen_t remoteAddressLen = sizeof(remoteAddress);
- sock = accept(socketOpen, (struct sockaddr *)&remoteAddress, &remoteAddressLen);
+ sock = accept(socketOpen, (struct sockaddr*)&remoteAddress, &remoteAddressLen);
if (sock < 0)
{
close(socketOpen);
struct sockaddr_in addr;
socklen_t addrLength;
- if (getpeername(sock, (struct sockaddr *)&addr, &addrLength) < 0)
+ if (getpeername(sock, (struct sockaddr*)&addr, &addrLength) < 0)
{
[self error:@"Could not get remote hostname."];
}
- char *name = inet_ntoa(addr.sin_addr);
+ char* name = inet_ntoa(addr.sin_addr);
[self setHostname:[NSString stringWithUTF8String:name]];
[connection performSelectorOnMainThread:@selector(socketDidAccept:) withObject:nil waitUntilDone:NO];
* is used either in a threaded environment so the interface does not hang, or when you *know* the server
* will return something (which we almost always do). Returns the data that was received from the socket.
*/
-- (NSString *)receive
+- (NSString*)receive
{
// create a buffer
char buffer[1024];
int recvd = recv(sock, &buffer, sizeof(buffer), 0);
// take the received data and put it into an NSData
- NSMutableString *str = [NSMutableString string];
+ NSMutableString* str = [NSMutableString string];
if (recvd == -1)
return nil;
}
}
- NSString *tmp = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; // strip whitespace
+ NSString* tmp = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; // strip whitespace
tmp = [tmp substringToIndex:[tmp length] - 1]; // don't want the null byte
NSAssert([tmp UTF8String][[tmp length] - 1] == '>', @"-[SocketWrapper receive] buffer is incomplete");
/**
* Sends a given NSString over the socket. Returns YES on complete submission.
*/
-- (BOOL)send:(NSString *)data
+- (BOOL)send:(NSString*)data
{
data = [NSString stringWithFormat:@"%@\0", data];
int sent = send(sock, [data UTF8String], [data length], 0);
/**
* Helper method that just calls -[DebuggerWindowController setError:] on the main thread
*/
-- (void)error:(NSString *)msg
+- (void)error:(NSString*)msg
{
[delegate performSelectorOnMainThread:@selector(setError:) withObject:msg waitUntilDone:NO];
}
/**
* Array of StackFrame's (LIFO stack)
*/
- NSMutableArray *stack;
+ NSMutableArray* stack;
}
-@property(readonly) NSMutableArray *stack;
+@property(readonly) NSMutableArray* stack;
-- (StackFrame *)peek;
-- (StackFrame *)pop;
-- (void)push:(StackFrame *)frame;
+- (StackFrame*)peek;
+- (StackFrame*)pop;
+- (void)push:(StackFrame*)frame;
@end
/**
* Returns a reference to the top of the stack
*/
-- (StackFrame *)peek
+- (StackFrame*)peek
{
return [stack lastObject];
}
/**
* Pops the current frame off the stack and returns the frame
*/
-- (StackFrame *)pop
+- (StackFrame*)pop
{
- StackFrame *frame = [stack lastObject];
+ StackFrame* frame = [stack lastObject];
if (frame != nil)
[stack removeLastObject];
- for (StackFrame *f in stack)
+ for (StackFrame* f in stack)
f.index--;
return frame;
/**
* Pushes a frame onto the end of the stack
*/
-- (void)push:(StackFrame *)frame
+- (void)push:(StackFrame*)frame
{
- for (StackFrame *f in stack)
+ for (StackFrame* f in stack)
f.index++;
[stack insertObject:frame atIndex:[stack count]];
/**
* File the current frame is in
*/
- NSString *filename;
+ NSString* filename;
/**
* Cached, highlighted version of the source
*/
- NSString *source;
+ NSString* source;
/**
* Line number of the source the frame points to
/**
* Current-executing function
*/
- NSString *function;
+ NSString* function;
/**
* Variable list
*/
- NSArray *variables;
+ NSArray* variables;
}
@property(readwrite) int index;
-@property(readonly, copy) NSString *filename;
-@property(readonly, copy) NSString *source;
+@property(readonly, copy) NSString* filename;
+@property(readonly, copy) NSString* source;
@property(readwrite) int lineNumber;
-@property(readwrite, copy) NSString *function;
-@property(readonly, copy) NSArray *variables;
+@property(readwrite, copy) NSString* function;
+@property(readonly, copy) NSArray* variables;
- (id)initWithIndex:(int)anIndex
- withFilename:(NSString *)aFilename
- withSource:(NSString *)aSource
+ withFilename:(NSString*)aFilename
+ withSource:(NSString*)aSource
atLine:(int)aLineNumber
- inFunction:(NSString *)function
- withVariables:(NSArray *)variables;
+ inFunction:(NSString*)function
+ withVariables:(NSArray*)variables;
-- (BOOL)isShiftedFrame:(StackFrame *)frame;
+- (BOOL)isShiftedFrame:(StackFrame*)frame;
@end
* Private class continuation
*/
@interface StackFrame()
-@property(readwrite, copy) NSString *filename;
-@property(readwrite, copy) NSString *source;
-@property(readwrite, copy) NSArray *variables;
+@property(readwrite, copy) NSString* filename;
+@property(readwrite, copy) NSString* source;
+@property(readwrite, copy) NSArray* variables;
@end
/***/
* Constructor
*/
- (id)initWithIndex:(int)anIndex
- withFilename:(NSString *)aFilename
- withSource:(NSString *)aSource
+ withFilename:(NSString*)aFilename
+ withSource:(NSString*)aSource
atLine:(int)aLineNumber
- inFunction:(NSString *)aFunction
- withVariables:(NSArray *)aVariables
+ inFunction:(NSString*)aFunction
+ withVariables:(NSArray*)aVariables
{
if (self = [super init])
{
* Determines whether or not the given frame was shifted, rather than jumped. Essentially,
* this checks if it's in the same file/function.
*/
-- (BOOL)isShiftedFrame:(StackFrame *)frame
+- (BOOL)isShiftedFrame:(StackFrame*)frame
{
return ([filename isEqualToString:frame.filename] && [function isEqualToString:frame.function]);
}
/**
* Returns a human-readable representation
*/
-- (NSString *)description
+- (NSString*)description
{
return [NSString stringWithFormat:@"#%d %@ [%@:%d]", index, function, filename, lineNumber];
}