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

后端 未结 8 1153
伪装坚强ぢ
伪装坚强ぢ 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:48

    You pretty much can't set the value of found. Debugging optimized programs is rarely worth the trouble, the compiler can rearrange the code in ways that it'll in no way correspond to the source code (other than producing the same result), thus confusing debuggers to no end.

提交回复
热议问题