Qore DebugProgramControl Module Reference  0.1.2
DebugProgramControl.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* DebugProgramControl.qm Copyright 2013 - 2018 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 
53 namespace DebugProgramControl {
56 class DebugProgramControl : public DebugProgram,public AbstractDebugControl {
57 
58 public:
59  private :
65  Qore::Thread::RWLock rwlThread();
67  Qore::Thread::RWLock rwlConnection();
69  string serverName;
71  string sourceSearchPath = "";
72 
73  const frameOffset = 2;
74 
75 public:
76 
78  constructor(string serverName) ;
79 
80 
82  destructor();
83 
84 
86  shutdown();
87 
88 
90  registerConnection(hash cx);
91 
93  connectionRegistered(hash cx);
94 
96  unregisterConnection(hash cx);
97 
98 
99 private:
100  updateConnectionContext(hash cx, auto cx_data);
101 public:
102 
103 
105  abstract sendDataImpl(hash cx, auto data);
106  abstract broadcastDataImpl(auto data);
107 
108 private:
109  broadcastBreakpoint(hash cx, Breakpoint b, string change);
110 public:
111 
112 
114  Program createProgram(string fileName, *hash opts, list args, *string script);
115 
117 
118 private:
119  *int runAndDetach(Program pgm);
120 public:
121 
122 
124  *hash processCommand(hash cx, hash receiveData);
125 
126 
127 private:
128  auto resolveValue(string name, *string val, hash strings, auto defVal);
129 public:
130 
131 
132 
133 private:
134  string encodeValue(string name, auto val, hash strings);
135 public:
136 
137 
138 
139 private:
140  int resolveStatement(ProgramControl pgm, *hash value);
141 public:
142 
143 
144 
145 private:
146  hash getBreakpointInfo(Breakpoint b);
147 public:
148 
149 
150 
151 private:
152  *hash getSourceCode(ProgramControl pgmb, string type, hash rd);
153 public:
154 
155 
156 
157 private:
158  string getSourceCodeForLabel(string name);
159 public:
160 
161 
162 private:
163  string getSourceCodeFromFile(string name);
164 public:
165 
166 
167 
168 private:
169  *hash serializeLocal(string name, hash val);
170 public:
171 
172 
173 
174 private:
175  *hash serializeLocals(*hash vals);
176 public:
177 
178 
179 
180 private:
181  list adjustStack(list stack, *hash ctx);
182 public:
183 
184 
185 
186 private:
187  *hash handleInterrupt(string func, ProgramControl pgm, reference runState, *int statementId, *string refName, *reference refValue, *int breakpointId, *hash except);
188 public:
189 
190 
191  onAttach(ProgramControl pgm, reference rs);
192 
193 
194  onDetach(ProgramControl pgm, reference rs);
195 
196 
197  onStep(ProgramControl pgm, int blockStatementId, *int statementId, *int breakpointId, reference flow, reference rs);
198 
199 
200  // backward compatability only when executed with <=0.8.13.2
201  onStep(ProgramControl pgm, int blockStatementId, *int statementId, reference flow, reference rs);
202 
203 
204  onFunctionEnter(ProgramControl pgm, int statementId, reference rs);
205 
206 
207  onFunctionExit(ProgramControl pgm, int statementId, reference result, reference rs);
208 
209 
210  onException(ProgramControl pgm, int statementId, hash ex, reference dismiss, reference rs);
211 
212 
213  onExit(ProgramControl pgm, int statementId, reference result, reference rs);
214 
215  };
216 };
hash ctxThread
data pool related to suspended thread, key is threadId
Definition: DebugProgramControl.qm.dox.h:61
list list(...)
hash ctxConnection
data pool for data related to cx.id
Definition: DebugProgramControl.qm.dox.h:63
string type(auto arg)
the DebugProgramControl namespace contains all the definitions in the DebugProgramControl module ...
Definition: DebugProgramControl.qm.dox.h:54
hash hash(object obj)
string serverName
server name
Definition: DebugProgramControl.qm.dox.h:69