1.ubuntun14.04下安装cgdb
cong@msi:~$ sudo apt-get install cgdb
cong@msi:~$ sudo apt-get install cgdb
2. 使用: cgdb ./hello就可以了
a. cgdb分为上面的vi窗口与下面的gdb窗口
b.断点
空格添加/删除断点
3. gdb
a. 在指定文件中指定函数处设断点
b :
b
<filename
c. .gdbinit脚本不能用
在gdb的命令行里面 source .gdbinit
暂时先这么用着吧
d. 打印多个变量
p {i,j,k,l}
display {i,j,k,l} --> 每执行一次都打印这几个变量
undisplay --> 去掉display
a. cgdb分为上面的vi窗口与下面的gdb窗口
-
ESC-->切到vi窗口
-
i -->切到gdb窗口
-
- -->减小vi窗口
-
= -->增大vi窗口
-
shift - -->减小很多vi窗口
- shift = -->增大很多vi窗口
空格添加/删除断点
3. gdb
a. 在指定文件中指定函数处设断点
b :
b
-
b <filename>: <func_name>
- b <filename>: <line_num>
<filename
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-loa
-
d".
-
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"
暂时先这么用着吧
d. 打印多个变量
p {i,j,k,l}
display {i,j,k,l} --> 每执行一次都打印这几个变量
undisplay --> 去掉display