首页 > 代码库 > gdb命令参考

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

gdb命令参考