GDB - COMMANDS

引言

转载自:GDB - Commands

在做 CSAPP 的 Lab 时,找到这个:最常用的 GDB 命令

内容

GDB offers a big list of commands, however the following commands are the ones used most frequently:

  • b main - Puts a breakpoint at the beginning of the program
  • b - Puts a breakpoint at the current line
  • b N - Puts a breakpoint at line N
  • b + N - Puts a breakpoint N lines down from the current line
  • b fn - Puts a breakpoint at the beginning of function “fn”
  • d N - Deletes breakpoint number N
  • info break - list breakpoints
  • r - Runs the program until a breakpoint or error
  • c - Continues running the program until the next breakpoint or error
  • f - Runs until the current function is finished
  • s - Runs the next line of the program
  • s N - Runs the next N lines of the program
  • n - Like s, but it does not step into functions
  • u N - Runs until you get N lines in front of the current line
  • p var - Prints the current value of the variable “var”
  • bt - Prints a stack trace
  • u - Goes up a level in the stack
  • d - Goes down a level in the stack
  • q - Quits gdb

后记

如何用 Vim 完成上面的内容呢?

1、需要加上关于无序列表的标记

Ctrl + v进入 Visual Block Mode,然后选中多行。接着,如果想要在行首插入,我们用 0 扩展 visual block 到每行的行首; 如果想要在行尾插入,用 $ 扩展 visual block 到每行的行尾。用 A 在每行 visual block 的尾部插入; 用 I 在每行 visual block 的头部插入。

2、然后加上加粗的标记

用宏记录。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值