欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

codeblocks单步调试

程序员文章站 2024-02-29 17:05:10
...

codeblocks下载地址

codeblocks下载地址

codeblocks加入gdb

默认安装完毕之后单步调试用不了,需要设置一下
点击settings–>compiler settings如下图示
codeblocks单步调试
查看这里的路径,并记住

点击settings–>debugger settings–>GDB/CDB debugger: Default
Executable path这里根据需要加上gdb.exe的路径,其他gdb.exe应该也可以
gdb在刚才找到的那个目录下面
codeblocks单步调试

新建控制台项目

编写好程序后,

#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这里会显示开始
codeblocks单步调试
3.点击F7
codeblocks单步调试
有一个三角黄的标记指向程序当前运行的位置,继续按F7指行下一段

按快捷键的时候鼠标一定是要在codeblocks上