print-object — Ask an Objective-C object to print itself printf — Printf "printf format string" ptype — Print definition of type TYPE restore — Restore the contents of FILE to target memory set — Evaluate expression EXP and assign result to variable VAR set variable — Evaluate expression...
set var [variable]=[value]: 给变量[variable]赋值 多进程 attach [pid]: 绑定进程 pid info inferiors: 显示进程列表 inferior [num]: 切换到编号为 num 的进程上调试 set follow-fork-mode child/parent: 追踪子进程/父进程 set detach-on-fork on/off: fork 调用时只追踪其中一个进程/同时追踪父子进程...
或l-,显示当前行前面的源码。或l,显示当前行后面的源码;(gdb)s(step):进入函数,逐语句运行;(gdb)n(next):不进入函数,逐过程运行;(gdb)c(continue):继续运行,跳至下一个断点;(gdb)p(print):打印显示变量值;(gdb)setvariable=value,为变量赋值;(gdb)kill:终止调试的程序;(gdb)h(help):列出gdb详细命令...
set args 可指定运行时参数。(如:set args 10 20 30 40 50) show args 命令可以查看设置好的运行参数。 2、运行环境。 path 可设定程序的运行路径。 show paths 查看程序的运行路径。 set environment varname [=value] 设置环境变量。如:set env USER=hchen show environment [varname] 查看环境变量。 3...
在gdb中,可以用“ set var variable=expr ”命令设置变量的值,以上面代码为例: Breakpoint 2, func () at a.c:5 5 int i = 2; (gdb) n 7 return i; (gdb) set var i = 8 (gdb) p i $4 = 8 可以看到在 func 函数里用 set 命令把 i 的值修改成为 8 。
variable in the program being debugged. EXP is any valid expression. Use "set variable" for variables with names identical to set subcommands. With a subcommand, this command modifies parts of the gdb environment. You can see these environment settings with the "show" command. ...
variable in the program being debugged. EXP is any valid expression. Use "set variable" for variables with names identical to set subcommands. With a subcommand, this command modifies parts of the gdb environment. You can see these environment settings with the "show" command. List of set ...
6.1 set variable 变量=值 7. 使中断失效或有效 === disable / enable 7.1 disable 断点编号 可以使某个断点失效 如diable main 可使break main 命令失效 7.2 enable 断点编号 可以使某个断点恢复有效 8. 删除断点 ===clean / delete disable只是让某个断点暂时失效,断点依然存在于程序中.如果要彻底删除某个...
print--Print valueofexpressionEXPprint-object--Ask an Objective-Cobject to print itself printf--Printf"printf format string"ptype--Print definitionoftypeTYPErestore--Restore the contentsofFILEto target memory set--Evaluate expressionEXPand assign result to variableVARsetada--Prefix commandforchanging ...
(gdb) set variable c=0 (gdb) p c $2 = 0 (gdb) 第十:生成内核转储文件 (gdb) generate-core-file warning: Memory read failed for corefile section, 4096 bytes at 0xffffffffff600000. Saved corefile core.2380 有了内核转储文件,即使退出了GDB也能查看生成转储文件时的运行历史。