Qore DebugProgramControl Module Reference 0.1.2
Loading...
Searching...
No Matches
DebugProgramControl.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* DebugProgramControl.qm Copyright 2013 - 2023 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// child program won't inherit parent program options (including %allow-debugger)
28
29
56class DebugProgramControl : public DebugProgram, public AbstractDebugControl {
57
58public:
59protected:
69 string serverName;
71 string sourceSearchPath = "";
72
74 const frameOffset = 2;
75
76public:
78 const DEFAULT_LINES_BEFORE = 3;
80 const DEFAULT_LINES_AFTER = 3;
81
83 constructor(string serverName) ;
84
85
88
89
92
93
96
99
102
105
107
111
113 abstract sendDataImpl(hash cx, auto data);
114 abstract broadcastDataImpl(auto data);
115protected:
116 broadcastBreakpoint(hash cx, Breakpoint b, string change);
117public:
118
119
121 Program createProgram(string fileName, *hash opts, list args, *string script);
122
124protected:
125 *int runAndDetach(Program pgm);
126public:
127
128
130 *hash processCommand(hash cx, hash receiveData);
131
132protected:
133 auto resolveValue(string name, *string val, hash strings, auto defVal);
134public:
135
136
137protected:
138 string encodeValue(string name, auto val, hash strings);
139public:
140
141
142protected:
143 int resolveStatement(ProgramControl pgm, *hash value);
144public:
145
146
147protected:
148 hash getProgramInfo(ProgramControl p, bool listFiles = False, *list threads);
149public:
150
151
152protected:
153 hash getBreakpointInfo(Breakpoint b, bool listStatements = True);
154public:
155
156
157 // stackInfo keys: file, [source], [offset], line
158protected:
159 *hash getSourceCodeFromFileOrLabel(ProgramControl pgm, hash stackInfo, int linesBefore, int linesAfter);
160public:
161
162
163protected:
164 *hash getSourceCode(ProgramControl pgmb, string type, hash rd);
165public:
166
167
168protected:
169 bool isSupportedSourceCodeForLabel();
170public:
171
172
173protected:
174 hash<auto> getSourceCodeForLabel(string name);
175public:
176
177protected:
178 hash<auto> getSourceCodeFromFile(string name);
179public:
180
181
182protected:
183 *hash serializeLocal(string name, hash val);
184public:
185
186
187protected:
188 *hash serializeLocals(*hash vals);
189public:
190
191
192protected:
193 list adjustStack(list stack, *hash ctx);
194public:
195
196
197protected:
198 *hash handleInterrupt(string func, ProgramControl pgm, reference runState, reference runToStatementId, *int statementId, *string refName, *reference refValue, *int breakpointId, *hash except);
199public:
200
201
202 onAttach(ProgramControl pgm, reference rs, reference runToStatementId);
203
204
205 onDetach(ProgramControl pgm, reference rs, reference runToStatementId);
206
207
208 onStep(ProgramControl pgm, int blockStatementId, *int statementId, *int breakpointId, reference flow, reference rs, reference runToStatementId);
209
210
211 // backward compatability only when executed with <=0.8.13.2
212 onStep(ProgramControl pgm, int blockStatementId, *int statementId, reference flow, reference rs, reference runToStatementId);
213
214
215 onFunctionEnter(ProgramControl pgm, int statementId, reference rs, reference runToStatementId);
216
217
218 onFunctionExit(ProgramControl pgm, int statementId, reference result, reference rs, reference runToStatementId);
219
220
221 onException(ProgramControl pgm, int statementId, hash ex, reference dismiss, reference rs, reference runToStatementId);
222
223
224 onExit(ProgramControl pgm, int statementId, reference result, reference rs, reference runToStatementId);
225
226 };
227};
*int runAndDetach(Program pgm)
run and remove program from debugging
hash ctxThread
data pool related to suspended thread, key is threadId
Definition: DebugProgramControl.qm.dox.h:61
destructor()
resumes any blocked threads and destroys the object
list getConnectionIds()
get list of connection ids
Program createProgram(string fileName, *hash opts, list args, *string script)
Create new program.
Qore::Thread::RWLock rwlConnection()
lock for ctxConnection access
registerConnection(hash cx)
register context for new connection
constructor(string serverName)
creates the object
hash ctxConnection
data pool for data related to cx.id
Definition: DebugProgramControl.qm.dox.h:63
connectionRegistered(hash cx)
send welcome message
unregisterAllConnections()
unregister all connections
shutdown()
resume any blocked threads
abstract broadcastDataImpl(auto data)
send data to all clients
unregisterConnection(hash cx)
unregister a connection context
Qore::Thread::RWLock rwlThread()
lock for ctxThread access
abstract sendDataImpl(hash cx, auto data)
send data to particular client
*hash processCommand(hash cx, hash receiveData)
process message in debugging thread, if message is related to debugged thread then put it in particul...
string serverName
server name
Definition: DebugProgramControl.qm.dox.h:69
the DebugProgramControl namespace contains all the definitions in the DebugProgramControl module
Definition: DebugProgramControl.qm.dox.h:54