Can anyone explain this behavior of gdb?
900 memset(&new_ckpt_info,\'\\0\',sizeof(CKPT_INFO));
(gdb)
**903 prev_offset = cp_node->of
The compiler will start doing very clever things with optimisations turned on. The debugger will show the code jumping forward and backwards alot due to the optimized way variables are stored in registers. This is probably the reason why you can't set your variable (or in some cases see its value) as it has been cleverly distributed between registers for speed, rather than having a direct memory location that the debugger can access.
Compile without optimisations?
Recompile without optimizations (-O0 on gcc).