

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


help Displays information about @cmd usage in GDB run / r Executes program in GDB start Starts executing program and stops at entry point (main) next / n [N] Continues execution till next @N source line print / p Evaluates expression and prints result list / l [N] Lists the source code. If line given, lists ±10 lines from line @N quit / q Exit GDB
Ctrl + x, a Switch between GDB terminal and TUI Ctrl + l Refreshes TUI layout Select TUI layouts. Layouts: src, reg, asm layout split Splits current display screen info registers Shows the contents of registers disassemble Displays assembly instructions nexti /ni [N] Execute N assembly instructions step / s Step inside function finish / fin Exit out of function
x[FMT] ADDRESS
Displays content of @ADDRESS based on given @FMT. FMT: (N)(format)(size) i.e. x/9xw 0x continue / c Continue program execution till next breakpoint. until / u [loc] Executes code until @loc. Useful when trying to exit loops
break Adds breakpoint to specified location info breakpoints Displays information about all current breakpoints.
delete breakpoints [b]
Deletes all given breakpoints. If none given, deletes all breakpoints
watch
Breakpoint halting execution of program whenever variable is modified. info watchpoints Displays information about all watchpoints.
display/[FMT] [address/expr]
Whenever program halts, GDB prints the value of the display variables info display Shows active displays undisp [#num] Deletes the display @num
dprintf
Mix of breakpoint and printf. Gives the same effect of adding printf to your code. info locals Displays value of local variables in current scope. info args Displays value of function argument.
backtrace or bt Prints the callstack bt full Same as bt but with more details frame / f [num] Goes to frame #num up [count] Goes #count frames up down [count] Goes #count frames down
call Same as print but also applicable to call void functions. finish Continues execution till end of function ret Returns value of expression
skip /
When using step, skips going into @function or functions listed in @file info skip Displays details about the specified skips save breakpoints Saves all current breakpoints to @filename source breakpoints Loads breakpoint information from filename