DebugClients/Python/DebugClientBase.py

branch
debugger speed
changeset 5046
d57f18f15f1a
parent 5044
630b9f290a77
child 5048
9899fb545b1f
equal deleted inserted replaced
5045:50862a6a2c63 5046:d57f18f15f1a
220 self.inRawMode = 0 220 self.inRawMode = 0
221 self.mainProcStr = None # used for the passive mode 221 self.mainProcStr = None # used for the passive mode
222 self.passive = 0 # used to indicate the passive mode 222 self.passive = 0 # used to indicate the passive mode
223 self.running = None 223 self.running = None
224 self.test = None 224 self.test = None
225 self.tracePython = 0
226 self.debugging = 0 225 self.debugging = 0
227 226
228 self.fork_auto = False 227 self.fork_auto = False
229 self.fork_child = False 228 self.fork_child = False
230 229
231 self.readstream = None 230 self.readstream = None
232 self.writestream = None 231 self.writestream = None
233 self.errorstream = None 232 self.errorstream = None
234 self.pollingDisabled = False 233 self.pollingDisabled = False
235 234
236 self.callTraceEnabled = False 235 self.callTraceEnabled = None
237 self.__newCallTraceEnabled = False 236 self.__newCallTraceEnabled = None
238 237
239 self.skipdirs = sys.path[:] 238 self.skipdirs = sys.path[:]
240 239
241 self.variant = 'You should not see this' 240 self.variant = 'You should not see this'
242 241
300 @param args arguments to pass to target 299 @param args arguments to pass to target
301 @param kwargs keyword arguments to pass to target 300 @param kwargs keyword arguments to pass to target
302 @param mainThread non-zero, if we are attaching to the already 301 @param mainThread non-zero, if we are attaching to the already
303 started mainthread of the app 302 started mainthread of the app
304 """ 303 """
305 if self.debugging: 304 pass
306 sys.setprofile(self.profile)
307 305
308 def __dumpThreadList(self): 306 def __dumpThreadList(self):
309 """ 307 """
310 Private method to send the list of threads. 308 Private method to send the list of threads.
311 """ 309 """
471 self.pendingResponse = DebugProtocol.ResponseOK 469 self.pendingResponse = DebugProtocol.ResponseOK
472 return 470 return
473 471
474 if cmd == DebugProtocol.RequestCallTrace: 472 if cmd == DebugProtocol.RequestCallTrace:
475 if arg.strip().lower() == "on": 473 if arg.strip().lower() == "on":
476 callTraceEnabled = True 474 callTraceEnabled = self.profile
477 else: 475 else:
478 callTraceEnabled = False 476 callTraceEnabled = None
479 if self.debugging: 477 if self.debugging:
480 self.callTraceEnabled = callTraceEnabled 478 sys.setprofile(callTraceEnabled)
481 else: 479 else:
480 # remember for later
482 self.__newCallTraceEnabled = callTraceEnabled 481 self.__newCallTraceEnabled = callTraceEnabled
483 # remember for later 482
484 return 483 return
485 484
486 if cmd == DebugProtocol.RequestEnv: 485 if cmd == DebugProtocol.RequestEnv:
487 env = eval(arg) 486 env = eval(arg)
488 for key, value in env.items(): 487 for key, value in env.items():
534 # path separator. They will get inadvertantly stripped away 533 # path separator. They will get inadvertantly stripped away
535 # during the eval causing IOErrors, if self.running is passed 534 # during the eval causing IOErrors, if self.running is passed
536 # as a normal str. 535 # as a normal str.
537 self.debugMod.__dict__['__file__'] = self.running 536 self.debugMod.__dict__['__file__'] = self.running
538 sys.modules['__main__'] = self.debugMod 537 sys.modules['__main__'] = self.debugMod
539 self.callTraceEnabled = self.__newCallTraceEnabled 538 sys.setprofile(self.__newCallTraceEnabled)
540 res = self.mainThread.run( 539 res = self.mainThread.run(
541 'execfile(' + repr(self.running) + ')', 540 'execfile(' + repr(self.running) + ')',
542 self.debugMod.__dict__) 541 self.debugMod.__dict__)
543 self.progTerminated(res) 542 self.progTerminated(res)
544 return 543 return

eric ide

mercurial