codeblocks下載地址
codeblocks加入gdb
默認安裝完畢之後單步調試用不了,需要設置一下
點擊settings–>compiler settings如下圖示
查看這裏的路徑,並記住
點擊settings–>debugger settings–>GDB/CDB debugger: Default
Executable path這裏根據需要加上gdb.exe的路徑,其他gdb.exe應該也可以
gdb在剛纔找到的那個目錄下面
新建控制檯項目
編寫好程序後,
#include <iostream>
using namespace std;
int main()
{
cout << "pppppppppppppp!" << endl;
cout << "Hello world!" << endl;
cout << "Hello world!" << endl;
cout << "Hello world!" << endl;
cout << "4545!" << endl;
cout << "Hello world!" << endl;
cout << "4ryrytry!" << endl;
cout << "Hello world!" << endl;
cout << "Hello world!" << endl;
cout << "Hello world!" << endl;
cout << "rtyrjjjjjjjjjjjjj!" << endl;
cout << "Hello world!" << endl;
return 0;
}
1.按F5在程序開始設置斷點
2.按F8,編寫的程序會打開,debugger這裏會顯示開始
3.點擊F7
有一個三角黃的標記指向程序當前運行的位置,繼續按F7指行下一段
按快捷鍵的時候鼠標一定是要在codeblocks上