From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/GDB/gdb.html | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 reference/C/GDB/gdb.html (limited to 'reference/C/GDB/gdb.html') diff --git a/reference/C/GDB/gdb.html b/reference/C/GDB/gdb.html new file mode 100644 index 0000000..5d1ff69 --- /dev/null +++ b/reference/C/GDB/gdb.html @@ -0,0 +1,87 @@ +GDB Debugger + + + + +
+
+

GDB Debugger

+
+
+

+The other common debug programs on Unix systems are dbx and dbxtool.

+Before a program can be processed by the debugger, it must be compiled +with the debugger option. +

+	gcc -ggdb -o pipe pipe.c
+
+The program can then be passed to the debugger with +
+	gdb pipe
+
+To pass command line parameters to the program use: +
+	set args -size big
+
+This is equivalent to saying: +
+	pipe -size big
+
+To single step: +
+	break
+	run
+	step
+
+The step command stops execution at the next source statement, +if that statement is a function call, gdb will single step into the function. +
+ A simular command is next this will also single step source +statements but when a it meets a function call, the function is executed +and gdb stops when it reaches a new source statement in the calling +function. +

+step can be abreviated to s +
+next can be abreviated to n +

+To set break points: +

+	break 48	<-- Program will stop BEFORE executing line 48
+	break FuncName  <-- Program will stop when entering the function
+	run
+
+To display the contents of a variable: +
+	print ant[0]
+
+ +To change the value of a variable: +
+	set ant[0] = 4
+	set char = 'z'
+
+ +

+


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

-- cgit v1.2.3-54-g00ecf