Qore DebugProgramControl Module Reference  0.1
DebugProgramControl.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* DebugProgramControl.qm Copyright 2013 - 2017 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 
42 namespace DebugProgramControl {
45 class DebugProgramControl : public DebugProgram,public AbstractDebugControl {
46 
47 public:
48  private :
54  Qore::Thread::RWLock rwlThread();
56  Qore::Thread::RWLock rwlConnection();
58  string serverName;
59 
60  const frameOffset = 2;
61 
62 public:
63 
65  constructor(string serverName) ;
66 
67 
69  destructor();
70 
71 
73  shutdown();
74 
75 
77  registerConnection(hash cx);
78 
80  connectionRegistered(hash cx);
81 
83  unregisterConnection(hash cx);
84 
85 
86 private:
87  updateConnectionContext(hash cx, auto cx_data);
88 public:
89 
90 
92  abstract sendDataImpl(hash cx, auto data);
93  abstract broadcastDataImpl(auto data);
95  Program createProgram(string fileName, *hash opts, list args, *string script);
96 
98  *hash processCommand(hash cx, hash receiveData);
99 
100 
101 private:
102  auto resolveValue(string name, *string val, hash strings, auto defVal);
103 public:
104 
105 
106 
107 private:
108  string encodeValue(string name, auto val, hash strings);
109 public:
110 
111 
112 
113 private:
114  int resolveStatement(ProgramControl pgm, *hash value);
115 public:
116 
117 
118  // make_json does not support object code etc. so we need somehow process values
119 
120 private:
121  hash serialize(auto val);
122 public:
123 
124 
125 private:
126  *hash serializeLocal(string name, hash val);
127 public:
128 
129 
130 private:
131  *hash serializeLocals(*hash vals);
132 public:
133 
134 
135 private:
136  auto unserialize(auto sv);
137 public:
138 
139 
140 private:
141  *hash handleInterrupt(string func, ProgramControl pgm, reference runState, *int statementId, *string refName, *reference refValue, *hash except);
142 public:
143 
144 
145  onAttach(ProgramControl pgm, reference rs);
146 
147 
148  onDetach(ProgramControl pgm, reference rs);
149 
150 
151  onStep(ProgramControl pgm, int blockStatementId, *int statementId, reference flow, reference rs);
152 
153 
154  onFunctionEnter(ProgramControl pgm, int statementId, reference rs);
155 
156 
157  onFunctionExit(ProgramControl pgm, int statementId, reference result, reference rs);
158 
159 
160  onException(ProgramControl pgm, int statementId, hash ex, reference dismiss, reference rs);
161 
162  };
163 };
hash ctxThread
data pool related to suspended thread, key is threadId
Definition: DebugProgramControl.qm.dox.h:50
list list(...)
hash ctxConnection
data pool for data related to cx.id
Definition: DebugProgramControl.qm.dox.h:52
the DebugProgramControl namespace contains all the definitions in the DebugProgramControl module ...
Definition: DebugProgramControl.qm.dox.h:43
hash hash(object obj)
string serverName
server name
Definition: DebugProgramControl.qm.dox.h:58