首页 > 数据库技术 > 详细

Use GDB to debug code (2-Example)

时间:2020-05-19 01:11:30      阅读:60      评论:0      收藏:0      [点我收藏+]

<1> Using GDB to Debug a Program

bash$ gdb Lab5

<2&5> Specify a condition in the program and apply it to any breakpoint.
Let’s stop a loop at the 99th iteration

(gdb) b 112 if i == 99

<3> Delete breakpoint1

(gdb) delete 1

<4> Print values of variables

(gdb) print i

<2&5> Set breakpoint at specified location.

(gdb) break [LOCATION] [if CONDITION]

where
CONDITION is a boolean expression.

<6> Continue running the code

(gdb) continue // read and skip function
(gdb) step // read line by line

Use GDB to debug code (2-Example)

原文:https://www.cnblogs.com/JasperZhao/p/12914074.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!