14 from PyQt6.QtCore import pyqtSignal, pyqtSlot, QModelIndex |
14 from PyQt6.QtCore import pyqtSignal, pyqtSlot, QModelIndex |
15 from PyQt6.QtNetwork import ( |
15 from PyQt6.QtNetwork import ( |
16 QTcpServer, QHostAddress, QHostInfo, QNetworkInterface |
16 QTcpServer, QHostAddress, QHostInfo, QNetworkInterface |
17 ) |
17 ) |
18 |
18 |
19 from E5Gui.E5Application import e5App |
19 from E5Gui.EricApplication import ericApp |
20 from E5Gui import E5MessageBox |
20 from E5Gui import EricMessageBox |
21 |
21 |
22 from .BreakPointModel import BreakPointModel |
22 from .BreakPointModel import BreakPointModel |
23 from .WatchPointModel import WatchPointModel |
23 from .WatchPointModel import WatchPointModel |
24 from . import DebugClientCapabilities |
24 from . import DebugClientCapabilities |
25 |
25 |
351 @type function |
351 @type function |
352 @param reregister flag indicating to re-register the interface |
352 @param reregister flag indicating to re-register the interface |
353 @type bool |
353 @type bool |
354 """ |
354 """ |
355 if interfaceName in self.__debuggerInterfaces and not reregister: |
355 if interfaceName in self.__debuggerInterfaces and not reregister: |
356 E5MessageBox.warning( |
356 EricMessageBox.warning( |
357 None, |
357 None, |
358 self.tr("Register Debugger Interface"), |
358 self.tr("Register Debugger Interface"), |
359 self.tr("""<p>The debugger interface <b>{0}</b> has already""" |
359 self.tr("""<p>The debugger interface <b>{0}</b> has already""" |
360 """ been registered. Ignoring this request.</p>""")) |
360 """ been registered. Ignoring this request.</p>""")) |
361 return |
361 return |
532 self.clientProcess = None |
532 self.clientProcess = None |
533 |
533 |
534 self.__forProject = forProject |
534 self.__forProject = forProject |
535 self.__createDebuggerInterface() |
535 self.__createDebuggerInterface() |
536 if forProject: |
536 if forProject: |
537 project = e5App().getObject("Project") |
537 project = ericApp().getObject("Project") |
538 if not project.isDebugPropertiesLoaded(): |
538 if not project.isDebugPropertiesLoaded(): |
539 self.clientProcess, isNetworked, clientInterpreter = ( |
539 self.clientProcess, isNetworked, clientInterpreter = ( |
540 self.debuggerInterface.startRemote( |
540 self.debuggerInterface.startRemote( |
541 self.serverPort(), runInConsole, venvName, |
541 self.serverPort(), runInConsole, venvName, |
542 self.__originalPathString, workingDir=workingDir, |
542 self.__originalPathString, workingDir=workingDir, |
873 """ |
873 """ |
874 sock = self.nextPendingConnection() |
874 sock = self.nextPendingConnection() |
875 peerAddress = sock.peerAddress().toString() |
875 peerAddress = sock.peerAddress().toString() |
876 if peerAddress not in Preferences.getDebugger("AllowedHosts"): |
876 if peerAddress not in Preferences.getDebugger("AllowedHosts"): |
877 # the peer is not allowed to connect |
877 # the peer is not allowed to connect |
878 res = E5MessageBox.yesNo( |
878 res = EricMessageBox.yesNo( |
879 None, |
879 None, |
880 self.tr("Connection from illegal host"), |
880 self.tr("Connection from illegal host"), |
881 self.tr( |
881 self.tr( |
882 """<p>A connection was attempted by the illegal host""" |
882 """<p>A connection was attempted by the illegal host""" |
883 """ <b>{0}</b>. Accept this connection?</p>""") |
883 """ <b>{0}</b>. Accept this connection?</p>""") |
884 .format(peerAddress), |
884 .format(peerAddress), |
885 icon=E5MessageBox.Warning) |
885 icon=EricMessageBox.Warning) |
886 if not res: |
886 if not res: |
887 sock.abort() |
887 sock.abort() |
888 return |
888 return |
889 else: |
889 else: |
890 allowedHosts = Preferences.getDebugger("AllowedHosts") |
890 allowedHosts = Preferences.getDebugger("AllowedHosts") |
991 s.strip() for s in multiprocessNoDebug.split(os.pathsep) |
991 s.strip() for s in multiprocessNoDebug.split(os.pathsep) |
992 ] |
992 ] |
993 |
993 |
994 if clientType not in self.getSupportedLanguages(): |
994 if clientType not in self.getSupportedLanguages(): |
995 # a not supported client language was requested |
995 # a not supported client language was requested |
996 E5MessageBox.critical( |
996 EricMessageBox.critical( |
997 None, |
997 None, |
998 self.tr("Start Debugger"), |
998 self.tr("Start Debugger"), |
999 self.tr( |
999 self.tr( |
1000 """<p>The debugger type <b>{0}</b> is not supported""" |
1000 """<p>The debugger type <b>{0}</b> is not supported""" |
1001 """ or not configured.</p>""").format(clientType) |
1001 """ or not configured.</p>""").format(clientType) |
1059 @type dict |
1059 @type dict |
1060 """ |
1060 """ |
1061 self.__autoClearShell = autoClearShell |
1061 self.__autoClearShell = autoClearShell |
1062 |
1062 |
1063 if clientType not in self.getSupportedLanguages(): |
1063 if clientType not in self.getSupportedLanguages(): |
1064 E5MessageBox.critical( |
1064 EricMessageBox.critical( |
1065 None, |
1065 None, |
1066 self.tr("Start Debugger"), |
1066 self.tr("Start Debugger"), |
1067 self.tr( |
1067 self.tr( |
1068 """<p>The debugger type <b>{0}</b> is not supported""" |
1068 """<p>The debugger type <b>{0}</b> is not supported""" |
1069 """ or not configured.</p>""").format(clientType) |
1069 """ or not configured.</p>""").format(clientType) |
1125 """ |
1125 """ |
1126 self.__autoClearShell = autoClearShell |
1126 self.__autoClearShell = autoClearShell |
1127 |
1127 |
1128 if clientType not in self.getSupportedLanguages(): |
1128 if clientType not in self.getSupportedLanguages(): |
1129 # a not supported client language was requested |
1129 # a not supported client language was requested |
1130 E5MessageBox.critical( |
1130 EricMessageBox.critical( |
1131 None, |
1131 None, |
1132 self.tr("Start Debugger"), |
1132 self.tr("Start Debugger"), |
1133 self.tr( |
1133 self.tr( |
1134 """<p>The debugger type <b>{0}</b> is not supported""" |
1134 """<p>The debugger type <b>{0}</b> is not supported""" |
1135 """ or not configured.</p>""").format(clientType) |
1135 """ or not configured.</p>""").format(clientType) |
1190 """ |
1190 """ |
1191 self.__autoClearShell = autoClearShell |
1191 self.__autoClearShell = autoClearShell |
1192 |
1192 |
1193 if clientType not in self.getSupportedLanguages(): |
1193 if clientType not in self.getSupportedLanguages(): |
1194 # a not supported client language was requested |
1194 # a not supported client language was requested |
1195 E5MessageBox.critical( |
1195 EricMessageBox.critical( |
1196 None, |
1196 None, |
1197 self.tr("Start Debugger"), |
1197 self.tr("Start Debugger"), |
1198 self.tr( |
1198 self.tr( |
1199 """<p>The debugger type <b>{0}</b> is not supported""" |
1199 """<p>The debugger type <b>{0}</b> is not supported""" |
1200 """ or not configured.</p>""").format(clientType) |
1200 """ or not configured.</p>""").format(clientType) |
1558 @param discoveryStart directory to start auto-discovery at |
1558 @param discoveryStart directory to start auto-discovery at |
1559 @type str |
1559 @type str |
1560 """ |
1560 """ |
1561 if clientType and clientType not in self.getSupportedLanguages(): |
1561 if clientType and clientType not in self.getSupportedLanguages(): |
1562 # a not supported client language was requested |
1562 # a not supported client language was requested |
1563 E5MessageBox.critical( |
1563 EricMessageBox.critical( |
1564 None, |
1564 None, |
1565 self.tr("Start Debugger"), |
1565 self.tr("Start Debugger"), |
1566 self.tr( |
1566 self.tr( |
1567 """<p>The debugger type <b>{0}</b> is not supported""" |
1567 """<p>The debugger type <b>{0}</b> is not supported""" |
1568 """ or not configured.</p>""").format(clientType) |
1568 """ or not configured.</p>""").format(clientType) |
1622 @param debug flag indicating to run unittest with debugging |
1622 @param debug flag indicating to run unittest with debugging |
1623 @type bool |
1623 @type bool |
1624 """ |
1624 """ |
1625 if clientType and clientType not in self.getSupportedLanguages(): |
1625 if clientType and clientType not in self.getSupportedLanguages(): |
1626 # a not supported client language was requested |
1626 # a not supported client language was requested |
1627 E5MessageBox.critical( |
1627 EricMessageBox.critical( |
1628 None, |
1628 None, |
1629 self.tr("Start Debugger"), |
1629 self.tr("Start Debugger"), |
1630 self.tr( |
1630 self.tr( |
1631 """<p>The debugger type <b>{0}</b> is not supported""" |
1631 """<p>The debugger type <b>{0}</b> is not supported""" |
1632 """ or not configured.</p>""").format(clientType) |
1632 """ or not configured.</p>""").format(clientType) |