diff options
Diffstat (limited to 'reference/C/GDB/gdb.html')
-rw-r--r-- | reference/C/GDB/gdb.html | 87 |
1 files changed, 87 insertions, 0 deletions
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 @@ +<title>GDB Debugger</title> +<head> +<script language="JavaScript"> +</script> +</head> +<body bgcolor="#ffffcc"> +<hr> +<center> +<h1>GDB Debugger</h1> +</center> +<hr> +<p> +The other common debug programs on Unix systems are dbx and dbxtool.<p> +Before a program can be processed by the debugger, it must be compiled +with the debugger option. +<pre> + gcc -ggdb -o pipe pipe.c +</pre> +The program can then be passed to the debugger with +<pre> + gdb pipe +</pre> +To pass command line parameters to the program use: +<pre> + set args -size big +</pre> +This is equivalent to saying: +<pre> + pipe -size big +</pre> +To single step: +<pre> + break + run + step +</pre> +The <b>step</b> command stops execution at the next source statement, +if that statement is a function call, gdb will single step into the function. +<br> + A simular command is <b>next</b> 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. +<p> +<b>step</b> can be abreviated to <b>s</b> +<br> +<b>next</b> can be abreviated to <b>n</b> +<p> +To set break points: +<pre> + break 48 <-- Program will stop BEFORE executing line 48 + break FuncName <-- Program will stop when entering the function + run +</pre> +To display the contents of a variable: +<pre> + print ant[0] +</pre> + +To change the value of a variable: +<pre> + set ant[0] = 4 + set char = 'z' +</pre> + +<p> +<hr> +<p> +<center> +<table border=2 width=80% bgcolor="ivory"> +<tr align=center> +<td width=25%> +<a href=../cref.html> Top</a> +</td><td width=25%> +<a href=../master_index.html> Master Index</a> +</td><td width=25%> +<a href=../SYNTAX/keywords.html> Keywords</a> +</td><td width=25%> +<a href=../FUNCTIONS/funcref.htm> Functions</a> +</td> +</tr> +</table> +</center> +<p> +<hr> +<address>Martin Leslie +</address><p> |