--- a/plugger.py Wed Sep 03 17:28:17 2008 +0200
+++ b/plugger.py Thu Sep 04 14:57:52 2008 +0200
@@ -1349,7 +1349,7 @@
WeakCallableDict, data_log, status = data_tuple
data_log.append((debug_tick, value))
for weakcallable,(args,kwargs) in WeakCallableDict.iteritems():
- wx.CallAfter(weakcallable, value, *args, **kwargs)
+ wx.CallAfter(weakcallable.SetValue, value, *args, **kwargs) elif debug_vars is not None:
wx.CallAfter(self.logger.write_warning,
"debug data not coherent %d != %d"%(len(debug_vars), len(self.TracedIECPath)))
@@ -1383,7 +1383,7 @@
-# def __call__(self, value, idx, name):
+# def SetValue(self, value, idx, name): # print "debug call:", value, idx, name, self.buf
# res = self.SubscribeDebugIECVariable(IEC_Path, a, idx, IEC_Path)
--- a/targets/Linux/plc_Linux_main.c Wed Sep 03 17:28:17 2008 +0200
+++ b/targets/Linux/plc_Linux_main.c Thu Sep 04 14:57:52 2008 +0200
@@ -5,7 +5,7 @@
-long AtomicCompareExchange(long* atomicvar,long exchange, long compared)
+long AtomicCompareExchange(long* atomicvar,long compared, long exchange) return __sync_val_compare_and_swap(atomicvar, compared, exchange);
@@ -95,9 +95,9 @@
/* Eventually unlock debugger thread*/
- pthread_mutex_lock(&wait_mutex);
+ //pthread_mutex_lock(&wait_mutex); pthread_cond_broadcast(&wait_cond);
- pthread_mutex_unlock(&wait_mutex);
+ //pthread_mutex_unlock(&wait_mutex); @@ -126,7 +126,7 @@
/* signal debugger thread to continue*/
- pthread_mutex_lock(&wait_mutex);
+ //pthread_mutex_lock(&wait_mutex); pthread_cond_broadcast(&wait_cond);
- pthread_mutex_unlock(&wait_mutex);
+ //pthread_mutex_unlock(&wait_mutex); --- a/targets/plc_common_main.c Wed Sep 03 17:28:17 2008 +0200
+++ b/targets/plc_common_main.c Thu Sep 04 14:57:52 2008 +0200
@@ -33,7 +33,7 @@
static int init_level = 0;
static int Debugging = 0;
@@ -50,6 +50,8 @@
if(Debugging) __retrieve_debug();
@@ -62,7 +64,6 @@
--- a/targets/plc_debug.c Wed Sep 03 17:28:17 2008 +0200
+++ b/targets/plc_debug.c Thu Sep 04 14:57:52 2008 +0200
@@ -136,17 +136,28 @@
- subscription_cursor = subscription_table;
void* IterDebugData(int* idx, const char **type_name)
if(subscription_cursor < latest_subscription){
+ char* old_cursor = buffer_cursor; *idx = *subscription_cursor;
struct_plcvar* my_var = &variable_table[*(subscription_cursor++)];
*type_name = __get_type_enum_name(my_var->type);
- return my_var->ptrvalue;
+ USINT size = __get_type_enum_size(my_var->type); + /* compute next cursor positon*/ + buffer_cursor = buffer_cursor + size; + if(old_cursor < debug_buffer + BUFFER_SIZE)