linux里调试step和next区别,linux下gdb单步调试(GDB single step debugging under Linux).doc...

linux下gdb单步调试(GDB single step debugging under Linux)GDB single step debugging under Linux

Set breakpoint (BreakPoint)

We set breakpoints with the break command. How many breakpoints are set on the front?:

Break

Stop when you enter the specified function. In C++, you can specify the function name in class:: function or function (type, type) format.

Break

Stop at the specified line number.

Break +offset

Break -offset

Stops at the front or back of the current line number in the offset row. Offiset is a natural number.

Break filename:linenum

Stop at the linenum row of the source file filename.

Break filename:function

Stop at the entrance of the function function of the source file filename.

Break *address

Stop at the memory address of the program running.

Break

When the break command does not have a parameter, it means that it stops at the next instruction.

Break... If

It can be the parameter mentioned above. Condition represents the condition and stops when the condition is established. For example, in the loop body, you can set the break if i=100 to indicate the stop program when I is 100.

When you look at breakpoints, you can use the info command, as follows: (Note: n represents breakpoint number)

Info breakpoints [n]

Info break [n]

Two. Set observation points (WatchPoint)

Observation points are generally used to observe whether an expression (variable is also an expression) has changed, and if there is a change, stop the program immediately. We have several ways to set up observation points:

Watch

Set an observation point for the expression (variable) expr. Stop the program immediately when there is a change in the expression value.

Rwatch

When the expression of expr (variable) read, stop program.

Awatch

When the expression (variable) values read or written to, stop the program.

Info watchpoints

Lists all the observation points currently set up.

Three, set the capture point (CatchPoint)

You can set up capture po

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值