codeblocks單步調試

codeblocks下載地址

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上

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章