545 if debuggerId == self.__master: |
545 if debuggerId == self.__master: |
546 self.__flush() |
546 self.__flush() |
547 self.debugServer.masterClientConnected() |
547 self.debugServer.masterClientConnected() |
548 |
548 |
549 self.debugServer.initializeClient(debuggerId) |
549 self.debugServer.initializeClient(debuggerId) |
|
550 |
|
551 # perform auto-continue except for master |
|
552 if ( |
|
553 self.__autoContinue and |
|
554 debuggerId != self.__master and |
|
555 debuggerId not in self.__autoContinued |
|
556 ): |
|
557 self.__autoContinued.append(debuggerId) |
|
558 QTimer.singleShot( |
|
559 0, lambda: self.remoteContinue(debuggerId)) |
|
560 # TODO: maybe the debugger ID should not be registered here but |
|
561 # only in user_line. Seems the debugger stops in a frame |
|
562 # outside of the debugged script and this continue moves it to |
|
563 # the first line of the script. |
550 |
564 |
551 def __socketDisconnected(self, sock): |
565 def __socketDisconnected(self, sock): |
552 """ |
566 """ |
553 Private slot handling a socket disconnecting. |
567 Private slot handling a socket disconnecting. |
554 |
568 |
558 for debuggerId in self.__connections: |
572 for debuggerId in self.__connections: |
559 if self.__connections[debuggerId] is sock: |
573 if self.__connections[debuggerId] is sock: |
560 del self.__connections[debuggerId] |
574 del self.__connections[debuggerId] |
561 if debuggerId == self.__master: |
575 if debuggerId == self.__master: |
562 self.__master = None |
576 self.__master = None |
|
577 if debuggerId in self.__autoContinued: |
|
578 self.__autoContinued.remove(debuggerId) |
563 break |
579 break |
564 else: |
580 else: |
565 if sock in self.__pendingConnections: |
581 if sock in self.__pendingConnections: |
566 self.__pendingConnections.remove(sock) |
582 self.__pendingConnections.remove(sock) |
567 |
583 |
568 if not self.__connections: |
584 if not self.__connections: |
569 # no active connections anymore |
585 # no active connections anymore |
570 self.debugServer.signalLastClientExited() |
586 self.debugServer.signalLastClientExited() |
|
587 self.__autoContinued.clear() |
571 |
588 |
572 def getDebuggerIds(self): |
589 def getDebuggerIds(self): |
573 """ |
590 """ |
574 Public method to return the IDs of the connected debugger backends. |
591 Public method to return the IDs of the connected debugger backends. |
575 |
592 |
651 if self.__master: |
668 if self.__master: |
652 self.__sendJsonCommand("RequestEnvironment", {"environment": env}, |
669 self.__sendJsonCommand("RequestEnvironment", {"environment": env}, |
653 self.__master) |
670 self.__master) |
654 |
671 |
655 def remoteLoad(self, fn, argv, wd, traceInterpreter=False, |
672 def remoteLoad(self, fn, argv, wd, traceInterpreter=False, |
656 autoContinue=True, autoFork=False, forkChild=False): |
673 autoContinue=True, autoFork=False, forkChild=False, |
|
674 enableMultiprocess=False): |
657 """ |
675 """ |
658 Public method to load a new program to debug. |
676 Public method to load a new program to debug. |
659 |
677 |
660 @param fn the filename to debug |
678 @param fn the filename to debug |
661 @type str |
679 @type str |
670 stop at the first executable line |
688 stop at the first executable line |
671 @type bool |
689 @type bool |
672 @param autoFork flag indicating the automatic fork mode |
690 @param autoFork flag indicating the automatic fork mode |
673 @type bool |
691 @type bool |
674 @param forkChild flag indicating to debug the child after forking |
692 @param forkChild flag indicating to debug the child after forking |
|
693 @type bool |
|
694 @param enableMultiprocess flag indicating to perform multiprocess |
|
695 debugging |
675 @type bool |
696 @type bool |
676 """ |
697 """ |
677 self.__autoContinue = autoContinue |
698 self.__autoContinue = autoContinue |
678 self.__scriptName = os.path.abspath(fn) |
699 self.__scriptName = os.path.abspath(fn) |
679 |
700 |
684 "filename": fn, |
705 "filename": fn, |
685 "argv": Utilities.parseOptionString(argv), |
706 "argv": Utilities.parseOptionString(argv), |
686 "traceInterpreter": traceInterpreter, |
707 "traceInterpreter": traceInterpreter, |
687 "autofork": autoFork, |
708 "autofork": autoFork, |
688 "forkChild": forkChild, |
709 "forkChild": forkChild, |
|
710 "multiprocess": enableMultiprocess, |
689 }, self.__master) |
711 }, self.__master) |
690 |
712 |
691 def remoteRun(self, fn, argv, wd, autoFork=False, forkChild=False): |
713 def remoteRun(self, fn, argv, wd, autoFork=False, forkChild=False): |
692 """ |
714 """ |
693 Public method to load a new program to run. |
715 Public method to load a new program to run. |