在Code::Blocks上使用GDB

  1. Project's Build Option -> Compiler選項
    Produce debugging symbols(-g) (打勾)
    Strip all symbols from binary(-s) (不要勾)
  2. 插入Break point
  3. 左邊 "Watches" Tag -> right click "Add watches" -> 輸入 variable name
  4. re-build
  5. press "F8" into debug mode
  6. press "step into" to see the variable content step by step

留言

這個網誌中的熱門文章

UVa 10125 Sumsets

讀書心得: 你以為你以為的就是你以為的嗎?

讀書心得: 撒哈拉的故事