Obsolete m88k.
[deliverable/binutils-gdb.git] / gdb / doc / gdb.texinfo
index 076d166a6c757e3f0fad05509d3af8feb7351dd2..87b15a37e75bf897410af819018dc72104a1e0a7 100644 (file)
@@ -128,6 +128,7 @@ Copyright (C) 1988-2002 Free Software Foundation, Inc.
 * Stack::                       Examining the stack
 * Source::                      Examining source files
 * Data::                        Examining data
+* Macros::                      Preprocessor Macros
 * Tracepoints::                 Debugging remote targets non-intrusively
 * Overlays::                    Debugging programs that use overlays
 
@@ -154,6 +155,8 @@ Copyright (C) 1988-2002 Free Software Foundation, Inc.
 * Installing GDB::              Installing GDB
 * Maintenance Commands::        Maintenance Commands
 * Remote Protocol::             GDB Remote Serial Protocol
+* Copying::                    GNU General Public License says
+                                how you can copy and share GDB
 * GNU Free Documentation License::  The license for this documentation
 * Index::                       Index
 @end menu
@@ -460,6 +463,8 @@ Romig-Koch, Rob Savoye, Jamie Smith, Mike Stump, Ian Taylor, Angela
 Thomas, Michael Tiemann, Tom Tromey, Ron Unrau, Jim Wilson, and David
 Zuhn have made contributions both large and small.
 
+Jim Blandy added support for preprocessor macros, while working for Red
+Hat.
 
 @node Sample Session
 @chapter A Sample @value{GDBN} Session
@@ -765,24 +770,24 @@ options may effectively be unavailable.
 The most usual way to start @value{GDBN} is with one argument,
 specifying an executable program:
 
-@example
+@smallexample
 @value{GDBP} @var{program}
-@end example
+@end smallexample
 
 @noindent
 You can also start with both an executable program and a core file
 specified:
 
-@example
+@smallexample
 @value{GDBP} @var{program} @var{core}
-@end example
+@end smallexample
 
 You can, instead, specify a process ID as a second argument, if you want
 to debug a running process:
 
-@example
+@smallexample
 @value{GDBP} @var{program} 1234
-@end example
+@end smallexample
 
 @noindent
 would attach @value{GDBN} to process @code{1234} (unless you also have a file
@@ -797,9 +802,9 @@ will warn you if it is unable to attach or to read core dumps.
 You can optionally have @code{@value{GDBP}} pass any arguments after the
 executable file to the inferior using @code{--args}.  This option stops
 option processing.
-@example
+@smallexample
 gdb --args gcc -O2 -c foo.c
-@end example
+@end smallexample
 This will cause @code{@value{GDBP}} to debug @code{gcc}, and to set
 @code{gcc}'s command-line arguments (@pxref{Arguments}) to @samp{-O2 -c foo.c}.
 
@@ -817,9 +822,9 @@ options.  @value{GDBN} itself can remind you of the options available.
 @noindent
 Type
 
-@example
+@smallexample
 @value{GDBP} -help
-@end example
+@end smallexample
 
 @noindent
 to display all available options and briefly describe their use
@@ -948,9 +953,9 @@ information.  (@xref{Files,,Commands to specify files}, for information
 on @file{.syms} files.)  A simple @value{GDBN} invocation to do nothing
 but build a @file{.syms} file for future use is:
 
-@example
+@smallexample
 gdb -batch -nx -mapped -readnow programname
-@end example
+@end smallexample
 
 @node Mode Options
 @subsection Choosing modes
@@ -989,9 +994,9 @@ Batch mode may be useful for running @value{GDBN} as a filter, for
 example to download and run a program on another computer; in order to
 make this more useful, the message
 
-@example
+@smallexample
 Program exited normally.
-@end example
+@end smallexample
 
 @noindent
 (which is ordinarily issued whenever a program running under
@@ -1281,17 +1286,17 @@ enter it).  For example, if you type
 @c complete accuracy in these examples; space introduced for clarity.
 @c If texinfo enhancements make it unnecessary, it would be nice to
 @c replace " @key" by "@key" in the following...
-@example
+@smallexample
 (@value{GDBP}) info bre @key{TAB}
-@end example
+@end smallexample
 
 @noindent
 @value{GDBN} fills in the rest of the word @samp{breakpoints}, since that is
 the only @code{info} subcommand beginning with @samp{bre}:
 
-@example
+@smallexample
 (@value{GDBP}) info breakpoints
-@end example
+@end smallexample
 
 @noindent
 You can either press @key{RET} at this point, to run the @code{info
@@ -1311,7 +1316,7 @@ just sounds the bell.  Typing @key{TAB} again displays all the
 function names in your program that begin with those characters, for
 example:
 
-@example
+@smallexample
 (@value{GDBP}) b make_ @key{TAB}
 @exdent @value{GDBN} sounds bell; press @key{TAB} again, to see:
 make_a_section_from_file     make_environ
@@ -1320,7 +1325,7 @@ make_blockvector             make_pointer_type
 make_cleanup                 make_reference_type
 make_command                 make_symbol_completion_list
 (@value{GDBP}) b make_
-@end example
+@end smallexample
 
 @noindent
 After displaying the available possibilities, @value{GDBN} copies your
@@ -1353,22 +1358,22 @@ word-completion facilities in this situation, type a single quote
 @value{GDBN} that it may need to consider more information than usual
 when you press @key{TAB} or @kbd{M-?} to request word completion:
 
-@example
+@smallexample
 (@value{GDBP}) b 'bubble( @kbd{M-?}
 bubble(double,double)    bubble(int,int)
 (@value{GDBP}) b 'bubble(
-@end example
+@end smallexample
 
 In some cases, @value{GDBN} can tell that completing a name requires using
 quotes.  When this happens, @value{GDBN} inserts the quote for you (while
 completing as much as it can) if you do not type the quote in the first
 place:
 
-@example
+@smallexample
 (@value{GDBP}) b bub @key{TAB}
 @exdent @value{GDBN} alters your input line to the following, and rings a bell:
 (@value{GDBP}) b 'bubble(
-@end example
+@end smallexample
 
 @noindent
 In general, @value{GDBN} can tell that a quote is needed (and inserts it) if
@@ -1607,6 +1612,16 @@ and addresses in the executable code.
 To request debugging information, specify the @samp{-g} option when you run
 the compiler.
 
+Most compilers do not include information about preprocessor macros in
+the debugging information if you specify the @option{-g} flag alone,
+because this information is rather large.  Version 3.1 of @value{NGCC},
+the @sc{gnu} C compiler, provides macro information if you specify the
+options @option{-gdwarf-2} and @option{-g3}; the former option requests
+debugging information in the Dwarf 2 format, and the latter requests
+``extra information''.  In the future, we hope to find more compact ways
+to represent macro information, so that it can be included with
+@option{-g} alone.
+
 Many C compilers are unable to handle the @samp{-g} and @samp{-O}
 options together.  Using those compilers, you cannot generate optimized
 executables containing debugging information.
@@ -1804,9 +1819,9 @@ null value.
 
 For example, this command:
 
-@example
+@smallexample
 set env USER = foo
-@end example
+@end smallexample
 
 @noindent
 tells the debugged program, when subsequently run, that its user is named
@@ -1877,9 +1892,9 @@ program is using.
 You can redirect your program's input and/or output using shell
 redirection with the @code{run} command.  For example,
 
-@example
+@smallexample
 run > outfile
-@end example
+@end smallexample
 
 @noindent
 starts your program, diverting its output to the file @file{outfile}.
@@ -1892,9 +1907,9 @@ argument, and causes this file to be the default for future @code{run}
 commands.  It also resets the controlling terminal for the child
 process, for future @code{run} commands.  For example,
 
-@example
+@smallexample
 tty /dev/ttyb
-@end example
+@end smallexample
 
 @noindent
 directs that processes started with subsequent @code{run} commands
@@ -2053,9 +2068,9 @@ form @samp{[New @var{systag}]}.  @var{systag} is a thread identifier
 whose form varies depending on the particular system.  For example, on
 LynxOS, you might see
 
-@example
+@smallexample
 [New process 35 thread 27]
-@end example
+@end smallexample
 
 @noindent
 when @value{GDBN} notices a new thread.  In contrast, on an SGI system,
@@ -2064,7 +2079,7 @@ further qualifier.
 
 @c FIXME!! (1) Does the [New...] message appear even for the very first
 @c         thread of a program, or does it only appear for the
-@c         second---i.e., when it becomes obvious we have a multithread
+@c         second---i.e.@: when it becomes obvious we have a multithread
 @c         program?
 @c         (2) *Is* there necessarily a first thread always?  Or do some
 @c         multithread systems permit starting a program with multiple
@@ -2124,9 +2139,9 @@ form @samp{[New @var{systag}]}.  @var{systag} is a thread identifier
 whose form varies depending on the particular system.  For example, on
 HP-UX, you see
 
-@example
+@smallexample
 [New thread 2 (system thread 26594)]
-@end example
+@end smallexample
 
 @noindent
 when @value{GDBN} notices a new thread.
@@ -2153,7 +2168,7 @@ For example,
 @end table
 @c end table here to get a little more width for example
 
-@example
+@smallexample
 (@value{GDBP}) info threads
     * 3 system thread 26607  worker (wptr=0x7b09c318 "@@") \@*
                                at quicksort.c:137
@@ -2161,7 +2176,7 @@ For example,
                                from /usr/lib/libc.2
       1 system thread 27905  0x7b003498 in _brk () \@*
                                from /usr/lib/libc.2
-@end example
+@end smallexample
 
 @table @code
 @kindex thread @var{threadno}
@@ -2637,9 +2652,9 @@ statement, not the instruction, after the change occurs.
 
 When you issue the @code{watch} command, @value{GDBN} reports
 
-@example
+@smallexample
 Hardware watchpoint @var{num}: @var{expr}
-@end example
+@end smallexample
 
 @noindent
 if it was able to set a hardware watchpoint.
@@ -2818,11 +2833,11 @@ knowledge of the implementation.  In the case of @sc{gnu} C@t{++}, exceptions ar
 raised by calling a library function named @code{__raise_exception}
 which has the following ANSI C interface:
 
-@example
+@smallexample
     /* @var{addr} is where the exception identifier is stored.
        @var{id} is the exception identifier.  */
     void __raise_exception (void **addr, void *id);
-@end example
+@end smallexample
 
 @noindent
 To make the debugger catch all exceptions before any stack
@@ -3015,9 +3030,9 @@ referents in the context of your breakpoint.  If @var{expression} uses
 symbols not referenced in the context of the breakpoint, @value{GDBN}
 prints an error message:
 
-@example
+@smallexample
 No symbol "foo" in current context.
-@end example
+@end smallexample
 
 @noindent
 @value{GDBN} does
@@ -3126,14 +3141,14 @@ breakpoints.  @xref{Output, ,Commands for controlled output}.
 For example, here is how you could use breakpoint commands to print the
 value of @code{x} at entry to @code{foo} whenever @code{x} is positive.
 
-@example
+@smallexample
 break foo if x>0
 commands
 silent
 printf "x is %d\n",x
 cont
 end
-@end example
+@end smallexample
 
 One application for breakpoint commands is to compensate for one bug so
 you can test for another.  Put a breakpoint just after the erroneous line
@@ -3143,14 +3158,14 @@ to any variables that need them.  End with the @code{continue} command
 so that your program does not stop, and start with the @code{silent}
 command so that no output is produced.  Here is an example:
 
-@example
+@smallexample
 break 403
 commands
 silent
 set x = y + 4
 cont
 end
-@end example
+@end smallexample
 
 @node Breakpoint Menus
 @subsection Breakpoint menus
@@ -3209,10 +3224,10 @@ any other process is running that program.  In this situation,
 attempting to run or continue a program with a breakpoint causes
 @value{GDBN} to print an error message:
 
-@example
+@smallexample
 Cannot insert breakpoints.
 The same program may be running in another process.
-@end example
+@end smallexample
 
 When this happens, you have three ways to proceed:
 
@@ -3417,13 +3432,13 @@ example, in the following excerpt from a debugging session, the @code{f}
 (@code{frame}) command shows that execution is stopped at line
 @code{206}; yet when we use @code{until}, we get to line @code{195}:
 
-@example
+@smallexample
 (@value{GDBP}) f
 #0  main (argc=4, argv=0xf7fffae8) at m4.c:206
 206                 expand_input();
 (@value{GDBP}) until
 195             for ( ; argc > 0; NEXTARG) @{
-@end example
+@end smallexample
 
 This happened because, for execution efficiency, the compiler had
 generated code for the loop closure test at the end, rather than the
@@ -3745,9 +3760,9 @@ frames in @value{GDBN} commands.
 @cindex frameless execution
 Some compilers provide a way to compile functions so that they operate
 without stack frames.  (For example, the @value{GCC} option
-@example
+@smallexample
 @samp{-fomit-frame-pointer}
-@end example
+@end smallexample
 generates functions without a frame.)
 This is occasionally done with heavily used library functions to save
 the frame setup time.  @value{GDBN} has limited facilities for dealing
@@ -4402,6 +4417,7 @@ Table}.
 * Registers::                   Registers
 * Floating Point Hardware::     Floating point hardware
 * Memory Region Attributes::    Memory region attributes
+* Dump/Restore Files::          Copy between memory and a file
 @end menu
 
 @node Expressions
@@ -4411,9 +4427,10 @@ Table}.
 @code{print} and many other @value{GDBN} commands accept an expression and
 compute its value.  Any kind of constant, variable or operator defined
 by the programming language you are using is valid in an expression in
-@value{GDBN}.  This includes conditional expressions, function calls, casts
-and string constants.  It unfortunately does not include symbols defined
-by preprocessor @code{#define} commands.
+@value{GDBN}.  This includes conditional expressions, function calls,
+casts, and string constants.  It also includes preprocessor macros, if
+you compiled your program to include this information; see
+@ref{Compilation}.
 
 @value{GDBN} supports array constants in expressions input by
 the user.  The syntax is @{@var{element}, @var{element}@dots{}@}.  For example,
@@ -4481,7 +4498,7 @@ programming language from the point of execution in that frame
 
 @noindent This means that in the function
 
-@example
+@smallexample
 foo (a)
      int a;
 @{
@@ -4491,7 +4508,7 @@ foo (a)
     bar (b);
   @}
 @}
-@end example
+@end smallexample
 
 @noindent
 you can examine and use the variable @code{a} whenever your program is
@@ -4513,10 +4530,10 @@ using the colon-colon notation:
 @c info cannot cope with a :: index entry, but why deprive hard copy readers?
 @cindex @code{::}, context for variables/functions
 @end iftex
-@example
+@smallexample
 @var{file}::@var{variable}
 @var{function}::@var{variable}
-@end example
+@end smallexample
 
 @noindent
 Here @var{file} or @var{function} is the name of the context for the
@@ -4524,9 +4541,9 @@ static @var{variable}.  In the case of file names, you can use quotes to
 make sure @value{GDBN} parses the file name as a single word---for example,
 to print a global value of @code{x} defined in @file{f2.c}:
 
-@example
+@smallexample
 (@value{GDBP}) p 'f2.c'::x
-@end example
+@end smallexample
 
 @cindex C@t{++} scope resolution
 This use of @samp{::} is very rarely in conflict with the very similar
@@ -4563,9 +4580,9 @@ offered by the debug info format used by the compiler, @value{GDBN}
 might not be able to display values for such local variables.  If that
 happens, @value{GDBN} will print a message like this:
 
-@example
+@smallexample
 No symbol "foo" in current context.
-@end example
+@end smallexample
 
 To solve such problems, either recompile without optimizations, or use a
 different debug info format, if the compiler supports several such
@@ -4598,16 +4615,16 @@ argument; the second element comes from bytes of memory immediately
 following those that hold the first element, and so on.  Here is an
 example.  If a program says
 
-@example
+@smallexample
 int *array = (int *) malloc (len * sizeof (int));
-@end example
+@end smallexample
 
 @noindent
 you can print the contents of @code{array} with
 
-@example
+@smallexample
 p *array@@len
-@end example
+@end smallexample
 
 The left operand of @samp{@@} must reside in memory.  Array values made
 with @samp{@@} in this way behave just like other arrays in terms of
@@ -4618,18 +4635,18 @@ Artificial arrays most often appear in expressions via the value history
 Another way to create an artificial array is to use a cast.
 This re-interprets a value as if it were an array.
 The value need not be in memory:
-@example
+@smallexample
 (@value{GDBP}) p/x (short[2])0x12345678
 $1 = @{0x1234, 0x5678@}
-@end example
+@end smallexample
 
 As a convenience, if you leave the array length out (as in
 @samp{(@var{type}[])@var{value}}) @value{GDBN} calculates the size to fill
 the value (as @samp{sizeof(@var{value})/sizeof(@var{type})}:
-@example
+@smallexample
 (@value{GDBP}) p/x (short[])0x12345678
 $2 = @{0x1234, 0x5678@}
-@end example
+@end smallexample
 
 Sometimes the artificial array mechanism is not quite enough; in
 moderately complex data structures, the elements of interest may not
@@ -4642,13 +4659,13 @@ instance, suppose you have an array @code{dtab} of pointers to
 structures, and you are interested in the values of a field @code{fv}
 in each structure.  Here is an example of what you might type:
 
-@example
+@smallexample
 set $i = 0
 p dtab[$i++]->fv
 @key{RET}
 @key{RET}
 @dots{}
-@end example
+@end smallexample
 
 @node Output Formats
 @section Output formats
@@ -4693,10 +4710,10 @@ Print as an address, both absolute in hexadecimal and as an offset from
 the nearest preceding symbol.  You can use this format used to discover
 where (in what function) an unknown address is located:
 
-@example
+@smallexample
 (@value{GDBP}) p/a 0x54320
 $3 = 0x54320 <_initialize_vx+396>
-@end example
+@end smallexample
 
 @noindent
 The command @code{info symbol 0x54320} yields similar results.
@@ -4712,9 +4729,9 @@ using typical floating point syntax.
 
 For example, to print the program counter in hex (@pxref{Registers}), type
 
-@example
+@smallexample
 p/x $pc
-@end example
+@end smallexample
 
 @noindent
 Note that no space is required before the slash; this is because command
@@ -4841,10 +4858,10 @@ Each expression added to the list is given a number to identify it;
 to remove an expression from the list, you specify that number.
 The automatic display looks like this:
 
-@example
+@smallexample
 2: foo = 38
 3: bar[5] = (struct hack *) 0x3804
-@end example
+@end smallexample
 
 @noindent
 This display shows item numbers, expressions and their current values.  As with
@@ -5032,11 +5049,11 @@ and source file location of the variable where it points, using
 For example, here @value{GDBN} shows that a variable @code{ptt} points
 at another variable @code{t}, defined in @file{hi2.c}:
 
-@example
+@smallexample
 (@value{GDBP}) set print symbol-filename on
 (@value{GDBP}) p/a ptt
 $4 = 0xe008 <t in hi2.c>
-@end example
+@end smallexample
 
 @quotation
 @emph{Warning:} For pointers that point to a local variable, @samp{p/a}
@@ -5318,16 +5335,16 @@ is the value just prior to @code{$$}, @code{$$1} is equivalent to
 For example, suppose you have just printed a pointer to a structure and
 want to see the contents of the structure.  It suffices to type
 
-@example
+@smallexample
 p *$
-@end example
+@end smallexample
 
 If you have a chain of structures where the component @code{next} points
 to the next one, you can print the contents of the next one with this:
 
-@example
+@smallexample
 p *$.next
-@end example
+@end smallexample
 
 @noindent
 You can print successive links in the chain by repeating this
@@ -5336,10 +5353,10 @@ command---which you can do by just typing @key{RET}.
 Note that the history records values, not expressions.  If the value of
 @code{x} is 4 and you type these commands:
 
-@example
+@smallexample
 print x
 set x=5
-@end example
+@end smallexample
 
 @noindent
 then the value recorded in the value history by the @code{print} command
@@ -5383,9 +5400,9 @@ You can save a value in a convenience variable with an assignment
 expression, just as you would set a variable in your program.
 For example:
 
-@example
+@smallexample
 set $foo = *object_ptr
-@end example
+@end smallexample
 
 @noindent
 would save in @code{$foo} the value contained in the object pointed to by
@@ -5411,10 +5428,10 @@ One of the ways to use a convenience variable is as a counter to be
 incremented or a pointer to be advanced.  For example, to print
 a field from successive elements of an array of structures:
 
-@example
+@smallexample
 set $i = 0
 print bar[$i++]->contents
-@end example
+@end smallexample
 
 @noindent
 Repeat that command by typing @key{RET}.
@@ -5486,16 +5503,16 @@ pointer to the current stack frame, and @code{$ps} is used for a
 register that contains the processor status.  For example,
 you could print the program counter in hex with
 
-@example
+@smallexample
 p/x $pc
-@end example
+@end smallexample
 
 @noindent
 or print the instruction to be executed next with
 
-@example
+@smallexample
 x/i $pc
-@end example
+@end smallexample
 
 @noindent
 or add four to the stack pointer@footnote{This is a way of removing
@@ -5506,9 +5523,9 @@ stack frames are selected.  To pop entire frames off the stack,
 regardless of machine architecture, use @code{return};
 see @ref{Returning, ,Returning from a function}.} with
 
-@example
+@smallexample
 set $sp += 4
-@end example
+@end smallexample
 
 Whenever possible, these four standard register names are available on
 your machine even though the machine has different canonical mnemonics,
@@ -5565,7 +5582,7 @@ the ARM and x86 machines.
 @end table
 
 @node Memory Region Attributes
-@section Memory Region Attributes 
+@section Memory region attributes 
 @cindex memory region attributes
 
 @dfn{Memory region attributes} allow you to describe special handling 
@@ -5584,23 +5601,25 @@ to enable, disable, or remove a memory region, you specify that number.
 
 @table @code
 @kindex mem
-@item mem @var{address1} @var{address1} @var{attributes}@dots{}
-Define memory region bounded by @var{address1} and @var{address2}
-with attributes @var{attributes}@dots{}.
+@item mem @var{lower} @var{upper} @var{attributes}@dots{}
+Define memory region bounded by @var{lower} and @var{upper} with
+attributes @var{attributes}@dots{}.  Note that @var{upper} == 0 is a
+special case: it is treated as the the target's maximum memory address.
+(0xffff on 16 bit targets, 0xffffffff on 32 bit targets, etc.)
 
 @kindex delete mem
 @item delete mem @var{nums}@dots{}
-Remove memory region numbers @var{nums}.
+Remove memory regions @var{nums}@dots{}.
 
 @kindex disable mem
 @item disable mem @var{nums}@dots{}
-Disable memory region numbers @var{nums}.
+Disable memory regions @var{nums}@dots{}.
 A disabled memory region is not forgotten.  
 It may be enabled again later.
 
 @kindex enable mem
 @item enable mem @var{nums}@dots{}
-Enable memory region numbers @var{nums}.
+Enable memory regions @var{nums}@dots{}.
 
 @kindex info mem
 @item info mem
@@ -5641,7 +5660,7 @@ Memory is read only.
 @item wo
 Memory is write only.
 @item rw
-Memory is read/write (default).
+Memory is read/write.  This is the default.
 @end table
 
 @subsubsection Memory Access Size
@@ -5682,8 +5701,8 @@ registers.
 @table @code
 @item cache
 Enable @value{GDBN} to cache target memory. 
-@item nocache (default)
-Disable @value{GDBN} from caching target memory.
+@item nocache
+Disable @value{GDBN} from caching target memory.  This is the default.
 @end table
 
 @c @subsubsection Memory Write Verification
@@ -5695,6 +5714,306 @@ Disable @value{GDBN} from caching target memory.
 @c @item noverify (default)
 @c @end table
 
+@node Dump/Restore Files
+@section Copy between memory and a file
+@cindex dump/restore files
+@cindex append data to a file
+@cindex dump data to a file
+@cindex restore data from a file
+@kindex dump
+@kindex append
+@kindex restore
+
+The commands @code{dump}, @code{append}, and @code{restore} are used
+for copying data between target memory and a file.  Data is written
+into a file using @code{dump} or @code{append}, and restored from a 
+file into memory by using @code{restore}.  Files may be binary, srec,
+intel hex, or tekhex (but only binary files can be appended).
+
+@table @code
+@kindex dump binary 
+@kindex append binary 
+@item dump binary memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into 
+raw binary format file @var{filename}.
+
+@item append binary memory @var{filename} @var{start_addr} @var{end_addr}
+Append contents of memory from @var{start_addr} to @var{end_addr} to
+raw binary format file @var{filename}.
+
+@item dump binary value @var{filename} @var{expression}
+Dump value of @var{expression} into raw binary format file @var{filename}.
+
+@item append binary memory @var{filename} @var{expression}
+Append value of @var{expression} to raw binary format file @var{filename}.
+
+@kindex dump ihex 
+@item dump ihex memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into 
+intel hex format file @var{filename}.
+
+@item dump ihex value @var{filename} @var{expression}
+Dump value of @var{expression} into intel hex format file @var{filename}.
+
+@kindex dump srec 
+@item dump srec memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into 
+srec format file @var{filename}.
+
+@item dump srec value @var{filename} @var{expression}
+Dump value of @var{expression} into srec format file @var{filename}.
+
+@kindex dump tekhex 
+@item dump tekhex memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into 
+tekhex format file @var{filename}.
+
+@item dump tekhex value @var{filename} @var{expression}
+Dump value of @var{expression} into tekhex format file @var{filename}.
+
+@item restore @var{filename} @var{[binary]} @var{bias} @var{start} @var{end}
+Restore the contents of file @var{filename} into memory.  The @code{restore}
+command can automatically recognize any known bfd file format, except for
+raw binary.  To restore a raw binary file you must use the optional argument
+@var{binary} after the filename.
+
+If @var{bias} is non-zero, its value will be added to the addresses 
+contained in the file.  Binary files always start at address zero, so
+they will be restored at address @var{bias}.  Other bfd files have
+a built-in location; they will be restored at offset @var{bias}
+from that location.
+
+If @var{start} and/or @var{end} are non-zero, then only data between
+file offset @var{start} and file offset @var{end} will be restored.
+These offsets are relative to the addresses in the file, before 
+the @var{bias} argument is applied.
+
+@end table
+
+@node Macros
+@chapter C Preprocessor Macros
+
+Some languages, such as C and C++, provide a way to define and invoke
+``preprocessor macros'' which expand into strings of tokens.
+@value{GDBN} can evaluate expressions containing macro invocations, show
+the result of macro expansion, and show a macro's definition, including
+where it was defined.
+
+You may need to compile your program specially to provide @value{GDBN}
+with information about preprocessor macros.  Most compilers do not
+include macros in their debugging information, even when you compile
+with the @option{-g} flag.  @xref{Compilation}.
+
+A program may define a macro at one point, remove that definition later,
+and then provide a different definition after that.  Thus, at different
+points in the program, a macro may have different definitions, or have
+no definition at all.  If there is a current stack frame, @value{GDBN}
+uses the macros in scope at that frame's source code line.  Otherwise,
+@value{GDBN} uses the macros in scope at the current listing location;
+see @ref{List}.
+
+At the moment, @value{GDBN} does not support the @code{##}
+token-splicing operator, the @code{#} stringification operator, or
+variable-arity macros.
+
+Whenever @value{GDBN} evaluates an expression, it always expands any
+macro invocations present in the expression.  @value{GDBN} also provides
+the following commands for working with macros explicitly.
+
+@table @code
+
+@kindex macro expand
+@cindex macro expansion, showing the results of preprocessor
+@cindex preprocessor macro expansion, showing the results of
+@cindex expanding preprocessor macros
+@item macro expand @var{expression}
+@itemx macro exp @var{expression}
+Show the results of expanding all preprocessor macro invocations in
+@var{expression}.  Since @value{GDBN} simply expands macros, but does
+not parse the result, @var{expression} need not be a valid expression;
+it can be any string of tokens.
+
+@kindex macro expand-once
+@item macro expand-once @var{expression}
+@itemx macro exp1 @var{expression}
+@i{(This command is not yet implemented.)}  Show the results of
+expanding those preprocessor macro invocations that appear explicitly in
+@var{expression}.  Macro invocations appearing in that expansion are
+left unchanged.  This command allows you to see the effect of a
+particular macro more clearly, without being confused by further
+expansions.  Since @value{GDBN} simply expands macros, but does not
+parse the result, @var{expression} need not be a valid expression; it
+can be any string of tokens.
+
+@kindex info macro
+@cindex macro definition, showing
+@cindex definition, showing a macro's
+@item info macro @var{macro}
+Show the definition of the macro named @var{macro}, and describe the
+source location where that definition was established.
+
+@kindex macro define
+@cindex user-defined macros
+@cindex defining macros interactively
+@cindex macros, user-defined
+@item macro define @var{macro} @var{replacement-list}
+@itemx macro define @var{macro}(@var{arglist}) @var{replacement-list}
+@i{(This command is not yet implemented.)}  Introduce a definition for a
+preprocessor macro named @var{macro}, invocations of which are replaced
+by the tokens given in @var{replacement-list}.  The first form of this
+command defines an ``object-like'' macro, which takes no arguments; the
+second form defines a ``function-like'' macro, which takes the arguments
+given in @var{arglist}.
+
+A definition introduced by this command is in scope in every expression
+evaluated in @value{GDBN}, until it is removed with the @command{macro
+undef} command, described below.  The definition overrides all
+definitions for @var{macro} present in the program being debugged, as
+well as any previous user-supplied definition.
+
+@kindex macro undef
+@item macro undef @var{macro}
+@i{(This command is not yet implemented.)}  Remove any user-supplied
+definition for the macro named @var{macro}.  This command only affects
+definitions provided with the @command{macro define} command, described
+above; it cannot remove definitions present in the program being
+debugged.
+
+@end table
+
+@cindex macros, example of debugging with
+Here is a transcript showing the above commands in action.  First, we
+show our source files:
+
+@smallexample
+$ cat sample.c
+#include <stdio.h>
+#include "sample.h"
+
+#define M 42
+#define ADD(x) (M + x)
+
+main ()
+@{
+#define N 28
+  printf ("Hello, world!\n");
+#undef N
+  printf ("We're so creative.\n");
+#define N 1729
+  printf ("Goodbye, world!\n");
+@}
+$ cat sample.h
+#define Q <
+$
+@end smallexample
+
+Now, we compile the program using the @sc{gnu} C compiler, @value{NGCC}.
+We pass the @option{-gdwarf-2} and @option{-g3} flags to ensure the
+compiler includes information about preprocessor macros in the debugging
+information.
+
+@smallexample
+$ gcc -gdwarf-2 -g3 sample.c -o sample
+$
+@end smallexample
+
+Now, we start @value{GDBN} on our sample program:
+
+@smallexample
+$ gdb -nw sample
+GNU gdb 2002-05-06-cvs
+Copyright 2002 Free Software Foundation, Inc.
+GDB is free software, @dots{}
+(gdb)
+@end smallexample
+
+We can expand macros and examine their definitions, even when the
+program is not running.  @value{GDBN} uses the current listing position
+to decide which macro definitions are in scope:
+
+@smallexample
+(gdb) list main
+3
+4       #define M 42
+5       #define ADD(x) (M + x)
+6
+7       main ()
+8       @{
+9       #define N 28
+10        printf ("Hello, world!\n");
+11      #undef N
+12        printf ("We're so creative.\n");
+(gdb) info macro ADD
+Defined at /home/jimb/gdb/macros/play/sample.c:5
+#define ADD(x) (M + x)
+(gdb) info macro Q
+Defined at /home/jimb/gdb/macros/play/sample.h:1
+  included at /home/jimb/gdb/macros/play/sample.c:2
+#define Q <
+(gdb) macro expand ADD(1)
+expands to: (42 + 1)
+(gdb) macro expand-once ADD(1)
+expands to: once (M + 1)
+(gdb) 
+@end smallexample
+
+In the example above, note that @command{macro expand-once} expands only
+the macro invocation explicit in the original text --- the invocation of
+@code{ADD} --- but does not expand the invocation of the macro @code{M},
+which was introduced by @code{ADD}.
+
+Once the program is running, GDB uses the macro definitions in force at
+the source line of the current stack frame:
+
+@smallexample
+(gdb) break main
+Breakpoint 1 at 0x8048370: file sample.c, line 10.
+(gdb) run
+Starting program: /home/jimb/gdb/macros/play/sample 
+
+Breakpoint 1, main () at sample.c:10
+10        printf ("Hello, world!\n");
+(gdb) 
+@end smallexample
+
+At line 10, the definition of the macro @code{N} at line 9 is in force:
+
+@smallexample
+(gdb) info macro N
+Defined at /home/jimb/gdb/macros/play/sample.c:9
+#define N 28
+(gdb) macro expand N Q M
+expands to: 28 < 42
+(gdb) print N Q M
+$1 = 1
+(gdb) 
+@end smallexample
+
+As we step over directives that remove @code{N}'s definition, and then
+give it a new definition, @value{GDBN} finds the definition (or lack
+thereof) in force at each point:
+
+@smallexample
+(gdb) next
+Hello, world!
+12        printf ("We're so creative.\n");
+(gdb) info macro N
+The symbol `N' has no definition as a C/C++ preprocessor macro
+at /home/jimb/gdb/macros/play/sample.c:12
+(gdb) next
+We're so creative.
+14        printf ("Goodbye, world!\n");
+(gdb) info macro N
+Defined at /home/jimb/gdb/macros/play/sample.c:13
+#define N 1729
+(gdb) macro expand N Q M
+expands to: 1729 < 42
+(gdb) print N Q M
+$2 = 0
+(gdb) 
+@end smallexample
+
+
 @node Tracepoints
 @chapter Tracepoints
 @c This chapter is based on the documentation written by Michael
@@ -6362,44 +6681,48 @@ overlay's machine code from the large memory into the space set aside
 for it in the instruction memory, and then jump to its entry point
 there.
 
-@example
+@c NB:  In the below the mapped area's size is greater or equal to the
+@c size of all overlays.  This is intentional to remind the developer
+@c that overlays don't necessarily need to be the same size.
+
+@smallexample
 @group
-    Data                   Instruction            Larger
-Address Space             Address Space        Address Space
-+-----------+             +-----------+        +-----------+
-|           |             |           |        |           |
-+-----------+             +-----------+        +-----------+<-- overlay 1
-| program   |             |   main    |        |           | load address
-| variables |             |  program  |        | overlay 1 |
-| and heap  |             |           |    ,---|           |
-+-----------+             |           |    |   |           |
-|           |             +-----------+    |   +-----------+
-+-----------+             |           |    |   |           |
-               mapped --->+-----------+    /   +-----------+<-- overlay 2
-               address    |  overlay  | <-'    | overlay 2 | load address
-                          |   area    |  <-----|           |
-                          |           | <---.  +-----------+
-                          |           |     |  |           |
-                          +-----------+     |  |           |
-                          |           |     |  +-----------+<-- overlay 3
-                          +-----------+     `--|           | load address
-                                               | overlay 3 |
-                                               |           |
-                                               +-----------+
-                                               |           |
-                                               +-----------+
-
-    To map an overlay, copy its code from the larger address space
-    to the instruction address space.  Since the overlays shown here
-    all use the same mapped address, only one may be mapped at a time.
+    Data             Instruction            Larger
+Address Space       Address Space        Address Space
++-----------+       +-----------+        +-----------+
+|           |       |           |        |           |
++-----------+       +-----------+        +-----------+<-- overlay 1
+| program   |       |   main    |   .----| overlay 1 | load address
+| variables |       |  program  |   |    +-----------+
+| and heap  |       |           |   |    |           |
++-----------+       |           |   |    +-----------+<-- overlay 2
+|           |       +-----------+   |    |           | load address
++-----------+       |           |   |  .-| overlay 2 |
+                    |           |   |  | |           |
+         mapped --->+-----------+   |  | +-----------+
+         address    |           |   |  | |           |
+                    |  overlay  | <-'  | |           |
+                    |   area    |  <---' +-----------+<-- overlay 3
+                    |           | <---.  |           | load address
+                    +-----------+     `--| overlay 3 |
+                    |           |        |           |
+                    +-----------+        |           |
+                                         +-----------+
+                                         |           |
+                                         +-----------+
+
+                    @anchor{A code overlay}A code overlay
 @end group
-@end example
+@end smallexample
 
-This diagram shows a system with separate data and instruction address
-spaces.  For a system with a single address space for data and
-instructions, the diagram would be similar, except that the program
-variables and heap would share an address space with the main program
-and the overlay area.
+The diagram (@pxref{A code overlay}) shows a system with separate data
+and instruction address spaces.  To map an overlay, the program copies
+its code from the larger address space to the instruction address space.
+Since the overlays shown here all use the same mapped address, only one
+may be mapped at a time.  For a system with a single address space for
+data and instructions, the diagram would be similar, except that the
+program variables and heap would share an address space with the main
+program and the overlay area.
 
 An overlay loaded into instruction memory and ready for use is called a
 @dfn{mapped} overlay; its @dfn{mapped address} is its address in the
@@ -6547,33 +6870,33 @@ addresses, load addresses, and sizes.
 Normally, when @value{GDBN} prints a code address, it includes the name
 of the function the address falls in:
 
-@example
+@smallexample
 (gdb) print main
 $3 = @{int ()@} 0x11a0 <main>
-@end example
+@end smallexample
 @noindent
 When overlay debugging is enabled, @value{GDBN} recognizes code in
 unmapped overlays, and prints the names of unmapped functions with
 asterisks around them.  For example, if @code{foo} is a function in an
 unmapped overlay, @value{GDBN} prints it this way:
 
-@example
+@smallexample
 (gdb) overlay list
 No sections are mapped.
 (gdb) print foo
 $5 = @{int (int)@} 0x100000 <*foo*>
-@end example
+@end smallexample
 @noindent
 When @code{foo}'s overlay is mapped, @value{GDBN} prints the function's
 name normally:
 
-@example
+@smallexample
 (gdb) overlay list
 Section .ov.foo.text, loaded at 0x100000 - 0x100034, 
         mapped at 0x1016 - 0x104a
 (gdb) print foo
 $6 = @{int (int)@} 0x1016 <foo>
-@end example
+@end smallexample
 
 When overlay debugging is enabled, @value{GDBN} can find the correct
 address for functions and variables in an overlay, whether or not the
@@ -6615,7 +6938,7 @@ Here are the variables your overlay manager must define to support
 @item @code{_ovly_table}:
 This variable must be an array of the following structures:
 
-@example
+@smallexample
 struct
 @{
   /* The overlay's mapped address.  */
@@ -6631,7 +6954,7 @@ struct
      zero otherwise.  */
   unsigned long mapped;
 @}
-@end example
+@end smallexample
 
 @item @code{_novlys}:
 This variable must be a four-byte signed integer, holding the total
@@ -6646,6 +6969,15 @@ executable file.  When @value{GDBN} finds a matching entry, it consults
 the entry's @code{mapped} member to determine whether the overlay is
 currently mapped.
 
+In addition, your overlay manager may define a function called
+@code{_ovly_debug_event}.  If this function is defined, @value{GDBN}
+will silently set a breakpoint there.  If the overlay manager then
+calls this function whenever it has changed the overlay table, this
+will enable @value{GDBN} to accurately keep track of which overlays
+are in program memory, and update any breakpoints that may be set
+in overlays.  This will allow breakpoints to work even if the 
+overlays are kept in ROM or other non-writable memory while they
+are not being executed.
 
 @node Overlay Sample Program
 @section Overlay Sample Program
@@ -6683,7 +7015,7 @@ and @code{m32r-elf} targets.
 You can build the test program using the @code{d10v-elf} GCC
 cross-compiler like this:
 
-@example
+@smallexample
 $ d10v-elf-gcc -g -c overlays.c
 $ d10v-elf-gcc -g -c ovlymgr.c
 $ d10v-elf-gcc -g -c foo.c
@@ -6692,7 +7024,7 @@ $ d10v-elf-gcc -g -c baz.c
 $ d10v-elf-gcc -g -c grbx.c
 $ d10v-elf-gcc -g overlays.o ovlymgr.o foo.o bar.o \
                   baz.o grbx.o -Wl,-Td10v.ld -o overlays
-@end example
+@end smallexample
 
 The build process is identical for any other architecture, except that
 you must substitute the appropriate compiler and linker script for the
@@ -6821,9 +7153,9 @@ languages---but means different things.  For instance, if the current
 source file were written in C, and @value{GDBN} was parsing Modula-2, a
 command such as:
 
-@example
+@smallexample
 print a = b + c
-@end example
+@end smallexample
 
 @noindent
 might not have the effect you intended.  In C, this means to add
@@ -7017,9 +7349,9 @@ error.  In many implementations of C, mathematical overflow causes the
 result to ``wrap around'' to lower values---for example, if @var{m} is
 the largest integer value, and @var{s} is the smallest, then
 
-@example
+@smallexample
 @var{m} + 1 @result{} @var{s}
-@end example
+@end smallexample
 
 This, too, is specific to individual languages, and in some cases
 specific to individual compilers or machines.  @xref{Support, ,
@@ -7286,8 +7618,8 @@ following ways:
 @itemize @bullet
 @item
 Integer constants are a sequence of digits.  Octal constants are
-specified by a leading @samp{0} (i.e. zero), and hexadecimal constants by
-a leading @samp{0x} or @samp{0X}.  Constants may also end with a letter
+specified by a leading @samp{0} (i.e.@: zero), and hexadecimal constants
+by a leading @samp{0x} or @samp{0X}.  Constants may also end with a letter
 @samp{l}, specifying that the constant should be treated as a
 @code{long} value.
 
@@ -7379,9 +7711,9 @@ support in @value{GDBN} does @emph{not} work.
 @item
 Member function calls are allowed; you can use expressions like
 
-@example
+@smallexample
 count = aml->GetOriginal(x, y)
-@end example
+@end smallexample
 
 @vindex this@r{, inside C@t{++} member functions}
 @cindex namespace in C@t{++}
@@ -7999,11 +8331,11 @@ There are a few subtle differences between the Modula-2 scope operator
 (@code{.}) and the @value{GDBN} scope operator (@code{::}).  The two have
 similar syntax:
 
-@example
+@smallexample
 
 @var{module} . @var{id}
 @var{scope} :: @var{id}
-@end example
+@end smallexample
 
 @noindent
 where @var{scope} is the name of a module or a procedure,
@@ -8565,9 +8897,9 @@ ordinarily parse a typical file name, like @file{foo.c}, as the three words
 @samp{foo} @samp{.} @samp{c}.  To allow @value{GDBN} to recognize
 @samp{foo.c} as a single symbol, enclose it in single quotes; for example,
 
-@example
+@smallexample
 p 'foo.c'::x
-@end example
+@end smallexample
 
 @noindent
 looks up the value of @code{x} in the scope of the file @file{foo.c}.
@@ -8592,10 +8924,10 @@ Print the name of a symbol which is stored at the address @var{addr}.
 If no symbol is stored exactly at @var{addr}, @value{GDBN} prints the
 nearest symbol and an offset from it:
 
-@example
+@smallexample
 (@value{GDBP}) info symbol 0x54320
 _initialize_vx + 396 in section .text
-@end example
+@end smallexample
 
 @noindent
 This is the opposite of the @code{info address} command.  You can use
@@ -8626,14 +8958,14 @@ of just the name of the type.
 
 For example, for this variable declaration:
 
-@example
+@smallexample
 struct complex @{double real; double imag;@} v;
-@end example
+@end smallexample
 
 @noindent
 the two commands give this output:
 
-@example
+@smallexample
 @group
 (@value{GDBP}) whatis v
 type = struct complex
@@ -8643,7 +8975,7 @@ type = struct complex @{
     double imag;
 @}
 @end group
-@end example
+@end smallexample
 
 @noindent
 As with @code{whatis}, using @code{ptype} without an argument refers to
@@ -8690,9 +9022,25 @@ collect}.
 
 @kindex info source
 @item info source
-Show the name of the current source file---that is, the source file for
-the function containing the current point of execution---and the language
-it was written in.
+Show information about the current source file---that is, the source file for
+the function containing the current point of execution:
+@itemize @bullet
+@item
+the name of the source file, and the directory containing it,
+@item
+the directory it was compiled in,
+@item
+its length, in lines,
+@item
+which programming language it is written in,
+@item
+whether the executable includes debugging information for that file, and
+if so, what format the information is in (e.g., STABS, Dwarf 2, etc.), and
+@item
+whether the debugging information includes information about
+preprocessor macros.
+@end itemize
+
 
 @kindex info sources
 @item info sources
@@ -8716,7 +9064,7 @@ that conflict with the regular expression language (eg.
 @kindex info variables
 @item info variables
 Print the names and data types of all variables that are declared
-outside of functions (i.e., excluding local variables).
+outside of functions (i.e.@: excluding local variables).
 
 @item info variables @var{regexp}
 Print the names and data types of all variables (except for local
@@ -8839,9 +9187,9 @@ address, or even return prematurely from a function.
 To alter the value of a variable, evaluate an assignment expression.
 @xref{Expressions, ,Expressions}.  For example,
 
-@example
+@smallexample
 print x=4
-@end example
+@end smallexample
 
 @noindent
 stores the value 4 into the variable @code{x}, and then prints the
@@ -8865,22 +9213,22 @@ program has a variable @code{width}, you get an error if you try to set
 a new value with just @samp{set width=13}, because @value{GDBN} has the
 command @code{set width}:
 
-@example
+@smallexample
 (@value{GDBP}) whatis width
 type = double
 (@value{GDBP}) p width
 $4 = 13
 (@value{GDBP}) set width=47
 Invalid syntax in expression.
-@end example
+@end smallexample
 
 @noindent
 The invalid expression, of course, is @samp{=47}.  In
 order to actually set the program's variable @code{width}, use
 
-@example
+@smallexample
 (@value{GDBP}) set var width=47
-@end example
+@end smallexample
 
 Because the @code{set} command has many subcommands that can conflict
 with the names of program variables, it is a good idea to use the
@@ -8889,7 +9237,7 @@ your program has a variable @code{g}, you run into problems if you try
 to set a new value with just @samp{set g=4}, because @value{GDBN} has
 the command @code{set gnutarget}, abbreviated @code{set g}:
 
-@example
+@smallexample
 @group
 (@value{GDBP}) whatis g
 type = double
@@ -8907,16 +9255,16 @@ Starting program: /home/smith/cc_progs/a.out
 (@value{GDBP}) show g
 The current BFD target is "=4".
 @end group
-@end example
+@end smallexample
 
 @noindent
 The program variable @code{g} did not change, and you silently set the
 @code{gnutarget} to an invalid value.  In order to set the variable
 @code{g}, use
 
-@example
+@smallexample
 (@value{GDBP}) set var g=4
-@end example
+@end smallexample
 
 @value{GDBN} allows more implicit conversions in assignments than C; you can
 freely store an integer value into a pointer variable or vice versa,
@@ -8931,9 +9279,9 @@ construct to generate a value of specified type at a specified address
 to memory location @code{0x83040} as an integer (which implies a certain size
 and representation in memory), and
 
-@example
+@smallexample
 set @{int@}0x83040 = 4
-@end example
+@end smallexample
 
 @noindent
 stores the value 4 into that memory location.
@@ -8976,9 +9324,9 @@ difference is that this does not start your program running; it only
 changes the address of where it @emph{will} run when you continue.  For
 example,
 
-@example
+@smallexample
 set $pc = 0x485
-@end example
+@end smallexample
 
 @noindent
 makes the next @code{continue} command or stepping command execute at
@@ -9067,12 +9415,6 @@ execute a function from your program, but without cluttering the output
 with @code{void} returned values.  If the result is not void, it
 is printed and saved in the value history.
 
-@c OBSOLETE For the A29K, a user-controlled variable @code{call_scratch_address},
-@c OBSOLETE specifies the location of a scratch area to be used when @value{GDBN}
-@c OBSOLETE calls a function in the target.  This is necessary because the usual
-@c OBSOLETE method of putting the scratch area on the stack does not work in systems
-@c OBSOLETE that have separate instruction and data spaces.
-
 @node Patching
 @section Patching programs
 
@@ -9410,6 +9752,21 @@ COFF shared library information.
 Section contains common symbols.
 @end table
 @end table
+@kindex set trust-readonly-sections
+@item set trust-readonly-sections on
+Tell @value{GDBN} that readonly sections in your object file
+really are read-only (i.e.@: that their contents will not change).
+In that case, @value{GDBN} can fetch values from these sections
+out of the object file, rather than from the target program.
+For some targets (notably embedded ones), this can be a significant
+enhancement to debugging performance.
+
+The default is off.
+
+@item set trust-readonly-sections off
+Tell @value{GDBN} not to trust readonly sections.  This means that
+the contents of the section might change while the program is running,
+and must therefore be fetched from the target when needed.
 @end table
 
 All file-specifying commands allow both absolute and relative file names
@@ -9499,7 +9856,7 @@ If @var{threshold} is nonzero and shared library autoloading is enabled,
 symbols from all shared object libraries will be loaded until the total
 size of the loaded shared library symbols exceeds this threshold.
 Otherwise, symbols must be loaded manually, using the
-@code{sharedlibrary} command.  The default threshold is 100 (i.e. 100
+@code{sharedlibrary} command.  The default threshold is 100 (i.e.@: 100
 Mb).
 
 @kindex show auto-solib-limit
@@ -9735,11 +10092,11 @@ it somewhere in memory where it won't get clobbered by the download.
 @item target sim
 Builtin CPU simulator.  @value{GDBN} includes simulators for most architectures.
 In general,
-@example
+@smallexample
         target sim
         load
         run
-@end example
+@end smallexample
 @noindent
 works; however, you cannot assume that a specific memory map, device
 drivers, or even basic I/O is available, although some simulators do
@@ -9861,21 +10218,21 @@ displayed is determined on a per-OS basis.
 Use the @code{set os} command to set the operating system.  This tells
 @value{GDBN} which kernel object display module to initialize:
 
-@example
+@smallexample
 (@value{GDBP}) set os cisco
-@end example
+@end smallexample
 
 If @code{set os} succeeds, @value{GDBN} will display some information
 about the operating system, and will create a new @code{info} command
 which can be used to query the target.  The @code{info} command is named
 after the operating system:
 
-@example
+@smallexample
 (@value{GDBP}) info cisco
 List of Cisco Kernel Objects
 Object     Description
 any        Any and all objects
-@end example
+@end smallexample
 
 Further subcommands can be used to query about particular objects known
 by the kernel.
@@ -9928,7 +10285,7 @@ strip the program if necessary to save space.  @value{GDBN} on the host
 system does all the symbol handling.
 
 To use the server, you must tell it how to communicate with @value{GDBN};
-the name of your program; and the arguments for your program.  The
+the name of your program; and the arguments for your program.  The usual
 syntax is:
 
 @smallexample
@@ -9965,6 +10322,16 @@ conflicts with another service, @code{gdbserver} prints an error message
 and exits.}  You must use the same port number with the host @value{GDBN}
 @code{target remote} command.
 
+On some targets, @code{gdbserver} can also attach to running programs.
+This is accomplished via the @code{--attach} argument.  The syntax is:
+
+@smallexample
+target> gdbserver @var{comm} --attach @var{pid}
+@end smallexample
+
+@var{pid} is the process ID of a currently running process.  It isn't necessary
+to point @code{gdbserver} at a binary for the running process.
+
 @item On the @value{GDBN} host machine,
 you need an unstripped copy of your program, since @value{GDBN} needs
 symbols and debugging information.  Start up @value{GDBN} as usual,
@@ -10319,18 +10686,18 @@ Make sure you have defined the supporting low-level routines
 @item
 Insert these lines near the top of your program:
 
-@example
+@smallexample
 set_debug_traps();
 breakpoint();
-@end example
+@end smallexample
 
 @item
 For the 680x0 stub only, you need to provide a variable called
 @code{exceptionHook}.  Normally you just use:
 
-@example
+@smallexample
 void (*exceptionHook)() = 0;
-@end example
+@end smallexample
 
 @noindent
 but if before calling @code{set_debug_traps}, you set it to point to a
@@ -10364,34 +10731,50 @@ of its pure text.
 Establish communication using the @code{target remote} command.
 Its argument specifies how to communicate with the target
 machine---either via a devicename attached to a direct serial line, or a
-TCP port (usually to a terminal server which in turn has a serial line
+TCP or UDP port (usually to a terminal server which in turn has a serial line
 to the target).  For example, to use a serial line connected to the
 device named @file{/dev/ttyb}:
 
-@example
+@smallexample
 target remote /dev/ttyb
-@end example
+@end smallexample
 
 @cindex TCP port, @code{target remote}
 To use a TCP connection, use an argument of the form
-@code{@var{host}:port}.  For example, to connect to port 2828 on a
+@code{@var{host}:@var{port}} or @code{tcp:@var{host}:@var{port}}.
+For example, to connect to port 2828 on a
 terminal server named @code{manyfarms}:
 
-@example
+@smallexample
 target remote manyfarms:2828
-@end example
+@end smallexample
 
 If your remote target is actually running on the same machine as
 your debugger session (e.g.@: a simulator of your target running on
 the same host), you can omit the hostname.  For example, to connect
 to port 1234 on your local machine:
 
-@example
+@smallexample
 target remote :1234
-@end example
+@end smallexample
 @noindent
 
 Note that the colon is still required here.
+
+@cindex UDP port, @code{target remote}
+To use a UDP connection, use an argument of the form
+@code{udp:@var{host}:@var{port}}.  For example, to connect to UDP port 2828
+on a terminal server named @code{manyfarms}:
+
+@smallexample
+target remote udp:manyfarms:2828
+@end smallexample
+
+When using a UDP connection for remote debugging, you should keep in mind
+that the `U' stands for ``Unreliable''.  UDP can silently drop packets on
+busy or unreliable networks, which will cause havoc with your debugging
+session.
+
 @end enumerate
 
 Now you can use all the usual commands to examine and change data and to
@@ -10408,10 +10791,10 @@ program.  This may or may not succeed, depending in part on the hardware
 and the serial drivers the remote system uses.  If you type the
 interrupt character once again, @value{GDBN} displays this prompt:
 
-@example
+@smallexample
 Interrupted while waiting for the program.
 Give up (and stop debugging it)?  (y or n)
-@end example
+@end smallexample
 
 If you type @kbd{y}, @value{GDBN} abandons the remote debugging session.
 (If you decide you want to try again later, you can use @samp{target
@@ -10449,6 +10832,7 @@ configurations.
 * HP-UX::                       HP-UX
 * SVR4 Process Information::    SVR4 process information
 * DJGPP Native::                Features specific to the DJGPP port
+* Cygwin Native::              Features specific to the Cygwin port
 @end menu
 
 @node HP-UX
@@ -10647,6 +11031,92 @@ mapped 1:1, i.e.@: the physical and linear addresses are identical.
 This command is supported only with some DPMI servers.
 @end table
 
+@node Cygwin Native
+@subsection Features for Debugging MS Windows PE executables
+@cindex MS Windows debugging
+@cindex native Cygwin debugging
+@cindex Cygwin-specific commands
+
+@value{GDBN} supports native debugging of MS Windows programs, and
+defines a few commands specific to the Cygwin port.  This
+subsection describes those commands.
+
+@table @code
+@kindex info w32
+@item info w32
+This is a prefix of MS Windows specific commands which print
+information about the target system and important OS structures.
+
+@item info w32 selector
+This command displays information returned by
+the Win32 API @code{GetThreadSelectorEntry} function.
+It takes an optional argument that is evaluated to
+a long value to give the information about this given selector.
+Without argument, this command displays information
+about the the six segment registers.
+
+@kindex info dll
+@item info dll
+This is a Cygwin specific alias of info shared.
+
+@kindex dll-symbols
+@item dll-symbols
+This command loads symbols from a dll similarly to
+add-sym command but without the need to specify a base address.
+
+@kindex set new-console 
+@item set new-console @var{mode}
+If @var{mode} is @code{on} the debuggee will 
+be started in a new console on next start.
+If @var{mode} is @code{off}i, the debuggee will
+be started in the same console as the debugger.
+
+@kindex show new-console
+@item show new-console
+Displays whether a new console is used
+when the debuggee is started.
+
+@kindex set new-group
+@item set new-group @var{mode}
+This boolean value controls whether the debuggee should
+start a new group or stay in the same group as the debugger.
+This affects the way the Windows OS handles
+Ctrl-C.
+
+@kindex show new-group
+@item show new-group
+Displays current value of new-group boolean.
+
+@kindex set debugevents
+@item set debugevents
+This boolean value adds debug output concerning events seen by the debugger.
+
+@kindex set debugexec
+@item set debugexec
+This boolean value adds debug output concerning execute events 
+seen by the debugger.
+
+@kindex set debugexceptions
+@item set debugexceptions
+This boolean value adds debug ouptut concerning exception events 
+seen by the debugger.
+
+@kindex set debugmemory
+@item set debugmemory
+This boolean value adds debug ouptut concerning memory events 
+seen by the debugger.
+
+@kindex set shell
+@item set shell
+This boolean values specifies whether the debuggee is called
+via a shell or directly (default value is on).
+
+@kindex show shell
+@item show shell
+Displays if the debuggee will be started with a shell.
+
+@end table
+
 @node Embedded OS
 @section Embedded Operating Systems
 
@@ -10718,9 +11188,9 @@ run @value{GDBN}.  From your Unix host, run @code{@value{GDBP}} (or
 
 @value{GDBN} comes up showing the prompt:
 
-@example
+@smallexample
 (vxgdb)
-@end example
+@end smallexample
 
 @menu
 * VxWorks Connection::          Connecting to VxWorks
@@ -10734,9 +11204,9 @@ run @value{GDBN}.  From your Unix host, run @code{@value{GDBP}} (or
 The @value{GDBN} command @code{target} lets you connect to a VxWorks target on the
 network.  To connect to a target whose host name is ``@code{tt}'', type:
 
-@example
+@smallexample
 (vxgdb) target vxworks tt
-@end example
+@end smallexample
 
 @need 750
 @value{GDBN} displays messages like these:
@@ -10753,9 +11223,9 @@ these files by searching the directories listed in the command search
 path (@pxref{Environment, ,Your program's environment}); if it fails
 to find an object file, it displays a message such as:
 
-@example
+@smallexample
 prog.o: No such file or directory.
-@end example
+@end smallexample
 
 When this happens, add the appropriate directory to the search path with
 the @value{GDBN} command @code{path}, and execute the @code{target}
@@ -10781,17 +11251,17 @@ the file by its name, without any path.  For instance, a program
 and in @file{@var{hostpath}/vw/demo/rdb} on the host.  To load this
 program, type this on VxWorks:
 
-@example
+@smallexample
 -> cd "@var{vxpath}/vw/demo/rdb"
-@end example
+@end smallexample
 
 @noindent
 Then, in @value{GDBN}, type:
 
-@example
+@smallexample
 (vxgdb) cd @var{hostpath}/vw/demo/rdb
 (vxgdb) load prog.o
-@end example
+@end smallexample
 
 @value{GDBN} displays a response similar to this:
 
@@ -10814,9 +11284,9 @@ table.)
 You can also attach to an existing task using the @code{attach} command as
 follows:
 
-@example
+@smallexample
 (vxgdb) attach @var{task}
-@end example
+@end smallexample
 
 @noindent
 where @var{task} is the VxWorks hexadecimal task ID.  The task can be running
@@ -10830,7 +11300,6 @@ This section goes into details specific to particular embedded
 configurations.
 
 
-@c OBSOLETE * A29K Embedded::               AMD A29K Embedded
 @menu
 * ARM::                         ARM
 * H8/300::                      Hitachi H8/300
@@ -10838,7 +11307,7 @@ configurations.
 * i960::                        Intel i960
 * M32R/D::                      Mitsubishi M32R/D
 * M68K::                        Motorola M68K
-* M88K::                        Motorola M88K
+@c OBSOLETE * M88K::                        Motorola M88K
 * MIPS Embedded::               MIPS Embedded
 * PA::                          HP PA Embedded
 * PowerPC:                      PowerPC
@@ -10849,251 +11318,6 @@ configurations.
 * Z8000::                       Zilog Z8000
 @end menu
 
-@c OBSOLETE @node A29K Embedded
-@c OBSOLETE @subsection AMD A29K Embedded
-@c OBSOLETE 
-@c OBSOLETE @menu
-@c OBSOLETE * A29K UDI::
-@c OBSOLETE * A29K EB29K::
-@c OBSOLETE * Comms (EB29K)::               Communications setup
-@c OBSOLETE * gdb-EB29K::                   EB29K cross-debugging
-@c OBSOLETE * Remote Log::                  Remote log
-@c OBSOLETE @end menu
-@c OBSOLETE 
-@c OBSOLETE @table @code
-@c OBSOLETE 
-@c OBSOLETE @kindex target adapt
-@c OBSOLETE @item target adapt @var{dev}
-@c OBSOLETE Adapt monitor for A29K.
-@c OBSOLETE 
-@c OBSOLETE @kindex target amd-eb
-@c OBSOLETE @item target amd-eb @var{dev} @var{speed} @var{PROG}
-@c OBSOLETE @cindex AMD EB29K
-@c OBSOLETE Remote PC-resident AMD EB29K board, attached over serial lines.
-@c OBSOLETE @var{dev} is the serial device, as for @code{target remote};
-@c OBSOLETE @var{speed} allows you to specify the linespeed; and @var{PROG} is the
-@c OBSOLETE name of the program to be debugged, as it appears to DOS on the PC.
-@c OBSOLETE @xref{A29K EB29K, ,EBMON protocol for AMD29K}.
-@c OBSOLETE 
-@c OBSOLETE @end table
-@c OBSOLETE 
-@c OBSOLETE @node A29K UDI
-@c OBSOLETE @subsubsection A29K UDI
-@c OBSOLETE 
-@c OBSOLETE @cindex UDI
-@c OBSOLETE @cindex AMD29K via UDI
-@c OBSOLETE 
-@c OBSOLETE @value{GDBN} supports AMD's UDI (``Universal Debugger Interface'')
-@c OBSOLETE protocol for debugging the a29k processor family.  To use this
-@c OBSOLETE configuration with AMD targets running the MiniMON monitor, you need the
-@c OBSOLETE program @code{MONTIP}, available from AMD at no charge.  You can also
-@c OBSOLETE use @value{GDBN} with the UDI-conformant a29k simulator program
-@c OBSOLETE @code{ISSTIP}, also available from AMD.
-@c OBSOLETE 
-@c OBSOLETE @table @code
-@c OBSOLETE @item target udi @var{keyword}
-@c OBSOLETE @kindex udi
-@c OBSOLETE Select the UDI interface to a remote a29k board or simulator, where
-@c OBSOLETE @var{keyword} is an entry in the AMD configuration file @file{udi_soc}.
-@c OBSOLETE This file contains keyword entries which specify parameters used to
-@c OBSOLETE connect to a29k targets.  If the @file{udi_soc} file is not in your
-@c OBSOLETE working directory, you must set the environment variable @samp{UDICONF}
-@c OBSOLETE to its pathname.
-@c OBSOLETE @end table
-@c OBSOLETE 
-@c OBSOLETE @node A29K EB29K
-@c OBSOLETE @subsubsection EBMON protocol for AMD29K
-@c OBSOLETE 
-@c OBSOLETE @cindex EB29K board
-@c OBSOLETE @cindex running 29K programs
-@c OBSOLETE 
-@c OBSOLETE AMD distributes a 29K development board meant to fit in a PC, together
-@c OBSOLETE with a DOS-hosted monitor program called @code{EBMON}.  As a shorthand
-@c OBSOLETE term, this development system is called the ``EB29K''.  To use
-@c OBSOLETE @value{GDBN} from a Unix system to run programs on the EB29K board, you
-@c OBSOLETE must first connect a serial cable between the PC (which hosts the EB29K
-@c OBSOLETE board) and a serial port on the Unix system.  In the following, we
-@c OBSOLETE assume you've hooked the cable between the PC's @file{COM1} port and
-@c OBSOLETE @file{/dev/ttya} on the Unix system.
-@c OBSOLETE 
-@c OBSOLETE @node Comms (EB29K)
-@c OBSOLETE @subsubsection Communications setup
-@c OBSOLETE 
-@c OBSOLETE The next step is to set up the PC's port, by doing something like this
-@c OBSOLETE in DOS on the PC:
-@c OBSOLETE 
-@c OBSOLETE @example
-@c OBSOLETE C:\> MODE com1:9600,n,8,1,none
-@c OBSOLETE @end example
-@c OBSOLETE 
-@c OBSOLETE @noindent
-@c OBSOLETE This example---run on an MS DOS 4.0 system---sets the PC port to 9600
-@c OBSOLETE bps, no parity, eight data bits, one stop bit, and no ``retry'' action;
-@c OBSOLETE you must match the communications parameters when establishing the Unix
-@c OBSOLETE end of the connection as well.
-@c OBSOLETE @c FIXME: Who knows what this "no retry action" crud from the DOS manual may
-@c OBSOLETE @c       mean?  It's optional; leave it out? ---doc@cygnus.com, 25feb91
-@c OBSOLETE @c
-@c OBSOLETE @c It's optional, but it's unwise to omit it: who knows what is the
-@c OBSOLETE @c default value set when the DOS machines boots?  "No retry" means that
-@c OBSOLETE @c the DOS serial device driver won't retry the operation if it fails;
-@c OBSOLETE @c I understand that this is needed because the GDB serial protocol
-@c OBSOLETE @c handles any errors and retransmissions itself. ---Eli Zaretskii, 3sep99
-@c OBSOLETE 
-@c OBSOLETE To give control of the PC to the Unix side of the serial line, type
-@c OBSOLETE the following at the DOS console:
-@c OBSOLETE 
-@c OBSOLETE @example
-@c OBSOLETE C:\> CTTY com1
-@c OBSOLETE @end example
-@c OBSOLETE 
-@c OBSOLETE @noindent
-@c OBSOLETE (Later, if you wish to return control to the DOS console, you can use
-@c OBSOLETE the command @code{CTTY con}---but you must send it over the device that
-@c OBSOLETE had control, in our example over the @file{COM1} serial line.)
-@c OBSOLETE 
-@c OBSOLETE From the Unix host, use a communications program such as @code{tip} or
-@c OBSOLETE @code{cu} to communicate with the PC; for example,
-@c OBSOLETE 
-@c OBSOLETE @example
-@c OBSOLETE cu -s 9600 -l /dev/ttya
-@c OBSOLETE @end example
-@c OBSOLETE 
-@c OBSOLETE @noindent
-@c OBSOLETE The @code{cu} options shown specify, respectively, the linespeed and the
-@c OBSOLETE serial port to use.  If you use @code{tip} instead, your command line
-@c OBSOLETE may look something like the following:
-@c OBSOLETE 
-@c OBSOLETE @example
-@c OBSOLETE tip -9600 /dev/ttya
-@c OBSOLETE @end example
-@c OBSOLETE 
-@c OBSOLETE @noindent
-@c OBSOLETE Your system may require a different name where we show
-@c OBSOLETE @file{/dev/ttya} as the argument to @code{tip}.  The communications
-@c OBSOLETE parameters, including which port to use, are associated with the
-@c OBSOLETE @code{tip} argument in the ``remote'' descriptions file---normally the
-@c OBSOLETE system table @file{/etc/remote}.
-@c OBSOLETE @c FIXME: What if anything needs doing to match the "n,8,1,none" part of
-@c OBSOLETE @c the DOS side's comms setup?  cu can support -o (odd
-@c OBSOLETE @c parity), -e (even parity)---apparently no settings for no parity or
-@c OBSOLETE @c for character size.  Taken from stty maybe...?  John points out tip
-@c OBSOLETE @c can set these as internal variables, eg ~s parity=none; man stty
-@c OBSOLETE @c suggests that it *might* work to stty these options with stdin or
-@c OBSOLETE @c stdout redirected... ---doc@cygnus.com, 25feb91
-@c OBSOLETE @c
-@c OBSOLETE @c There's nothing to be done for the "none" part of the DOS MODE
-@c OBSOLETE @c command.  The rest of the parameters should be matched by the
-@c OBSOLETE @c baudrate, bits, and parity used by the Unix side. ---Eli Zaretskii, 3Sep99
-@c OBSOLETE 
-@c OBSOLETE @kindex EBMON
-@c OBSOLETE Using the @code{tip} or @code{cu} connection, change the DOS working
-@c OBSOLETE directory to the directory containing a copy of your 29K program, then
-@c OBSOLETE start the PC program @code{EBMON} (an EB29K control program supplied
-@c OBSOLETE with your board by AMD).  You should see an initial display from
-@c OBSOLETE @code{EBMON} similar to the one that follows, ending with the
-@c OBSOLETE @code{EBMON} prompt @samp{#}---
-@c OBSOLETE 
-@c OBSOLETE @example
-@c OBSOLETE C:\> G:
-@c OBSOLETE 
-@c OBSOLETE G:\> CD \usr\joe\work29k
-@c OBSOLETE 
-@c OBSOLETE G:\USR\JOE\WORK29K> EBMON
-@c OBSOLETE Am29000 PC Coprocessor Board Monitor, version 3.0-18
-@c OBSOLETE Copyright 1990 Advanced Micro Devices, Inc.
-@c OBSOLETE Written by Gibbons and Associates, Inc.
-@c OBSOLETE 
-@c OBSOLETE Enter '?' or 'H' for help
-@c OBSOLETE 
-@c OBSOLETE PC Coprocessor Type   = EB29K
-@c OBSOLETE I/O Base              = 0x208
-@c OBSOLETE Memory Base           = 0xd0000
-@c OBSOLETE 
-@c OBSOLETE Data Memory Size      = 2048KB
-@c OBSOLETE Available I-RAM Range = 0x8000 to 0x1fffff
-@c OBSOLETE Available D-RAM Range = 0x80002000 to 0x801fffff
-@c OBSOLETE 
-@c OBSOLETE PageSize              = 0x400
-@c OBSOLETE Register Stack Size   = 0x800
-@c OBSOLETE Memory Stack Size     = 0x1800
-@c OBSOLETE 
-@c OBSOLETE CPU PRL               = 0x3
-@c OBSOLETE Am29027 Available     = No
-@c OBSOLETE Byte Write Available  = Yes
-@c OBSOLETE 
-@c OBSOLETE # ~.
-@c OBSOLETE @end example
-@c OBSOLETE 
-@c OBSOLETE Then exit the @code{cu} or @code{tip} program (done in the example by
-@c OBSOLETE typing @code{~.} at the @code{EBMON} prompt).  @code{EBMON} keeps
-@c OBSOLETE running, ready for @value{GDBN} to take over.
-@c OBSOLETE 
-@c OBSOLETE For this example, we've assumed what is probably the most convenient
-@c OBSOLETE way to make sure the same 29K program is on both the PC and the Unix
-@c OBSOLETE system: a PC/NFS connection that establishes ``drive @file{G:}'' on the
-@c OBSOLETE PC as a file system on the Unix host.  If you do not have PC/NFS or
-@c OBSOLETE something similar connecting the two systems, you must arrange some
-@c OBSOLETE other way---perhaps floppy-disk transfer---of getting the 29K program
-@c OBSOLETE from the Unix system to the PC; @value{GDBN} does @emph{not} download it over the
-@c OBSOLETE serial line.
-@c OBSOLETE 
-@c OBSOLETE @node gdb-EB29K
-@c OBSOLETE @subsubsection EB29K cross-debugging
-@c OBSOLETE 
-@c OBSOLETE Finally, @code{cd} to the directory containing an image of your 29K
-@c OBSOLETE program on the Unix system, and start @value{GDBN}---specifying as argument the
-@c OBSOLETE name of your 29K program:
-@c OBSOLETE 
-@c OBSOLETE @example
-@c OBSOLETE cd /usr/joe/work29k
-@c OBSOLETE @value{GDBP} myfoo
-@c OBSOLETE @end example
-@c OBSOLETE 
-@c OBSOLETE @need 500
-@c OBSOLETE Now you can use the @code{target} command:
-@c OBSOLETE 
-@c OBSOLETE @example
-@c OBSOLETE target amd-eb /dev/ttya 9600 MYFOO
-@c OBSOLETE @c FIXME: test above 'target amd-eb' as spelled, with caps!  caps are meant to
-@c OBSOLETE @c emphasize that this is the name as seen by DOS (since I think DOS is
-@c OBSOLETE @c single-minded about case of letters).  ---doc@cygnus.com, 25feb91
-@c OBSOLETE @end example
-@c OBSOLETE 
-@c OBSOLETE @noindent
-@c OBSOLETE In this example, we've assumed your program is in a file called
-@c OBSOLETE @file{myfoo}.  Note that the filename given as the last argument to
-@c OBSOLETE @code{target amd-eb} should be the name of the program as it appears to DOS.
-@c OBSOLETE In our example this is simply @code{MYFOO}, but in general it can include
-@c OBSOLETE a DOS path, and depending on your transfer mechanism may not resemble
-@c OBSOLETE the name on the Unix side.
-@c OBSOLETE 
-@c OBSOLETE At this point, you can set any breakpoints you wish; when you are ready
-@c OBSOLETE to see your program run on the 29K board, use the @value{GDBN} command
-@c OBSOLETE @code{run}.
-@c OBSOLETE 
-@c OBSOLETE To stop debugging the remote program, use the @value{GDBN} @code{detach}
-@c OBSOLETE command.
-@c OBSOLETE 
-@c OBSOLETE To return control of the PC to its console, use @code{tip} or @code{cu}
-@c OBSOLETE once again, after your @value{GDBN} session has concluded, to attach to
-@c OBSOLETE @code{EBMON}.  You can then type the command @code{q} to shut down
-@c OBSOLETE @code{EBMON}, returning control to the DOS command-line interpreter.
-@c OBSOLETE Type @kbd{CTTY con} to return command input to the main DOS console,
-@c OBSOLETE and type @kbd{~.} to leave @code{tip} or @code{cu}.
-@c OBSOLETE 
-@c OBSOLETE @node Remote Log
-@c OBSOLETE @subsubsection Remote log
-@c OBSOLETE @cindex @file{eb.log}, a log file for EB29K
-@c OBSOLETE @cindex log file for EB29K
-@c OBSOLETE 
-@c OBSOLETE The @code{target amd-eb} command creates a file @file{eb.log} in the
-@c OBSOLETE current working directory, to help debug problems with the connection.
-@c OBSOLETE @file{eb.log} records all the output from @code{EBMON}, including echoes
-@c OBSOLETE of the commands sent to it.  Running @samp{tail -f} on this file in
-@c OBSOLETE another window often helps to understand trouble with @code{EBMON}, or
-@c OBSOLETE unexpected events on the PC side of the connection.
-
 @node ARM
 @subsection ARM
 
@@ -11208,7 +11432,7 @@ debugger, you give it just the numeric part of the serial port's name;
 for example, @samp{asyncstr 2} below runs @code{asyncstr} on
 @code{COM2}.
 
-@example
+@smallexample
 C:\H8300\TEST> asynctsr 2
 C:\H8300\TEST> mode com2:9600,n,8,1,p
 
@@ -11216,7 +11440,7 @@ Resident portion of MODE loaded
 
 COM2: 9600, n, 8, 1, p
 
-@end example
+@end smallexample
 
 @quotation
 @emph{Warning:} We have noticed a bug in PC-NFS that conflicts with
@@ -11389,9 +11613,9 @@ If you simply start @code{@value{GDBP}} without using any command-line
 options, you are prompted for what serial port to use, @emph{before} you
 reach the ordinary @value{GDBN} prompt:
 
-@example
+@smallexample
 Attach /dev/ttyNN -- specify NN, or "quit" to quit:
-@end example
+@end smallexample
 
 @noindent
 Respond to the prompt with whatever suffix (after @samp{/dev/tty})
@@ -11518,16 +11742,16 @@ ROMBUG ROM monitor for OS/9000.
 
 @end table
 
-@node M88K
-@subsection M88K
-
-@table @code
-
-@kindex target bug
-@item target bug @var{dev}
-BUG monitor, running on a MVME187 (m88k) board.
-
-@end table
+@c OBSOLETE @node M88K
+@c OBSOLETE @subsection M88K
+@c OBSOLETE 
+@c OBSOLETE @table @code
+@c OBSOLETE 
+@c OBSOLETE @kindex target bug
+@c OBSOLETE @item target bug @var{dev}
+@c OBSOLETE BUG monitor, running on a MVME187 (m88k) board.
+@c OBSOLETE 
+@c OBSOLETE @end table
 
 @node MIPS Embedded
 @subsection MIPS Embedded
@@ -11554,13 +11778,13 @@ For example, this sequence connects to the target board through a serial
 port, and loads and runs a program called @var{prog} through the
 debugger:
 
-@example
+@smallexample
 host$ @value{GDBP} @var{prog}
 @value{GDBN} is free software and @dots{}
 (@value{GDBP}) target mips /dev/ttyb
 (@value{GDBP}) load @var{prog}
 (@value{GDBP}) run
-@end example
+@end smallexample
 
 @item target mips @var{hostname}:@var{portnumber}
 On some @value{GDBN} host configurations, you can specify a TCP
@@ -11757,15 +11981,15 @@ information and @samp{-Ttext} to relocate the program to where you wish to
 load it on the target.  You may also want to add the options @samp{-n} or
 @samp{-N} in order to reduce the size of the sections.  Example:
 
-@example
+@smallexample
 sparclet-aout-gcc prog.c -Ttext 0x12010000 -g -o prog -N
-@end example
+@end smallexample
 
 You can use @code{objdump} to verify that the addresses are what you intended:
 
-@example
+@smallexample
 sparclet-aout-objdump --headers --syms prog
-@end example
+@end smallexample
 
 @cindex running, on Sparclet
 Once you have set
@@ -11775,9 +11999,9 @@ run @value{GDBN}.  From your Unix host, run @code{@value{GDBP}}
 
 @value{GDBN} comes up showing the prompt:
 
-@example
+@smallexample
 (gdbslet)
-@end example
+@end smallexample
 
 @menu
 * Sparclet File::                Setting the file to debug
@@ -11791,9 +12015,9 @@ run @value{GDBN}.  From your Unix host, run @code{@value{GDBP}}
 
 The @value{GDBN} command @code{file} lets you choose with program to debug.
 
-@example
+@smallexample
 (gdbslet) file prog
-@end example
+@end smallexample
 
 @need 1000
 @value{GDBN} then attempts to read the symbol table of @file{prog}.
@@ -11808,9 +12032,9 @@ path (@pxref{Environment, ,Your program's environment}).
 If it fails
 to find a file, it displays a message such as:
 
-@example
+@smallexample
 prog: No such file or directory.
-@end example
+@end smallexample
 
 When this happens, add the appropriate directories to the search paths with
 the @value{GDBN} commands @code{path} and @code{dir}, and execute the
@@ -11822,18 +12046,18 @@ the @value{GDBN} commands @code{path} and @code{dir}, and execute the
 The @value{GDBN} command @code{target} lets you connect to a Sparclet target.
 To connect to a target on serial port ``@code{ttya}'', type:
 
-@example
+@smallexample
 (gdbslet) target sparclet /dev/ttya
 Remote target sparclet connected to /dev/ttya
 main () at ../prog.c:3
-@end example
+@end smallexample
 
 @need 750
 @value{GDBN} displays messages like these:
 
-@example
+@smallexample
 Connected to ttya.
-@end example
+@end smallexample
 
 @node Sparclet Download
 @subsubsection Sparclet download
@@ -11852,10 +12076,10 @@ For instance, if the program
 @file{prog} was linked to text address 0x1201000, with data at 0x12010160
 and bss at 0x12010170, in @value{GDBN}, type:
 
-@example
+@smallexample
 (gdbslet) load prog 0x12010000
 Loading section .text, size 0xdb0 vma 0x12010000
-@end example
+@end smallexample
 
 If the code is loaded at a different address then what the program was linked
 to, you may need to use the @code{section} and @code{add-symbol-file} commands
@@ -11869,7 +12093,7 @@ You can now begin debugging the task using @value{GDBN}'s execution control
 commands, @code{b}, @code{step}, @code{run}, etc.  See the @value{GDBN}
 manual for the list of commands.
 
-@example
+@smallexample
 (gdbslet) b main
 Breakpoint 1 at 0x12010000: file prog.c, line 3.
 (gdbslet) run
@@ -11879,7 +12103,7 @@ Breakpoint 1, main (argc=1, argv=0xeffff21c) at prog.c:3
 (gdbslet) step
 4        char *execarg = "hello!";
 (gdbslet)
-@end example
+@end smallexample
 
 @node Sparclite
 @subsection Fujitsu Sparclite
@@ -11904,9 +12128,9 @@ STDBUG protocol.
 To connect your ST2000 to the host system, see the manufacturer's
 manual.  Once the ST2000 is physically attached, you can run:
 
-@example
+@smallexample
 target st2000 @var{dev} @var{speed}
-@end example
+@end smallexample
 
 @noindent
 to establish it as your debugging environment.  @var{dev} is normally
@@ -12382,11 +12606,11 @@ By default, @value{GDBN} is cautious, and asks what sometimes seems to be a
 lot of stupid questions to confirm certain commands.  For example, if
 you try to run a program which is already running:
 
-@example
+@smallexample
 (@value{GDBP}) run
 The program being debugged has been started already.
 Start it from the beginning? (y or n)
-@end example
+@end smallexample
 
 If you are willing to unflinchingly face the consequences of your own
 commands, you can disable this ``feature'':
@@ -12577,6 +12801,14 @@ Display the @value{GDBN} commands used to define @var{commandname} (but
 not its documentation).  If no @var{commandname} is given, display the
 definitions for all user-defined commands.
 
+@kindex show max-user-call-depth
+@kindex set max-user-call-depth
+@item show max-user-call-depth
+@itemx set max-user-call-depth
+The value of @code{max-user-call-depth} controls how many recursion
+levels are allowed in user-defined commands before GDB suspects an
+infinite recursion and aborts the command.
+
 @end table
 
 When user-defined commands are executed, the
@@ -12626,7 +12858,7 @@ For example, to ignore @code{SIGALRM} signals while
 single-stepping, but treat them normally during normal execution,
 you could define:
 
-@example
+@smallexample
 define hook-stop
 handle SIGALRM nopass
 end
@@ -12638,13 +12870,13 @@ end
 define hook-continue
 handle SIGLARM pass
 end
-@end example
+@end smallexample
 
 As a further example, to hook at the begining and end of the @code{echo}
 command, and to add extra text to the beginning and end of the message, 
 you could define:
 
-@example
+@smallexample
 define hook-echo
 echo <<<---
 end
@@ -12657,7 +12889,7 @@ end
 <<<---Hello World--->>>
 (@value{GDBP})
 
-@end example
+@end smallexample
 
 You can define a hook for any single-word command in @value{GDBN}, but
 not for command aliases; you should define a hook for the basic command
@@ -12741,8 +12973,8 @@ Execute the command file @var{filename}.
 @end table
 
 The lines in a command file are executed sequentially.  They are not
-printed as they are executed.  An error in any command terminates execution
-of the command file.
+printed as they are executed.  An error in any command terminates
+execution of the command file and control is returned to the console.
 
 Commands that would ask for confirmation if used interactively proceed
 without asking when used in a command file.  Many @value{GDBN} commands that
@@ -12755,9 +12987,9 @@ standard error.  Errors in a command file supplied on standard input do
 not terminate execution of the command file --- execution continues with
 the next command.
 
-@example
+@smallexample
 gdb < cmds > log 2>&1
-@end example
+@end smallexample
 
 (The syntax above will vary depending on the shell used.) This example
 will execute commands from the file @file{cmds}. All output and errors
@@ -12790,19 +13022,19 @@ To print @samp{@w{ }and foo =@w{ }}, use the command
 A backslash at the end of @var{text} can be used, as in C, to continue
 the command onto subsequent lines.  For example,
 
-@example
+@smallexample
 echo This is some text\n\
 which is continued\n\
 onto several lines.\n
-@end example
+@end smallexample
 
 produces the same output as
 
-@example
+@smallexample
 echo This is some text\n
 echo which is continued\n
 echo onto several lines.\n
-@end example
+@end smallexample
 
 @kindex output
 @item output @var{expression}
@@ -12828,9 +13060,9 @@ subroutine
 @c Either this is a bug, or the manual should document what formats are
 @c supported.
 
-@example
+@smallexample
 printf (@var{string}, @var{expressions}@dots{});
-@end example
+@end smallexample
 
 For example, you can print two values in hex like this:
 
@@ -13198,9 +13430,9 @@ you need to call @value{GDBN} by a different name (for example, if you keep
 several configurations around, with different names) you can set the
 Emacs variable @code{gdb-command-name}; for example,
 
-@example
+@smallexample
 (setq gdb-command-name "mygdb")
-@end example
+@end smallexample
 
 @noindent
 (preceded by @kbd{M-:} or @kbd{ESC :}, or typed in the @code{*scratch*} buffer, or
@@ -13370,12 +13602,11 @@ individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
 distribution.
 @c should add a web page ref...
 
-In any event, we also recommend that you send bug reports for
-@value{GDBN} to this addresses:
-
-@example
-bug-gdb@@gnu.org
-@end example
+In any event, we also recommend that you submit bug reports for
+@value{GDBN}.  The prefered method is to submit them directly using
+@uref{http://www.gnu.org/software/gdb/bugs/, @value{GDBN}'s Bugs web
+page}.  Alternatively, the @email{bug-gdb@@gnu.org, e-mail gateway} can
+be used.
 
 @strong{Do not send bug reports to @samp{info-gdb}, or to
 @samp{help-gdb}, or to any newsgroups.}  Most users of @value{GDBN} do
@@ -13391,16 +13622,6 @@ path back to the sender.  Thus, if we need to ask for more information,
 we may be unable to reach you.  For this reason, it is better to send
 bug reports to the mailing list.
 
-As a last resort, send bug reports on paper to:
-
-@example
-@sc{gnu} Debugger Bugs
-Free Software Foundation Inc.
-59 Temple Place - Suite 330
-Boston, MA 02111-1307
-USA
-@end example
-
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
 fact or leave it out, state it!
@@ -13564,9 +13785,9 @@ you can print the reference card immediately with @file{refcard.ps}.
 The release also includes the source for the reference card.  You
 can format it, using @TeX{}, by typing:
 
-@example
+@smallexample
 make refcard.dvi
-@end example
+@end smallexample
 
 The @value{GDBN} reference card is designed to print in @dfn{landscape}
 mode on US ``letter'' size paper;
@@ -13600,10 +13821,10 @@ If you have @code{makeinfo} installed, and are in the top level
 @value{GDBN} source directory (@file{gdb-@value{GDBVN}}, in the case of
 version @value{GDBVN}), you can make the Info file by typing:
 
-@example
+@smallexample
 cd gdb
 make gdb.info
-@end example
+@end smallexample
 
 If you want to typeset and print copies of this manual, you need @TeX{},
 a program to print its @sc{dvi} output files, and @file{texinfo.tex}, the
@@ -13629,9 +13850,9 @@ typeset and print this manual.  First switch to the the @file{gdb}
 subdirectory of the main source directory (for example, to
 @file{gdb-@value{GDBVN}/gdb}) and type:
 
-@example
+@smallexample
 make gdb.dvi
-@end example
+@end smallexample
 
 Then give @file{gdb.dvi} to your @sc{dvi} printing program.
 
@@ -13697,11 +13918,11 @@ argument.
 
 For example:
 
-@example
+@smallexample
 cd gdb-@value{GDBVN}
 ./configure @var{host}
 make
-@end example
+@end smallexample
 
 @noindent
 where @var{host} is an identifier such as @samp{sun4} or
@@ -13719,9 +13940,9 @@ binaries, are left in the corresponding source directories.
 system does not recognize this automatically when you run a different
 shell, you may need to run @code{sh} on it explicitly:
 
-@example
+@smallexample
 sh configure @var{host}
-@end example
+@end smallexample
 
 If you run @code{configure} from a directory that contains source
 directories for multiple libraries or programs, such as the
@@ -13736,12 +13957,12 @@ configure that subdirectory, but be sure to specify a path to it.
 For example, with version @value{GDBVN}, type the following to configure only
 the @code{bfd} subdirectory:
 
-@example
+@smallexample
 @group
 cd gdb-@value{GDBVN}/bfd
 ../configure @var{host}
 @end group
-@end example
+@end smallexample
 
 You can install @code{@value{GDBP}} anywhere; it has no hardwired paths.
 However, you should make sure that the shell on your path (named by
@@ -13777,7 +13998,7 @@ the @samp{--srcdir} option; it is assumed.)
 For example, with version @value{GDBVN}, you can build @value{GDBN} in a
 separate directory for a Sun 4 like this:
 
-@example
+@smallexample
 @group
 cd gdb-@value{GDBVN}
 mkdir ../gdb-sun4
@@ -13785,7 +14006,7 @@ cd ../gdb-sun4
 ../gdb-@value{GDBVN}/configure sun4
 make
 @end group
-@end example
+@end smallexample
 
 When @code{configure} builds a configuration using a remote source
 directory, it creates a tree for the binaries with the same structure
@@ -13824,9 +14045,9 @@ script are based on a three-part naming scheme, but some short predefined
 aliases are also supported.  The full naming scheme encodes three pieces
 of information in the following pattern:
 
-@example
+@smallexample
 @var{architecture}-@var{vendor}-@var{os}
-@end example
+@end smallexample
 
 For example, you can use the alias @code{sun4} as a @var{host} argument,
 or as the value for @var{target} in a @code{--target=@var{target}}
@@ -13866,7 +14087,7 @@ are most often useful for building @value{GDBN}.  @code{configure} also has
 several other options not listed here.  @inforef{What Configure
 Does,,configure.info}, for a full explanation of @code{configure}.
 
-@example
+@smallexample
 configure @r{[}--help@r{]}
           @r{[}--prefix=@var{dir}@r{]}
           @r{[}--exec-prefix=@var{dir}@r{]}
@@ -13874,7 +14095,7 @@ configure @r{[}--help@r{]}
           @r{[}--norecursion@r{]} @r{[}--rm@r{]}
           @r{[}--target=@var{target}@r{]}
           @var{host}
-@end example
+@end smallexample
 
 @noindent
 You may introduce options with a single @samp{-} rather than
@@ -13992,9 +14213,9 @@ sent as a @var{packet}.  A @var{packet} is introduced with the character
 @samp{$}, the actual @var{packet-data}, and the terminating character
 @samp{#} followed by a two-digit @var{checksum}:
 
-@example
+@smallexample
 @code{$}@var{packet-data}@code{#}@var{checksum}
-@end example
+@end smallexample
 @noindent
 
 @cindex checksum, for @value{GDBN} remote
@@ -14006,9 +14227,9 @@ eight bit unsigned checksum).
 Implementors should note that prior to @value{GDBN} 5.0 the protocol
 specification also included an optional two-digit @var{sequence-id}:
 
-@example
+@smallexample
 @code{$}@var{sequence-id}@code{:}@var{packet-data}@code{#}@var{checksum}
-@end example
+@end smallexample
 
 @cindex sequence-id, for @value{GDBN} remote
 @noindent
@@ -14022,10 +14243,10 @@ response expected is an acknowledgment: either @samp{+} (to indicate
 the package was received correctly) or @samp{-} (to request
 retransmission):
 
-@example
+@smallexample
 <- @code{$}@var{packet-data}@code{#}@var{checksum}
 -> @code{+}
-@end example
+@end smallexample
 @noindent
 
 The host (@value{GDBN}) sends @var{command}s, and the target (the
@@ -14058,9 +14279,9 @@ loosely refered to as the cisco encoding.  Following the @samp{*}
 character are two hex digits that indicate the size of the packet.
 
 So:
-@example
+@smallexample
 "@code{0* }"
-@end example
+@end smallexample
 @noindent
 means the same as "0000".
 
@@ -14275,8 +14496,8 @@ See @samp{i} and @samp{S} for likely syntax and semantics.
 @item kill request
 @tab @code{k}
 @tab
-FIXME: @emph{There is no description of how operate when a specific
-thread context has been selected (ie. does 'k' kill only that thread?)}.
+FIXME: @emph{There is no description of how to operate when a specific
+thread context has been selected (i.e.@: does 'k' kill only that thread?)}.
 
 @item reserved
 @tab @code{l}
@@ -14796,7 +15017,7 @@ as @code{MIPS32}.
 Example sequence of a target being re-started.  Notice how the restart
 does not get any direct output:
 
-@example
+@smallexample
 <- @code{R00}
 -> @code{+}
 @emph{target restarts}
@@ -14804,11 +15025,11 @@ does not get any direct output:
 -> @code{+}
 -> @code{T001:1234123412341234}
 <- @code{+}
-@end example
+@end smallexample
 
 Example sequence of a target being stepped by a single instruction:
 
-@example
+@smallexample
 <- @code{G1445...}
 -> @code{+}
 <- @code{s}
@@ -14820,8 +15041,9 @@ Example sequence of a target being stepped by a single instruction:
 -> @code{+}
 -> @code{1455...}
 <- @code{+}
-@end example
+@end smallexample
 
+@include gpl.texi
 
 @include fdl.texi
 
This page took 0.060134 seconds and 4 git commands to generate.