Debugger/DebugServer.py

changeset 6376
201067699041
parent 6374
fcd97204ff16
child 6395
613e37fabd96
child 6431
1842436770c4
diff -r caea2f6950ee -r 201067699041 Debugger/DebugServer.py
--- a/Debugger/DebugServer.py	Wed Jun 27 18:49:20 2018 +0200
+++ b/Debugger/DebugServer.py	Thu Jun 28 20:17:18 2018 +0200
@@ -477,6 +477,10 @@
                 self.clientGone.emit(unplanned and self.debugging)
         
         if clType:
+            if clType not in self.getSupportedLanguages():
+                # a not supported client language was requested
+                return
+            
             self.__setClientType(clType)
         
         # only start the client, if we are not in passive mode
@@ -741,7 +745,25 @@
         @return interpreter of the debug client (string)
         """
         return self.clientInterpreter
+    
+    def getClientType(self):
+        """
+        Public method to get the currently running debug client type.
         
+        @return debug client type
+        @rtype str
+        """
+        return self.clientType
+    
+    def isClientProcessUp(self):
+        """
+        Public method to check, if the debug client process is up.
+        
+        @return flag indicating a running debug client process
+        @rtype bool
+        """
+        return self.clientProcess is not None
+    
     def __newConnection(self):
         """
         Private slot to handle a new connection.
@@ -856,6 +878,17 @@
         self.__autoClearShell = autoClearShell
         self.__autoContinue = autoContinue
         
+        if clientType not in self.getSupportedLanguages():
+            # a not supported client language was requested
+            E5MessageBox.critical(
+                None,
+                self.tr("Start Debugger"),
+                self.tr(
+                    """<p>The debugger type <b>{0}</b> is not supported"""
+                    """ or not configured.</p>""").format(clientType)
+            )
+            return
+        
         # Restart the client
         try:
             if clientType:
@@ -911,6 +944,17 @@
         """
         self.__autoClearShell = autoClearShell
         
+        if clientType not in self.getSupportedLanguages():
+            E5MessageBox.critical(
+                None,
+                self.tr("Start Debugger"),
+                self.tr(
+                    """<p>The debugger type <b>{0}</b> is not supported"""
+                    """ or not configured.</p>""").format(clientType)
+            )
+            # a not supported client language was requested
+            return
+        
         # Restart the client
         try:
             if clientType:
@@ -961,6 +1005,17 @@
         """
         self.__autoClearShell = autoClearShell
         
+        if clientType not in self.getSupportedLanguages():
+            # a not supported client language was requested
+            E5MessageBox.critical(
+                None,
+                self.tr("Start Debugger"),
+                self.tr(
+                    """<p>The debugger type <b>{0}</b> is not supported"""
+                    """ or not configured.</p>""").format(clientType)
+            )
+            return
+        
         # Restart the client
         try:
             if clientType:
@@ -1011,6 +1066,17 @@
         """
         self.__autoClearShell = autoClearShell
         
+        if clientType not in self.getSupportedLanguages():
+            # a not supported client language was requested
+            E5MessageBox.critical(
+                None,
+                self.tr("Start Debugger"),
+                self.tr(
+                    """<p>The debugger type <b>{0}</b> is not supported"""
+                    """ or not configured.</p>""").format(clientType)
+            )
+            return
+        
         # Restart the client
         try:
             if clientType:
@@ -1250,6 +1316,17 @@
             (boolean)
         @keyparam clientType client type to be used (string)
         """
+        if clientType not in self.getSupportedLanguages():
+            # a not supported client language was requested
+            E5MessageBox.critical(
+                None,
+                self.tr("Start Debugger"),
+                self.tr(
+                    """<p>The debugger type <b>{0}</b> is not supported"""
+                    """ or not configured.</p>""").format(clientType)
+            )
+            return
+        
         # Restart the client if there is already a program loaded.
         try:
             if clientType:

eric ide

mercurial