Why GDB jumps unpredictably between lines and prints variables as “”?

后端 未结 8 1152
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 05:10

Can anyone explain this behavior of gdb?

900         memset(&new_ckpt_info,\'\\0\',sizeof(CKPT_INFO));
(gdb)
**903         prev_offset   = cp_node->of         


        
8条回答
  •  眼角桃花
    2020-12-02 05:40

    Declare found as "volatile". This should tell the compiler to NOT optimize it out.

    volatile int found = 0;
    

提交回复
热议问题