Force a re-serialization of Breakpoints on decode.
[macgdbp.git] / Source / DebuggerBackEnd.h
1 /*
2 * MacGDBp
3 * Copyright (c) 2007 - 2011, Blue Static <http://www.bluestatic.org>
4 *
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.
8 *
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.
12 *
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
15 */
16
17 #import <Cocoa/Cocoa.h>
18
19 #import "ProtocolClient.h"
20
21 @class Breakpoint;
22 @class DebuggerModel;
23 @class StackFrame;
24 @class VariableNode;
25
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>
32
33 // Whether the debugger should listen for and attach to connections.
34 @property(assign, nonatomic) BOOL autoAttach;
35
36 // The model object to update in response to changes in the debugger.
37 @property(readonly, nonatomic) DebuggerModel* model;
38
39 // Designated initializer. Sets up a connection on |aPort| and will
40 // initialize it if |autoAttach| is YES.
41 - (instancetype)initWithModel:(DebuggerModel*)model
42 port:(NSUInteger)aPort
43 autoAttach:(BOOL)doAttach;
44
45 // getter
46 - (uint16_t)port;
47
48 // communication
49 - (void)run;
50 - (void)stepIn;
51 - (void)stepOut;
52 - (void)stepOver;
53 - (void)stop;
54 - (void)detach;
55
56 // Takes a partially loaded stack frame and fetches the rest of the information.
57 - (void)loadStackFrame:(StackFrame*)frame;
58
59 // Ensures that a variable node's immediate children are loaded, and fetches
60 // any that are not. This is done within the scope of the given stack frame.
61 - (void)loadVariableNode:(VariableNode*)variable
62 forStackFrame:(StackFrame*)frame;
63
64 // Breakpoint management.
65 - (void)addBreakpoint:(Breakpoint*)bp;
66 - (void)removeBreakpoint:(Breakpoint*)bp;
67
68 // Evaluates a given string in the current execution context.
69 - (void)evalScript:(NSString*)str callback:(void (^)(NSString*))callback;
70
71 @end