3 * Copyright (c) 2007 - 2011, Blue Static <http://www.bluestatic.org>
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17 #import <Cocoa/Cocoa.h>
19 #import "ProtocolClient.h"
26 // The DebuggerBackEnd is the communication layer between the application
27 // and the back-end debugger. Clients issue debugger commands via this class,
28 // which are sent in an asynchronous manner. Reads are also asynchronous and
29 // the primary client of this class should set a model object, which will be
30 // updated as data arrive.
31 @interface DebuggerBackEnd
: NSObject
<ProtocolClientDelegate
>
33 // Whether the debugger should listen for and attach to connections.
34 @
property(assign
, nonatomic
) BOOL autoAttach
;
36 // The model object to update in response to changes in the debugger.
37 @
property(assign
, nonatomic
) DebuggerModel
* model
;
39 // Designated initializer. Sets up a connection on |aPort| and will
40 // initialize it if |autoAttach| is YES.
41 - (instancetype
)initWithPort
:(NSUInteger
)aPort autoAttach
:(BOOL
)doAttach
;
54 // Takes a partially loaded stack frame and fetches the rest of the information.
55 - (void)loadStackFrame
:(StackFrame
*)frame
;
57 // Ensures that a variable node's immediate children are loaded, and fetches
58 // any that are not. This is done within the scope of the given stack frame.
59 - (void)loadVariableNode
:(VariableNode
*)variable
60 forStackFrame
:(StackFrame
*)frame
;
62 // Breakpoint management.
63 - (void)addBreakpoint
:(Breakpoint
*)bp
;
64 - (void)removeBreakpoint
:(Breakpoint
*)bp
;
66 // Evaluates a given string in the current execution context.
67 - (void)evalScript
:(NSString
*)str callback
:(void (^)(NSString
*))callback
;