GDB - A quick reference
GDB - A quick reference gdb program-name gdb program-name core-file gdb program-name process-id - GDB gets attached to the running process with its id equal to given process-id; Note that the running process pauses. Now some variable value can be set and process can be detached. (gdb prompt) attach process-id - Attaches GDB to given process ID (gdb prompt) detach - detaches the process attached. gdb -q -q stands for quite; No copyright printed b(break) main - Put a breakpoint at the beginning of the program b(break) - Put a breakpoint at the next line ( current line makes no sense) b(break) N - Put a breakpoint at line N b(break) filename:N - Put a breakpoint at line N in file filename b(break) class::func - To put a break point in C++ function b(break) +N - Put a breakpoint N lines down from the current line b(break) -N - Put a breakpoint N lines up from the current line b(break) fn - Put a breakpoint at the beginning of function "fn" b(break) if (exprsn) - Any for...
Comments