Fix debug crash
authorEdouard TISSERANT <edouard.tisserant@gmail.com>
Sun, 06 Dec 2009 18:52:50 +0100
changeset 459 af7350d24ab5
parent 458 dfc6164e4022
child 460 73a53278833b
Fix debug crash
plugger.py
runtime/PLCObject.py
--- a/plugger.py	Sun Dec 06 17:45:36 2009 +0100
+++ b/plugger.py	Sun Dec 06 18:52:50 2009 +0100
@@ -1611,7 +1611,7 @@
 
             if Idxs:
                 Idxs.sort()
-                self.TracedIECPath = zip(Idxs)[2]
+                self.TracedIECPath = zip(*Idxs)[2]
                 self._connector.SetTraceVariablesList(zip(*zip(*Idxs)[0:2]))
             self.IECdebug_lock.release()
             
--- a/runtime/PLCObject.py	Sun Dec 06 17:45:36 2009 +0100
+++ b/runtime/PLCObject.py	Sun Dec 06 18:52:50 2009 +0100
@@ -348,7 +348,7 @@
         Must be changed according to changes in iec_types.h
         """
         _fields_ = [("len", ctypes.c_uint8),
-                    ("body", ctypes.c_char * 127)] 
+                    ("body", ctypes.c_char * 126)] 
     
     TypeTranslator = {"BOOL" :       (ctypes.c_uint8, lambda x:x.value!=0),
                       "STEP" :       (ctypes.c_uint8, lambda x:x.value),
@@ -390,12 +390,12 @@
                     if c_type is not None and offset < size:
                         res.append(unpack_func(ctypes.cast(cursor,
                                                            ctypes.POINTER(c_type)).contents))
-                        offset += ctypes.sizeof(c_type) 
+                        offset += ctypes.sizeof(c_type)
                     else:
                         PLCprint("Debug error !")
                         break
             self._FreeDebugData()
             self.PLClibraryLock.release()
-            return self.PLCStatus, tick, res
+            return self.PLCStatus, tick.value, res
         return self.PLCStatus, None, None