Standard preamble:
========================================================================
..
.... Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.
If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.
Avoid warning from groff about undefined register 'F'.
.. . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\}
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================
Title "GDB 1"
way too many mistakes in technical documents.
\s-1GDB\s0 can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:
You can use \s-1GDB\s0 to debug programs written in C, C@t{++}, Fortran and Modula-2.
\s-1GDB\s0 is invoked with the shell command \*(C`gdb\*(C'. Once started, it reads commands from the terminal until you tell it to exit with the \s-1GDB\s0 command \*(C`quit\*(C'. You can get online help from \s-1GDB\s0 itself by using the command \*(C`help\*(C'.
You can run \*(C`gdb\*(C' with no arguments or options; but the most usual way to start \s-1GDB\s0 is with one argument or two, specifying an executable program as the argument:
.Vb 1 gdb program .Ve
You can also start with both an executable program and a core file specified:
.Vb 1 gdb program core .Ve
You can, instead, specify a process \s-1ID\s0 as a second argument, if you want to debug a running process:
.Vb 2 gdb program 1234 gdb -p 1234 .Ve
would attach \s-1GDB\s0 to process 1234 (unless you also have a file named 1234; \s-1GDB\s0 does check for a core file first). With option -p you can omit the program filename.
Here are some of the most frequently needed \s-1GDB\s0 commands:
For full details on \s-1GDB,\s0 see Using \s-1GDB: A\s0 Guide to the \s-1GNU\s0 Source-Level Debugger, by Richard M. Stallman and Roland H. Pesch. The same text is available online as the \*(C`gdb\*(C' entry in the \*(C`info\*(C' program.
All the options and command line arguments you give are processed in sequential order. The order makes a difference when the -x option is used.
0
List all options, with brief explanations.
0
Read symbol table from file file.
0
Use file file as the executable file to execute when appropriate, and for examining pure data in conjunction with a core dump.
0
Use file file as a core dump to examine.
0
Execute \s-1GDB\s0 commands from file file.
0
Add directory to the path to search for source files.
0
Do not execute commands from any .gdbinit initialization files.
0
\*(L"Quiet\*(R". Do not print the introductory and copyright messages. These messages are also suppressed in batch mode.
0
Emacs sets this option when it runs \s-1GDB\s0 as a subprocess. It tells \s-1GDB\s0 to output the full file name and line number in a standard, recognizable fashion each time a stack frame is displayed (which includes each time the program stops). This recognizable format looks like two \e032 characters, followed by the file name, line number and character position separated by colons, and a newline. The Emacs-to-GDB interface program uses the two \e032 characters as a signal to display the source code for the frame.
.Vb 1 info gdb .Ve
should give you access to the complete manual.
\fIUsing \s-1GDB: A\s0 Guide to the \s-1GNU\s0 Source-Level Debugger, Richard M. Stallman and Roland H. Pesch, July 1991.
Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being \*(L"Free Software\*(R" and \*(L"Free Software Needs Free Documentation\*(R", with the Front-Cover Texts being \*(L"A \s-1GNU\s0 Manual,\*(R" and with the Back-Cover Texts as in (a) below.
(a) The \s-1FSF\s0's Back-Cover Text is: \*(L"You are free to copy and modify this \s-1GNU\s0 Manual. Buying copies from \s-1GNU\s0 Press supports the \s-1FSF\s0 in developing \s-1GNU\s0 and promoting software freedom.\*(R"