DebugClients/Python2/DebugClientBase.py

branch
jsonrpc
changeset 5135
04905a8681dc
parent 5134
4a4212a6f40c
child 5140
01484c0afbc6
equal deleted inserted replaced
5134:4a4212a6f40c 5135:04905a8681dc
147 class DebugClientBase(object): 147 class DebugClientBase(object):
148 """ 148 """
149 Class implementing the client side of the debugger. 149 Class implementing the client side of the debugger.
150 150
151 It provides access to the Python interpeter from a debugger running in 151 It provides access to the Python interpeter from a debugger running in
152 another process whether or not the Qt event loop is running. 152 another process.
153 153
154 The protocol between the debugger and the client assumes that there will be 154 The protocol between the debugger and the client is based on JSONRPC 2.0
155 a single source of debugger commands and a single source of Python 155 PDUs. Each one is sent on a single line, i.e. commands or responses are
156 statements. Commands and statement are always exactly one line and may be 156 separated by a linefeed character.
157 interspersed.
158
159 The protocol is as follows. First the client opens a connection to the
160 debugger and then sends a series of one line commands. A command is either
161 >Load<, >Step<, >StepInto<, ... or a Python statement.
162 See DebugProtocol.py for a listing of valid protocol tokens.
163
164 A Python statement consists of the statement to execute, followed (in a
165 separate line) by >OK?<. If the statement was incomplete then the
166 response is >Continue<. If there was an exception then the response
167 is >Exception<. Otherwise the response is >OK<. The reason
168 for the >OK?< part is to provide a sentinal (ie. the responding
169 >OK<) after any possible output as a result of executing the command.
170
171 The client may send any other lines at any other time which should be
172 interpreted as program output.
173 157
174 If the debugger closes the session there is no response from the client. 158 If the debugger closes the session there is no response from the client.
175 The client may close the session at any time as a result of the script 159 The client may close the session at any time as a result of the script
176 being debugged closing or crashing. 160 being debugged closing or crashing.
177 161
215 self.globalsFilterObjects = [] 199 self.globalsFilterObjects = []
216 self.localsFilterObjects = [] 200 self.localsFilterObjects = []
217 201
218 self._fncache = {} 202 self._fncache = {}
219 self.dircache = [] 203 self.dircache = []
220 self.mainProcStr = None # used for the passive mode
221 self.passive = False # used to indicate the passive mode 204 self.passive = False # used to indicate the passive mode
222 self.running = None 205 self.running = None
223 self.test = None 206 self.test = None
224 self.tracePython = False 207 self.tracePython = False
225 self.debugging = False 208 self.debugging = False

eric ide

mercurial