1.ubuntun14.04下安装cgdb
cong@msi:~$ sudo apt-get install cgdb
2. 使用: cgdb ./hello就可以了
a. cgdb分为上面的vi窗口与下面的gdb窗口
ESC-->切到vi窗口
i -->切到gdb窗口
- -->减小vi窗口
= -->增大vi窗口
shift - -->减小很多vi窗口
shift = -->增大很多vi窗口
b.断点
空格添加/删除断点
c. gdbinit脚本不能用
warning: File "/work/ffmpeg/jpeg/jpegc/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add add-auto-load-safe-path /work/ffmpeg/jpeg/jpegc/.gdbinit line to your configuration file "/home/cong/.gdbinit".
To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/cong/.gdbinit".
For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
临时的方法: 在gdb的命令行里面 source .gdbinit
永久的方法: cong@msi:~$ cat .gdbinit
set auto-load safe-path /