gdb-refcard - GDB QUICK REFERENCE GDB Version 4 Essential...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
qhf …sgu ‚ipi‚ixgi GDB Version 4 Essential Commands gdb program core debug using coredump b le : function set breakpoint at function in le run arglist start your program with arglist bt backtrace: display program stack p expr display the value of an expression c continue running your program n next line, stepping over function calls s next line, stepping into function calls Starting GDB gdb start GDB, with no debugging les gdb begin debugging gdb program core debug coredump produced by gdb --help describe command line options Stopping GDB quit exit GDB; also q or EOF (eg C-d ) INTERRUPT (eg C-c ) terminate current command, or send to running process Getting Help help list classes of commands help class one-line descriptions for commands in class help command describe command Executing your Program run arglist start your program with arglist run start your program with current argument list run XXX < inf > outf start your program with input, output redirected kill kill running program tty dev use dev as stdin and stdout for next run set args arglist specify arglist for next run set args specify empty argument list show args display argument list show env show all environment variables show env var show value of environment variable var set env var string set environment variable var unset env var remove var from environment Shell Commands cd dir change working directory to dir pwd Print working directory make call \ make " shell cmd execute arbitrary shell command string ‘“ surround optional arguments show one or more arguments c 1991, 1992, 1993 Free Software Foundation, Inc. Permissions on back Breakpoints and Watchpoints break le : line b le : line set breakpoint at line number in le eg: break main.c:37 break le : func set breakpoint at func in le break + o set break - o set set break at o set lines from current stop break * addr set breakpoint at address addr break set breakpoint at next instruction break if expr break conditionally on nonzero expr cond n expr new conditional expression on breakpoint n ; make unconditional if no expr tbreak temporary break; disable when reached rbreak regex break on all functions matching regex watch expr set a watchpoint for expression expr catch x break at C++ handler for exception x info break show de ned breakpoints info watch show de ned watchpoints clear delete breakpoints at next instruction clear le : fun delete breakpoints at entry to fun () clear le : line delete breakpoints on source line delete n delete breakpoints or breakpoint n disable n disable breakpoints or breakpoint n enable n enable breakpoints or breakpoint n enable once n enable breakpoints or breakpoint n ; disable again when reached enable del n enable breakpoints
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

gdb-refcard - GDB QUICK REFERENCE GDB Version 4 Essential...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online