用help 功能,你可以获得GDB 的命令信息。

help
h 你可以用help(缩写h)不带参数来显示一个命令分类的简短列表。

(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 Type "help" followed by a class name for a list of commands in that class.
Type "help all" for the list of all commands.
Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb)

help class
用help 分类作为参数,你可以得到这个分类里命令列表。比如,下面是status 分类的帮
助显示:

(gdb) help status
Status inquiries. List of commands: info -- Generic command for showing things about the program being debugged
info address -- Describe where symbol SYM is stored
info all-registers -- List of all registers and their contents
info args -- Argument variables of current stack frame
info auto-load -- Print current status of auto-loaded files
info auto-load gdb-scripts -- Print the list of automatically loaded sequences of commands
info auto-load libthread-db -- Print the list of loaded inferior specific libthread_db
info auto-load local-gdbinit -- Print whether current directory .gdbinit file has been loaded
info auto-load python-scripts -- Print the list of automatically loaded Python scripts
info auto-load-scripts -- Print the list of automatically loaded Python scripts
info auxv -- Display the inferior's auxiliary vector
info bookmarks -- Status of user-settable bookmarks
info breakpoints -- Status of specified breakpoints (all user-settable breakpoints if no argument)
info checkpoints -- IDs of currently known checkpoints
info classes -- All Objective-C classes
info common -- Print out the values contained in a Fortran COMMON block
info copying -- Conditions for redistributing copies of GDB
info dcache -- Print information on the dcache performance
info display -- Expressions to display when program stops
info extensions -- All filename extensions associated with a source language
info files -- Names of targets and files being debugged
info float -- Print the status of the floating point unit
info frame -- All about selected stack frame
info frame-filter -- List all registered Python frame-filters
info functions -- All function names
info handle -- What debugger does when program gets various signals
---Type <return> to continue, or q <return> to quit---

help command

用命令名作参数,GDB 会显示一段如何使用这个命令的信息。

apropos args
apropos 命令会在命令和文档里文档搜索这个args 指定的正则表达式。这个命令会打印
所有符合的结果。例如:

(gdb) apropos tbreak
tbreak -- Set a temporary breakpoint

complete args
complete args 命令列出所有可能的补全结果。用args 指定你想要的命令的开头字母。例
如:

(gdb) complete i
if
ignore
ignore-errors
inferior
info
init-if-undefined
interpreter-exec
interrupt
(gdb)

更进一步的,你可以用GDB 命令info 和show 来查询你程序的状态或者GDB 本身的状态。

这两个命令都支持多个主题的查询;

info 和show 下的列表列出了所有的子命令。

info 这个命令(缩写i)可以描述程序的状态。例如,你可以用info args 显示传递给函
数的参数,用info registers 来列出
寄存器数据,用info breakpoints 列出你设置的断点。你可以用help info 来取得info 的
所有子命令。
set 你可以用set 命令把一个表达式的值来设置一个环境变量。例如,你可以用set prompt
$来设置GDB 提示符。
show 和info 不同,show 描述的GDB 本身的状态。你可以用set 命令改变大多数你可以
用show 显示的内容。例如,你可以用set
radix 来设置显示的数值进制系统,或者用show radix 来显示数值进制。
你可以用不带参数的show 命令来显示所有可以设置的参数和它们的值;你也可以用
info set。这两个命令是一样的。
还有其余3 种show 子命令,这3 中命令缺乏对应的set 命令:
show version
显示当前GDB 的版本。你应该在GDB bug 报告中包含版本信息。如果你的机器上有多个版本的GDB,你可能需要知道哪个版本是你正在运行的;随着GDB 的发展,新的命令会引入,而一些旧的将废弃。同时,许多系统供应商移植了不同版本的

GDB,在GNU/Linux 发行版也存在着多种版本的GDB.版本号和你启动时显示一样。

GDB获取帮助信息的更多相关文章

  1. Linux程序宕掉后如何通过gdb查看出错信息

    我们在编写服务端程序的时候,由于多线程并且环境复杂,程序可能在不确定条件的情况下宕掉,还不好重新,这是我们如何获取程序的出错信息,一种方法通过打日志,有时候一些错误日志也不能体现出来,这时就用到我们的 ...

  2. android 获取IMSI信息(判断是移动,联通,电信手机卡)

    首先我们需要知道手机IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信.那么第一步就是先获取手机IMSI号码:代码如下 /** *获取IMSI信息 * ...

  3. FastDFS 通过文件名获取文件信息

    /** * 获取文件信息 * * param string group_name 文件所在的组名 * param string file_id 文件id(如: M00/09/BE/rBBZolgj6O ...

  4. Android获取位置信息的方法总结

    1.位置服务的简介:位置服务,英文翻译为Location-Based Services,缩写为LBS,又称为定位服务或基于位置的服务,融合了GPS定位.移动通信.导航等多种技术,提供与空间位置相关的综 ...

  5. tp框架获取常量信息、方法、命名空间

    获取系统常量信息: public function ShowInFo() { var_dump(get_defined_constants(true)); //如果参数为true,则分类显示 } 在这 ...

  6. ios获取设备信息总结

    1.获取设备的信息 UIDevice *device = [[UIDevice alloc] int]; NSString *name = device.name;       //获取设备所有者的名 ...

  7. JS根据经纬度获取地址信息

    <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...

  8. 半吊子学习Swift--天气预报程序-获取天气信息

    昨天申请的彩云天气Api开发者今天上午已审核通过  饭后运动过后就马不停蹄的来测试接口,接口是采用经纬度的方式来获取天气信息,接口地址如下 https://api.caiyunapp.com/v2/ ...

  9. js get browser vertion (js获取浏览器信息版本)

    1问题:js get browser vertion (js获取浏览器信息版本) 2解决方案 Copy this script into your JavaScript files. It works ...

随机推荐

  1. IIS遇到过的问题

    1. IIS的一个莫名错误Server Application Unavailable http://www.kesion.com/zzcd/asp/aspjq/474.html 新打开这个服务ASP ...

  2. LOJ2341. 「WC2018」即时战略 [动态点分治]

    LOJ 思路 考虑最蠢的暴力:枚举2~n,从1拉一条到他们的链,需要查询\(n^2\)次,显然不能通过. 考虑优化:如果拉的第一个点已经被访问过了,那么类似二分的做法,一次往那个方向多跳几步. 多跳几 ...

  3. MySQL备忘点(下)

    联结表 创建联结 FROM 表1,表2 与内连接作用相同类似:如果失去WHERE子句,会出现笛卡尔积现象 内联结 INNER JOIN 高级联结 自联结 例子:SELECT 字段b FROM 表 WH ...

  4. postgresql could not connect to server

    问题: postgresql部署在linux上,在自己电脑上使用pgadmin连接出现could not connect to server错误 问题分析: 出现上述原因有3种情况 1.linux上的 ...

  5. 【原创】CancellableWait

    应用程序不能正常退出,导致无法关机,这种情况通常是应用程序在等待一些I/O request to finish. 应用程序访问远程文件时,这种情况的发生更加频繁. If an application ...

  6. leetcode 560. Subarray Sum Equals K 、523. Continuous Subarray Sum、 325.Maximum Size Subarray Sum Equals k(lintcode 911)

    整体上3个题都是求subarray,都是同一个思想,通过累加,然后判断和目标k值之间的关系,然后查看之前子数组的累加和. map的存储:560题是存储的当前的累加和与个数 561题是存储的当前累加和的 ...

  7. go协程理解

    一.Golang 线程和协程的区别 备注:需要区分进程.线程(内核级线程).协程(用户级线程)三个概念. 进程.线程 和 协程 之间概念的区别 对于 进程.线程,都是有内核进行调度,有 CPU 时间片 ...

  8. Bootstarp学习

    Bootstarp中文网 http://www.bootcss.com/ https://v2.bootcss.com/javascript.html

  9. 阶段5 3.微服务项目【学成在线】_day03 CMS页面管理开发_18-异常处理-不可预知异常处理

    框架抛出来的或者一些第三方的组件抛出来的异常.我们根本不知道它所对应的错误代码的信息,所以我们也没有办法给用户返回具体的错误代码和错误信息. 我们先在Map中定义有一些不可预知的异常,定义错误代码和错 ...

  10. Qt编写自定义控件30-颜色多态按钮

    一.前言 这个控件一开始打算用样式表来实现,经过初步的探索,后面发现还是不够智能以及不能完全满足需求,比如要在此控件设置多个角标,这个用QSS就很难实现,后面才慢慢研究用QPainter来绘制,我记得 ...