196 |
196 |
197 self.readstream = None |
197 self.readstream = None |
198 self.writestream = None |
198 self.writestream = None |
199 self.errorstream = None |
199 self.errorstream = None |
200 self.pollingDisabled = False |
200 self.pollingDisabled = False |
|
201 |
|
202 self.callTraceEnabled = False |
|
203 self.__newCallTraceEnabled = False |
201 |
204 |
202 self.skipdirs = sys.path[:] |
205 self.skipdirs = sys.path[:] |
203 |
206 |
204 self.variant = 'You should not see this' |
207 self.variant = 'You should not see this' |
205 |
208 |
440 if cmd == DebugProtocol.RequestOK: |
443 if cmd == DebugProtocol.RequestOK: |
441 self.write(self.pendingResponse + '\n') |
444 self.write(self.pendingResponse + '\n') |
442 self.pendingResponse = DebugProtocol.ResponseOK |
445 self.pendingResponse = DebugProtocol.ResponseOK |
443 return |
446 return |
444 |
447 |
|
448 if cmd == DebugProtocol.RequestCallTrace: |
|
449 if arg.strip().lower() == "on": |
|
450 callTraceEnabled = True |
|
451 else: |
|
452 callTraceEnabled = False |
|
453 if self.debugging: |
|
454 self.callTraceEnabled = callTraceEnabled |
|
455 else: |
|
456 self.__newCallTraceEnabled = callTraceEnabled # remember for later |
|
457 return |
|
458 |
445 if cmd == DebugProtocol.RequestEnv: |
459 if cmd == DebugProtocol.RequestEnv: |
446 env = eval(arg.replace("u'", "'")) |
460 env = eval(arg.replace("u'", "'")) |
447 for key, value in env.items(): |
461 for key, value in env.items(): |
448 if key.endswith("+"): |
462 if key.endswith("+"): |
449 if key[:-1] in os.environ: |
463 if key[:-1] in os.environ: |
492 # IOErrors, if self.running is passed as a normal str. |
506 # IOErrors, if self.running is passed as a normal str. |
493 self.debugMod.__dict__['__file__'] = self.running |
507 self.debugMod.__dict__['__file__'] = self.running |
494 sys.modules['__main__'] = self.debugMod |
508 sys.modules['__main__'] = self.debugMod |
495 code = self.__compileFileSource(self.running) |
509 code = self.__compileFileSource(self.running) |
496 if code: |
510 if code: |
|
511 self.callTraceEnabled = self.__newCallTraceEnabled |
497 res = self.mainThread.run(code, self.debugMod.__dict__) |
512 res = self.mainThread.run(code, self.debugMod.__dict__) |
498 self.progTerminated(res) |
513 self.progTerminated(res) |
499 return |
514 return |
500 |
515 |
501 if cmd == DebugProtocol.RequestRun: |
516 if cmd == DebugProtocol.RequestRun: |