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 "Breakpoint.h"
20 #import "ProtocolClient.h"
21 #import "StackFrame.h"
23 @protocol DebuggerBackEndDelegate
;
27 // The DebuggerBackEnd is the communication layer between the application
28 // and the back-end debugger. Clients issue debugger commands via this class,
29 // which are sent in an asynchronous manner. Reads are also asynchronous and
30 // the primary client of this class should set itself as the delegate. The
31 // primary unit that this class deals with is the StackFrame; clients should
32 // maintain a stack structure and the BackEnd will inform the delegate when
33 // a new frame is created or the stack should be destroyed.
34 @interface DebuggerBackEnd
: NSObject
<ProtocolClientDelegate
>
36 // Whether the debugger should detach immediately after being contacted by the
37 // backend. YES means all debugger connections will be dropped.
38 @
property(assign
, nonatomic
) BOOL autoAttach
;
40 // The model object to update in response to changes in the debugger.
41 @
property(assign
, nonatomic
) DebuggerModel
* model
;
44 - (id
)initWithPort
:(NSUInteger
)aPort
;
57 // Breakpoint management.
58 - (void)addBreakpoint
:(Breakpoint
*)bp
;
59 - (void)removeBreakpoint
:(Breakpoint
*)bp
;
61 // Evaluates a given string in the current execution context.
62 - (void)evalScript
:(NSString
*)str callback
:(void (^)(NSString
*))callback
;
64 // Takes a partially loaded stack frame and fetches the rest of the information.
65 - (void)loadStackFrame
:(StackFrame
*)frame
;
67 // Ensures that a variable node's immediate children are loaded, and fetches
68 // any that are not. This is done within the scope of the given stack frame.
69 - (void)loadVariableNode
:(VariableNode
*)variable
70 forStackFrame
:(StackFrame
*)frame
;