Debugger code.

On «publish», when buffer is free, debugger stores arbitrary variables content into, and mark this buffer as filled Buffer content is read asynchronously, (from non real time part), and then buffer marked free again.




typedef void (*__for_each_variable_do_fp)(dbgvardsc_t *)


void __for_each_variable_do(__for_each_variable_do_fp fp)
void *UnpackVar(dbgvardsc_t *dsc, void **real_value_p, char *flags)
void Remind(unsigned int offset, unsigned int count, void *p)
void RemindIterator(dbgvardsc_t *dsc)
int CheckRetainBuffer(void)
void InitRetain(void)
void __init_debug(void)
void InitiateDebugTransfer(void)
void CleanupRetain(void)
void __cleanup_debug(void)
void __retrieve_debug(void)
void Retain(unsigned int offset, unsigned int count, void *p)
static void BufferIterator(dbgvardsc_t *dsc, int do_debug)
void DebugIterator(dbgvardsc_t *dsc)
void RetainIterator(dbgvardsc_t *dsc)
void PLC_GetTime(IEC_TIME *)
int TryEnterDebugSection(void)
long AtomicCompareExchange(long *, long, long)
long long AtomicCompareExchange64(long long *, long long, long long)
void LeaveDebugSection(void)
void ValidateRetainBuffer(void)
void InValidateRetainBuffer(void)
void __publish_debug(void)
void RegisterDebugVariable(int idx, void *force)
void ResetDebugVariablesIterator(dbgvardsc_t *dsc)
void ResetDebugVariables(void)
void FreeDebugData(void)
int WaitDebugData(unsigned long *tick)
int GetDebugData(unsigned long *tick, unsigned long *size, void **buffer)


long buffer_state = BUFFER_FREE
char debug_buffer[BUFFER_SIZE]
char *buffer_cursor = debug_buffer
unsigned int retain_offset = 0
dbgvardsc_t dbgvardsc[]

= {


unsigned long __tick
struct dbgvardsc_t

Public Members

void *ptr
__IEC_types_enum type