redhat6.3默认是不安装gdb的,如果安装从系统安装盘中找到gdb-7.2-56.e.6.i686.rmp这个文件,
执行rpm -ivh gdb-7.2-56.e.6.i686.rmp。
一个有错的程序:
#include <stdio.h> void test() { int *i = NULL; *i = 2; } int main() { printf("hello, world\n"); test(); return 0; }
我们做的第一件事就是在gdb环境中运行这个程序:
gdb hello
配置Eclipse的默认编码字符集为utf8。
windows-->preference-->general-->workspace
Text file encoding选项,选择other, 改为utf8.
next text file line delmiter选项,选择other,改为unix
配置代码风格:
windows->preference->c/c++->code style->formatter
点击new, 输入一个新的名称(mycodeFormat)
第二个标签页Braces, 选成为next line。
格式化代码:ctrl+shift+F
显示行号:
windows->preference->general->editors->text editors
原文:http://blog.csdn.net/waldmer/article/details/44564575