Some scenario may block debugger.
authoretisserant
Thu, 04 Sep 2008 15:56:25 +0200
changeset 237 9a50936bc55f
parent 236 a32817e81f5e
child 238 02d0daed3e46
Some scenario may block debugger.
runtime/PLCObject.py
--- a/runtime/PLCObject.py	Thu Sep 04 14:57:52 2008 +0200
+++ b/runtime/PLCObject.py	Thu Sep 04 15:56:25 2008 +0200
@@ -294,20 +294,21 @@
         """
         tick = self._WaitDebugData()
         if tick == -1:
-            return -1,None
-        idx = ctypes.c_int()
-        typename = ctypes.c_char_p()
-        res = []
-
-        for given_idx in self._Idxs:
-            buffer=self._IterDebugData(ctypes.byref(idx), ctypes.byref(typename))
-            c_type = self.TypeTranslator.get(typename.value, None)
-            if c_type is not None and given_idx == idx.value:
-                res.append(ctypes.cast(buffer, 
-                                       ctypes.POINTER(c_type)).contents.value)
-            else:
-                print "Debug error idx : %d, expected_idx %d, type : %s"%(idx.value, given_idx,typename.value)
-                res.append(None)
+            res = None
+        else:
+            idx = ctypes.c_int()
+            typename = ctypes.c_char_p()
+            res = []
+    
+            for given_idx in self._Idxs:
+                buffer=self._IterDebugData(ctypes.byref(idx), ctypes.byref(typename))
+                c_type = self.TypeTranslator.get(typename.value, None)
+                if c_type is not None and given_idx == idx.value:
+                    res.append(ctypes.cast(buffer, 
+                                           ctypes.POINTER(c_type)).contents.value)
+                else:
+                    print "Debug error idx : %d, expected_idx %d, type : %s"%(idx.value, given_idx,typename.value)
+                    res.append(None)
         self._FreeDebugData()
         return tick, res