GDB(复习)

GDB是什么东西

GDB调试器, 可以运行你在程序运行时检查里面到底发生了什么

GDB可以做:

  1. 开始并设置参数
  2. 可以打断点,在特殊情况下停止
  3. 当你程序停止,检查发生了什么

搭建实验环境安装GBD

安装gdb

yum install gdb

检查gdb是否成功安装

gdb --version

Here are some of the most frequently needed GDB commands:(来自官方文件)

break [file:]function

Set a breakpoint at function (in file).

run [arglist]

Start your program (with arglist, if specified).

bt Backtrace: display the program stack.打断点

print expr

Display the value of an expression.

c Continue running your program (after stopping, e.g. at a

breakpoint).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值