Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OODebugMonitor.h
Go to the documentation of this file.
1/*
2
3OODebugMonitor.h
4
5Debugging services object for Oolite.
6
7The debug controller implements Oolite's part of debugging support. It can
8connect to one debugger object, which conforms to the OODebuggerInterface
9formal protocol. This can either be (part of) a debugger loaded into Oolite
10itself (as in the Mac Debug OXP), or provide communications with an external
11debugger (for instance, over Distributed Objects or TCP/IP).
12
13
14Oolite debug support
15
16Copyright (C) 2007-2013 Jens Ayton
17
18Permission is hereby granted, free of charge, to any person obtaining a copy
19of this software and associated documentation files (the "Software"), to deal
20in the Software without restriction, including without limitation the rights
21to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22copies of the Software, and to permit persons to whom the Software is
23furnished to do so, subject to the following conditions:
24
25The above copyright notice and this permission notice shall be included in all
26copies or substantial portions of the Software.
27
28THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34SOFTWARE.
35
36*/
37
38#import "OOCocoa.h"
39#import "OOWeakReference.h"
41
42@class OOJSScript;
43
44
45@protocol OODebugMonitorInterface
46
47// Note: disconnectDebugger:message: will cause a disconnectDebugMonitor:message: message to be sent to the debugger. The debugger should not send disconnectDebugger:message: in response to disconnectDebugMonitor:message:.
48- (void)disconnectDebugger:(in id<OODebuggerInterface>)debugger
49 message:(in NSString *)message;
50
51
52// *** JavaScript console support.
53
54// Perform a JS command as though entered at the console, including echoing.
55- (oneway void)performJSConsoleCommand:(in NSString *)command;
56
57- (id)configurationValueForKey:(in NSString *)key;
58- (void)setConfigurationValue:(in id)value forKey:(in NSString *)key;
59
60- (NSString *)sourceCodeForFile:(in NSString *)filePath line:(in unsigned)line;
61
62@end
63
64
66{
67@private
68 id<OODebuggerInterface> _debugger;
70 // JavaScript console support.
72 struct JSObject *_jsSelf;
74 NSDictionary *_configFromOXPs; // Settings from debugConfig.plist
75 NSMutableDictionary *_configOverrides; // Settings from preferences, modifiable through JS.
77 // Caches
78 NSMutableDictionary *_fgColors,
81 // TCP options
85
86+ (OODebugMonitor *) sharedDebugMonitor;
87- (BOOL)setDebugger:(id<OODebuggerInterface>)debugger;
88
89 // *** JavaScript console support.
90- (void)appendJSConsoleLine:(id)string
91 colorKey:(NSString *)colorKey
92 emphasisRange:(NSRange)emphasisRange;
93
94- (void)appendJSConsoleLine:(id)string
95 colorKey:(NSString *)colorKey;
96
97- (void)clearJSConsole;
98- (void)showJSConsole;
99
100- (id)configurationValueForKey:(NSString *)key class:(Class)class defaultValue:(id)value;
101- (long long)configurationIntValueForKey:(NSString *)key defaultValue:(long long)value;
102
103- (NSArray *)configurationKeys;
104
105- (BOOL) debuggerConnected;
106
107- (void) dumpMemoryStatistics;
108- (size_t) dumpJSMemoryStatistics;
109
110- (void) setTCPIgnoresDroppedPackets:(BOOL)flag;
111- (BOOL) TCPIgnoresDroppedPackets;
112
113- (void) setUsingPlugInController:(BOOL)flag;
114- (BOOL) usingPlugInController;
115
116#if OOLITE_GNUSTEP
117- (void) applicationWillTerminate;
118#endif
119
120@end
121
NSMutableDictionary * _bgColors
NSMutableDictionary * _sourceFiles
BOOL _usingPlugInController
id< OODebuggerInterface > _debugger
NSMutableDictionary * _configOverrides
BOOL _TCPIgnoresDroppedPackets
NSDictionary * _configFromOXPs
struct JSObject * _jsSelf
OOJSScript * _script
NSMutableDictionary * _fgColors
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque