Qore VscDebugAdapter Module Reference 0.2
Loading...
Searching...
No Matches
VscDebugAdapter.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* VscDebugAdapter.qm Copyright 2013 - 2024 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// minimum required Qore version
26
27
28
65namespace VscDebugAdapter {
67class VscDebugLogger : public Logger {
68
69public:
70 VscDebugAdapter debugAdapter;
71
72private:
73 bool m_logging = True;
74
75public:
76
77 constructor(*string filename, bool appendToLog);
78
79};
80
81class VscLoggerAppender : public LoggerAppenderFile {
82
83public:
84protected:
85 VscDebugLogger logger;
86
87public:
88
89 constructor(VscDebugLogger logger, string name, string filename) ;
90
91
93 processEventImpl(int type, auto params);
94
95};
96
98
102class VscDebugAdapter : public DebugCommandLine {
103
104public:
105private:
106 const START_LAUNCH = 1;
107 const START_ATTACH = 2;
108 const START_ATTACH_SUSPENDED = 3;
109 const DEBUGVAR_PREFIX = "$";
110
112 bool m_running = True;
113
116
119
121 Queue m_queue();
122
125
127 Sequence m_sequence(1);
128
130 Sequence m_source(1);
131
134
135
136public:
137
140
141 constructor(*Logger::LoggerInterface logger) ;
142
143
145 *hash doCommand(hash data);
146
148 nothing pushEvent(auto event);
149
151 printfImpl(string fmt, ...);
152
155
157 execute(string cmd);
158
159private:
160 auto resolveValue(string name, *string val, hash strings, auto defVal);
161public:
162
163
165private:
166 processDebugEvent(hash event);
167public:
168
169
171private:
172 refuseInterrupt(hash event);
173public:
174
175
177private:
178 detach(hash event);
179public:
180
181
183private:
184 hash parseVscRequest(string msg);
185public:
186
187
189private:
190 sendVscMessage(hash msg);
191public:
192
193
195private:
196 sendVscEvent(string event, auto payload);
197public:
198
199
200private:
201 string getLoadedSourceName(string file, *string source);
202public:
203
204
205private:
206 updateProgramCache(*hash response);
207public:
208
209
210private:
211 setThreadFrame(int threadId, int frameId);
212public:
213
214
215private:
216 auto getVariable(int threadId, int frameId, string name);
217public:
218
219
220private:
221 deleteBreakpoints(*hash bkpts);
222public:
223
224
225private:
226 list setBreakpoints(*list bkptRefs);
227public:
228
229
230private:
231 string printValue(auto value, *hash format);
232public:
233
234
235private:
236 auto vscParseValue(string val);
237public:
238
239
240private:
241 hash getModule(softint pgmId);
242public:
243
244
245private:
246 hash getSource(hash ls);
247public:
248
249
250 // get threads provided to vsc
251private:
252 list getThreads();
253public:
254
255
256protected:
257 hash<auto> getCommands();
258public:
259
260
261 // methods implementing commands "public" is needed bacause of hasCallableMethod()
262 hash vsc_initialize(hash args);
263
264 nothing vsc_launch(hash args);
265
266 nothing vsc_attach(hash args);
267
268 nothing vsc_configurationDone();
269
270 hash vsc_threads();
271
272 vsc_pause(hash args);
273
274 hash vsc_continue(hash args);
275
276 vsc_next(hash args);
277
278 vsc_stepIn(hash args);
279
280 vsc_stepOut(hash args);
281
282 hash vsc_stackTrace(hash args);
283
284 hash vsc_exceptionInfo(hash args);
285
286 hash vsc_scopes(hash args);
287
288 hash vsc_variables(hash args);
289
290 hash vsc_setVariable(hash args);
291
292 hash vsc_evaluate(hash args);
293
294 hash vsc_completions(hash args);
295
296 hash vsc_setBreakpoints(hash args);
297
298 hash vsc_setFunctionBreakpoints(hash args);
299
300 vsc_setExceptionBreakpoints(hash args);
301
302 hash vsc_modules(hash args);
303
304 hash vsc_loadedSources();
305
306 hash vsc_source(hash args);
307
308 vsc_disconnect(*hash args);
309
310private:
311 hash getCapabilities();
312public:
313
314
315};
316};
*string defaultProgram
use program name unless not specified in launch/attach command
Definition VscDebugAdapter.qm.dox.h:139
refuseInterrupt(hash event)
refuse interrupt and continue
run()
run processing loop till m_running is True
detach(hash event)
detach interrupt
execute(string cmd)
execute command (and exit)
Sequence m_sequence(1)
Sequence for events passed to VSC frontend.
Queue m_queue()
queue if incomming events from debug server
*hash doCommand(hash data)
send command to debug server
sendVscEvent(string event, auto payload)
send event for VSC frontend
nothing pushEvent(auto event)
push event from debug server in queue
hash parseVscRequest(string msg)
parse request from VSC frontend
hash m_initializeArgs
initialize command arguments
Definition VscDebugAdapter.qm.dox.h:115
printfImpl(string fmt,...)
implement printing to console
processDebugEvent(hash event)
process event from debugger
int m_currentPgmId
vsc program
Definition VscDebugAdapter.qm.dox.h:133
Sequence m_source(1)
Sequence for loaded source reference.
sendVscMessage(hash msg)
send message for VSC frontend
hash m_programState
program stat information
Definition VscDebugAdapter.qm.dox.h:118
Queue m_outputQueue()
queue for VSC Output window
class that can be used for logging
Definition VscDebugAdapter.qm.dox.h:67
the VscDebugAdapter namespace contains all the definitions in the VscDebugAdapter module
Definition VscDebugAdapter.qm.dox.h:65