gdb命令参考

Aliases?for?Other?Command
Alias              Short for ...      Alias Short for ...
bt                 backtrace          i     info
c                  continue           l     list
cont               continue           n     next
d                  delete             ni    nexti
dir                directory          p     print
dis                disable            po    print-object
do                 down               r     run
e                  edit               s     step
f                  frame              share sharedlibrary
fo                 forward-search     si    stepi
gcore              generate-core-file u     until
h                  help               where backtrace

Breakpoints
awatch            Set an expression watchpoint.
break             Set a breakpoint at a line or function.
catch             Set a catchpoint to catch an event.
clear             Clear a given breakpoint.
commands          Specify commands to run when a breakpoint is reached.
condition         Supply a condition to a particular breakpoint.
delete            Delete one or more breakpoints or auto-display expressions.
disable           Disable one or more breakpoints.
enable            Enable one or more breakpoints.
hbreak            Set a hardware-assisted breakpoint.
ignore            Set the ignore-count of a particular breakpoint.
rbreak            Set a breakpoint for all functions matching a regular expression.
rwatch            Set a read watchpoint for an expression.
awatch            Set an expression watchpoint.
tbreak            Set a temporary breakpoint.
tcatch            Set a temporary catchpoint.
thbreak           set a temporary hardware-assisted breakpoint.
watch             Set an expression watchpoint.

Examining?Data
call                  Call a function in the program.
delete?display        Cancel one or more expressions that have been set to display when the program stops.
delete?mem            Delete a memory region.
disable?display       Disable one or more expressions that have been set to display when the program stops.
disable?mem           Disable a memory region.
disassemble           Disassemble a section of memory.
display               Print the value of an expression each time the program stops.
enable?display        Enable one or more expressions that have been set to display when the program stops.
enable?mem            Enable a memory region.
inspect               Same as print.
mem                   Define attributes for a memory region.
output                Similar to print, but doesn‘t save the value in history and doesn‘t print a newline. For scripting.
print                 Print the value of an expression.
print-object          Cause an Objective C object to print information about itself.
printf                Print values such as the printf command.
ptype                 Print the definition of a given type.
set                   Evaluate an expression and save the result in a program variable.
set?variable          Same as set, avoids conflict with GDB variables.
undisplay             Cancel one or more expressions that have been set to display when the program stops.
whatis                Print the data type of an expression.
x                     Examine memory: x/fmt?address.

摘自gdb pocket reference

时间: 2024-08-25 22:14:38

gdb命令参考的相关文章

gdb命令1

今天学习的命令: 下断: b 函数名 b 文件名:函数名 b 文件名:行号 b +/-偏移                       //在当前行号前面或者后面的行号处下断 删除断点: delete breakpoint 断点号  //删除指定断点 delete breakpoint           //删除所有断点 显示所有断点: info b 运行: c C语言源码单步: n s 汇编语言单步: ni si 查看寄存器值: info r 查看变量值: p 变量名称 查看栈: (gdb)

C++常用GDB命令

目前项目使用的: find ./ -name "InfoCheckStat"   ps -ef|grep  workordercon   ps -ef|grep ctpclient export PROCESS_ID=1003 gdb   format workordergen  set args -y -t 3 -n 100000 -i F82 -s ext     export PROCESS_ID=1201 gdb   bussevent  set args  -a   (gdb

用gdb分析core文件及常见gdb命令操作示例

1.概述 在实际的软件开发项目中,程序出现问题是在所难免的.遥想本人参加工作之后首次遇到程序的情景,至今还历历在目.之前的经验告诉我,我们越是惊慌失措,问题就越是解决不了.我们要先让自己平静下来,然后再寻找解决程序问题的办法. 在Linux下做开发的朋友,想必都与core文件打过交道.当看到自己的程序运行之后出现core时,很多人都慌乱了,仿佛天快要塌下来一样.其实,我们大可不必如此,只要我们掌握了用gdb调试core文件的办法,依然可以很快定位程序问题,一举将bug消灭掉.有关Linux co

GDB命令行最基本操作

程序启动: A.冷启动 gdb program              e.g., gdb ./cs gdb –p pid                 e.g., gdb –p `pidof cs` gdb program core      e.g., gdb ./cs core.xxx B.热启动 (gdb) attach pid        e.g., (gdb) attach 2313 C.传入命令行参数 gdb program --args arglist (gdb) set

Git命令参考手册(文本版)

git init # 初始化本地git仓库(创建新仓库) git config --global user.name "xxx" # 配置用户名 git config --global user.email "[email protected]" # 配置邮件 git config --global color.ui true # git status等命令自动着色 git config --global color.status auto git config -

Xcode GDB 命令list

此文下半部分为转载:但是这里有一些我自己使用技巧,结合下面的文章,我们会有更多的收获,在此感谢原创者.     --------------------- 关于调试异常崩溃: 一般崩溃是由内存使用错误导致的,要么多了,要么少了. 用xcode的调试提示可以知道是什么原因导致的崩溃. 在xcode中product àedit scheme à diagnostics 将enable Zombie objects 和 Malloc Stack 选中, 如果是内存释放错误,则gdb会提示release

我常用的DOS命令参考

我常用的DOS命令参考 这个C:\>叫做提示符,这个闪动的横线叫做光标.这样就表示电脑已经准备好,在等待我们给它下命令了.我们现在所需要做的,就是对电脑发出命令,给电脑什么命令,电脑就会做什么. 输入time显示时间,输入date,显示日期: 输入cd ..返回上一级目录. 输入cd\ 返回根目录. dir/p 分屏 dir/w 宽列表格式显示 进入子目录就输入cd+空格+子目录名. md(make directory--创建目录)和rd(remove directory--删除目录). 把文件

Linux -- Samba之命令参考

Samba之命令参考 (1)testparm可以测试Samba配置文件是否正确,执行该命令可以简单测试Samba的配置文件.如果测试结果正确,Samba就可以正确载入配置文件的参数值,但该命令并不保证其后的操作如预期一样正确. testparm [-sv] [配置文件] [<FQDN> <IP地址>] 参数: -s:不显示提示符号等待用户回车,就直接列出Samba服务定义信息. -v:显示Samba服务器的当前配置. [配置文件]:指定需要测试的配置文件名,如果不指定默认为/etc

gdb系列之三 GDB命令

 假如缩写是无歧义的话,你可以将一个GDB命令缩写为开头的几个字母:你也可以用回车键来重复一些GDB命令.你也可以 用TAP键来让GDB补全一个命令的剩余部分(或者告诉你可供选择的命令,假如不止一个命令可选的话). 3.1 命令语法 一个GDB命令是单独的输入行.没有长度限制.命令由一个命令名开始,接着是提供给命令的参数.例如,命令step接收 一个代表步长的参数,就像"step 5″.你也可以用不带参数的step命令.某些命令不允许参数. GDB命令名总是在没有歧义的情况下允许截短.在某些