From 8b27b2df7ffd3044b7d37688c3212781f6c498cf Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 10 Oct 2015 17:30:07 -0400 Subject: [PATCH] Update StackFrame for ObjC 2. --- Source/StackFrame.h | 80 +++++++++++++++++++++------------------------ Source/StackFrame.m | 30 ++++++----------- 2 files changed, 48 insertions(+), 62 deletions(-) diff --git a/Source/StackFrame.h b/Source/StackFrame.h index 01964b5..f51a145 100644 --- a/Source/StackFrame.h +++ b/Source/StackFrame.h @@ -16,52 +16,48 @@ #import +@class VariableNode; + @interface StackFrame : NSObject -{ - /** - * Whether or not the stack frame has been fully loaded. - */ - BOOL loaded_; - /** - * The position in the stack - */ - NSUInteger index_; - - /** - * File the current frame is in - */ - NSString* filename_; - - /** - * Cached, highlighted version of the source - */ - NSString* source_; - - /** - * Line number of the source the frame points to - */ - NSUInteger lineNumber_; - - /** - * Current-executing function - */ - NSString* function_; - - /** - * Variable list - */ - NSArray* variables_; -} +/** + * Whether or not the stack frame has been fully loaded. + */ +@property(nonatomic) BOOL loaded; + +/** + * The position in the stack + */ +@property(readwrite, nonatomic) NSUInteger index; + +/** + * File the current frame is in + */ +@property(copy, nonatomic) NSString* filename; + +/** + * Cached, highlighted version of the source + */ +@property(copy, nonatomic) NSString* source; + +/** + * Line number of the source the frame points to + */ +@property(readwrite, nonatomic) NSUInteger lineNumber; -@property BOOL loaded; -@property (readwrite) NSUInteger index; -@property (copy) NSString* filename; -@property (copy) NSString* source; -@property (readwrite) NSUInteger lineNumber; -@property (copy) NSString* function; -@property (retain) NSArray* variables; +/** + * Current-executing function + */ +@property(copy, nonatomic) NSString* function; +/** + * Variable list + */ +@property(retain, nonatomic) NSArray* variables; + +/** + * Whether or not this is the same stack scope as |frame|. + */ - (BOOL)isShiftedFrame:(StackFrame*)frame; @end diff --git a/Source/StackFrame.m b/Source/StackFrame.m index 8c01f27..e516d90 100644 --- a/Source/StackFrame.m +++ b/Source/StackFrame.m @@ -18,16 +18,15 @@ @implementation StackFrame -@synthesize loaded = loaded_; -@synthesize index = index_; -@synthesize filename = filename_; -@synthesize source = source_; -@synthesize lineNumber = lineNumber_; -@synthesize function = function_; -@synthesize variables = variables_; +@synthesize loaded; +@synthesize index; +@synthesize filename; +@synthesize source; +@synthesize lineNumber; +@synthesize function; +@synthesize variables; -- (void)dealloc -{ +- (void)dealloc { self.filename = nil; self.source = nil; self.function = nil; @@ -35,20 +34,11 @@ [super dealloc]; } -/** - * 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 ([self.filename isEqualToString:frame.filename] && [self.function isEqualToString:frame.function]); } -/** - * Returns a human-readable representation - */ -- (NSString*)description -{ +- (NSString*)description { return [NSString stringWithFormat:@"#%d %@ [%@:%d]", self.index, self.function, self.filename, self.lineNumber]; } -- 2.22.5