gdb查看mysql_GDB查看命令

关于 GDB 调试工具,主要是讲解它的字符界面的使用,也就是使用命令调试程序。GDB 中调试的命令非常的多,具体可以通过 help 命令查看。

查看命令的种类

查看各个种类的命令可以进入到 gdb 的命令行模式中,使用 help 命令查看,使用方式:

(gdb) help

不需要添加任何的参数,例如:

(gdb) help

List of classes of commands:

aliases -- Aliases of other commands

breakpoints -- Making program stop at certain points

data -- Examining data

files -- Specifying and examining files

internals -- Maintenance commands

obscure -- Obscure features

running -- Running the program

stack -- Examining the stack

status -- Status inquiries

support -- Support facilities

tracepoints -- Tracing of program execution without stopping the program

user-defined -- User-defined commands

查看具体某个类型中的命令

使用 help 命令,向我们展示了命令总体被划分成了12种,其中每一种又会包含许多的命令,查看各个种类种的命令使用方法:

(gdb) help

其中 表示 help 命令显示的 GDB 中的命令的种类,例如:

(gdb) help breakpoints

Making program stop at certain points.

List of commands:

awatch -- Set a watchpoint for an expression

break -- Set breakpoint at specified location

break-range -- Set a breakpoint for an address range

catch -- Set catchpoints to catch events

catch assert -- Catch failed Ada assertions

catch catch -- Catch an exception

……

列举的只是 breakpoints 这个种类中得一小部分,关于 breakpoints 相关的命令非常多。

命令的具体使用方式

如果我们想知道具体某条命令的使用方法,仍然可以使用 help 命令,使用方法如下:

(gdb) help

表示的是具体的一条命令,例如:

(gdb) help break

Set breakpoint at specified location.

break [PROBE_MODIFIER] [LOCATION] [thread THREADNUM] [if CONDITION]

help 会显示出这条命令的含义以及使用方式。

总结:

help 单独使用是查看命令的种类。

help 添加命令的种类表示使用这条命令查看各个种类中具体命令选项。

help 添加具体的一条命令表示查看命令的使用方式。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值