Mention PR ld/4208 in ChangeLog entry.
[deliverable/binutils-gdb.git] / gdb / doc / gdb.texinfo
index 82571b6c9728a330428aa4950a8d077175d9eb46..ad6522a02cbd3d703d904ea2679ef5c2eb34d6c6 100644 (file)
@@ -144,21 +144,23 @@ Copyright (C) 1988-2006 Free Software Foundation, Inc.
 * Configurations::              Configuration-specific information
 * Controlling GDB::             Controlling @value{GDBN}
 * Sequences::                   Canned sequences of commands
-* TUI::                         @value{GDBN} Text User Interface
 * Interpreters::               Command Interpreters
+* TUI::                         @value{GDBN} Text User Interface
 * Emacs::                       Using @value{GDBN} under @sc{gnu} Emacs
-* Annotations::                 @value{GDBN}'s annotation interface.
 * GDB/MI::                      @value{GDBN}'s Machine Interface.
+* Annotations::                 @value{GDBN}'s annotation interface.
 
 * GDB Bugs::                    Reporting bugs in @value{GDBN}
-* Formatting Documentation::    How to format and print @value{GDBN} documentation
 
 * Command Line Editing::        Command Line Editing
 * Using History Interactively:: Using History Interactively
+* Formatting Documentation::    How to format and print @value{GDBN} documentation
 * Installing GDB::              Installing GDB
 * Maintenance Commands::        Maintenance Commands
 * Remote Protocol::             GDB Remote Serial Protocol
 * Agent Expressions::           The GDB Agent Expression Mechanism
+* Target Descriptions::         How targets can describe themselves to
+                                @value{GDBN}
 * Copying::                    GNU General Public License says
                                 how you can copy and share GDB
 * GNU Free Documentation License::  The license for this documentation
@@ -884,7 +886,7 @@ in sequential order.  The order makes a difference when the
 When @value{GDBN} starts, it reads any arguments other than options as
 specifying an executable file and core file (or process ID).  This is
 the same as if the arguments were specified by the @samp{-se} and
-@samp{-c} (or @samp{-p} options respectively.  (@value{GDBN} reads the
+@samp{-c} (or @samp{-p}) options respectively.  (@value{GDBN} reads the
 first argument that does not have an associated option flag as
 equivalent to the @samp{-se} option followed by that argument; and the
 second argument that does not have an associated option flag, if any, as
@@ -2822,7 +2824,7 @@ Some @value{GDBN} commands accept a range of breakpoints on which to
 operate.  A breakpoint range is either a single breakpoint number, like
 @samp{5}, or two such numbers, in increasing order, separated by a
 hyphen, like @samp{5-7}.  When a breakpoint range is given to a command,
-all breakpoint in that range are operated on.
+all breakpoints in that range are operated on.
 
 @menu
 * Set Breaks::                  Setting breakpoints
@@ -3215,7 +3217,7 @@ zero, @value{GDBN} will never try to use hardware watchpoints, even if
 the underlying system supports them.  (Note that hardware-assisted
 watchpoints that were set @emph{before} setting
 @code{can-use-hw-watchpoints} to zero will still use the hardware
-mechanism of watching expressiion values.)
+mechanism of watching expression values.)
 
 @table @code
 @item set can-use-hw-watchpoints
@@ -3353,6 +3355,20 @@ The throwing of a C@t{++} exception.
 @item catch
 The catching of a C@t{++} exception.
 
+@item exception
+@cindex Ada exception catching
+@cindex catch Ada exceptions
+An Ada exception being raised.  If an exception name is specified
+at the end of the command (eg @code{catch exception Program_Error}),
+the debugger will stop only when this specific exception is raised.
+Otherwise, the debugger stops execution when any Ada exception is raised.
+
+@item exception unhandled
+An exception that was raised but is not handled by the program.
+
+@item assert
+A failed Ada assertion.
+
 @item exec
 @cindex break on fork/exec
 A call to @code{exec}.  This is currently only available for HP-UX.
@@ -4475,7 +4491,7 @@ frames in @value{GDBN} commands.
 @c underflow problems.
 @cindex frameless execution
 Some compilers provide a way to compile functions so that they operate
-without stack frames.  (For example, the @value{GCC} option
+without stack frames.  (For example, the @value{NGCC} option
 @smallexample
 @samp{-fomit-frame-pointer}
 @end smallexample
@@ -4648,7 +4664,7 @@ This entry point is encoded by the linker when the application is built,
 and is likely before the user entry point @code{main} (or equivalent) is called.
 
 @item set backtrace past-entry off
-Backtraces will stop when they encouter the internal entry point of an
+Backtraces will stop when they encounter the internal entry point of an
 application.  This is the default.
 
 @item show backtrace past-entry
@@ -5132,7 +5148,7 @@ To avoid unexpected substitution results, a rule is applied only if the
 For instance, a rule substituting  @file{/usr/source} into
 @file{/mnt/cross} will be applied to @file{/usr/source/foo-1.0} but
 not to @file{/usr/sourceware/foo-2.0}.  And because the substitution
-is applied only at the begining of the directory name, this rule will
+is applied only at the beginning of the directory name, this rule will
 not be applied to @file{/root/usr/source/baz.c} either.
 
 In many cases, you can achieve the same result using the @code{directory}
@@ -5165,7 +5181,7 @@ path; this moves it forward, so @value{GDBN} searches it sooner.
 @kindex cdir
 @kindex cwd
 @vindex $cdir@r{, convenience variable}
-@vindex $cwdr@r{, convenience variable}
+@vindex $cwd@r{, convenience variable}
 @cindex compilation directory
 @cindex current directory
 @cindex working directory
@@ -5607,8 +5623,9 @@ usually supports the @option{-gstabs+} option.  @option{-gstabs+}
 produces debug info in a format that is superior to formats such as
 COFF.  You may be able to use DWARF 2 (@option{-gdwarf-2}), which is also
 an effective form for debug info.  @xref{Debugging Options,,Options
-for Debugging Your Program or @sc{gnu} CC, gcc.info, Using @sc{gnu} CC}.
-@xref{C, , Debugging C++}, for more info about debug info formats
+for Debugging Your Program or GCC, gcc.info, Using the @sc{gnu}
+Compiler Collection (GCC)}.
+@xref{C, , Debugging C++}, for more information about debug info formats
 that are best suited to C@t{++} programs.
 
 If you ask to print an object whose contents are unknown to
@@ -5616,6 +5633,26 @@ If you ask to print an object whose contents are unknown to
 by the debug information, @value{GDBN} will say @samp{<incomplete
 type>}.  @xref{Symbols, incomplete type}, for more about this.
 
+Strings are identified as arrays of @code{char} values without specified
+signedness.  Arrays of either @code{signed char} or @code{unsigned char} get
+printed as arrays of 1 byte sized integers.  @code{-fsigned-char} or
+@code{-funsigned-char} @value{NGCC} options have no effect as @value{GDBN}
+defines literal string type @code{"char"} as @code{char} without a sign.
+For program code
+
+@smallexample
+char var0[] = "A";
+signed char var1[] = "A";
+@end smallexample
+
+You get during debugging
+@smallexample
+(gdb) print var0
+$1 = "A"
+(gdb) print var1
+$2 = @{65 'A', 0 '\0'@}
+@end smallexample
+
 @node Arrays
 @section Artificial arrays
 
@@ -6155,7 +6192,7 @@ If the number is 0, then the printing is unlimited.
 @item set print repeats
 @cindex repeated array elements
 Set the threshold for suppressing display of repeated array
-elelments.  When the number of consecutive identical elements of an
+elements.  When the number of consecutive identical elements of an
 array exceeds the threshold, @value{GDBN} prints the string
 @code{"<repeats @var{n} times>"}, where @var{n} is the number of
 identical repetitions, instead of displaying the identical elements
@@ -6366,8 +6403,8 @@ Show whether C@t{++} static members are printed or not.
 
 @item set print pascal_static-members
 @itemx set print pascal_static-members on
-@cindex static members of Pacal objects
-@cindex Pacal objects, static members display
+@cindex static members of Pascal objects
+@cindex Pascal objects, static members display
 Print static members when displaying a Pascal object.  The default is on.
 
 @item set print pascal_static-members off
@@ -6814,7 +6851,7 @@ to enable, disable, or remove a memory region, you specify that number.
 Define a memory region bounded by @var{lower} and @var{upper} with
 attributes @var{attributes}@dots{}, and add it to the list of regions
 monitored by @value{GDBN}.  Note that @var{upper} == 0 is a special
-case: it is treated as the the target's maximum memory address.
+case: it is treated as the target's maximum memory address.
 (0xffff on 16 bit targets, 0xffffffff on 32 bit targets, etc.)
 
 @item mem auto
@@ -6879,7 +6916,7 @@ Memory is read/write.  This is the default.
 @end table
 
 @subsubsection Memory Access Size
-The acccess size attributes tells @value{GDBN} to use specific sized
+The access size attribute tells @value{GDBN} to use specific sized
 accesses in the memory region.  Often memory mapped device registers
 require specific sized accesses.  If no access size attribute is
 specified, @value{GDBN} may use accesses of any size.
@@ -8979,8 +9016,8 @@ For best results when using @sc{gnu} C@t{++}, use the DWARF 2 debugging
 format; if it doesn't work on your system, try the stabs+ debugging
 format.  You can select those formats explicitly with the @code{g++}
 command-line options @option{-gdwarf-2} and @option{-gstabs+}.
-@xref{Debugging Options,,Options for Debugging Your Program or @sc{gnu}
-CC, gcc.info, Using @sc{gnu} CC}.
+@xref{Debugging Options,,Options for Debugging Your Program or GCC,
+gcc.info, Using the @sc{gnu} Compiler Collection (GCC)}.
 
 @menu
 * C Operators::                 C and C@t{++} operators
@@ -9148,10 +9185,6 @@ If an operator is redefined in the user code, @value{GDBN} usually
 attempts to invoke the redefined version instead of using the operator's
 predefined meaning.
 
-@menu
-* C Constants::
-@end menu
-
 @node C Constants
 @subsubsection C and C@t{++} constants
 
@@ -9212,14 +9245,6 @@ integers, @samp{@{@{1,2@}, @{3,4@}, @{5,6@}@}} is a three-by-two array,
 and @samp{@{&"hi", &"there", &"fred"@}} is a three-element array of pointers.
 @end itemize
 
-@menu
-* C plus plus expressions::
-* C Defaults::
-* C Checks::
-
-* Debugging C::
-@end menu
-
 @node C plus plus expressions
 @subsubsection C@t{++} expressions
 
@@ -9383,10 +9408,6 @@ The @code{@@} operator aids in the debugging of dynamic arrays, formed
 with pointers and a memory allocation function.  @xref{Expressions,
 ,Expressions}.
 
-@menu
-* Debugging C plus plus::
-@end menu
-
 @node Debugging C plus plus
 @subsubsection @value{GDBN} features for C@t{++}
 
@@ -9488,7 +9509,7 @@ few more commands specific to Objective-C support.
 * The Print Command with Objective-C::
 @end menu
 
-@node Method Names in Commands, The Print Command with Objective-C, Objective-C, Objective-C
+@node Method Names in Commands
 @subsubsection Method Names in Commands
 
 The following commands have been extended to accept Objective-C method
@@ -9639,7 +9660,7 @@ such as common block displaying.
 @item info common @r{[}@var{common-name}@r{]}
 This command prints the values contained in the Fortran @code{COMMON}
 block whose name is @var{common-name}.  With no argument, the names of
-all @code{COMMON} blocks visible at current program location are
+all @code{COMMON} blocks visible at the current program location are
 printed.
 @end table
 
@@ -11310,7 +11331,7 @@ selected stack frame returns naturally.
 @cindex calling functions
 @cindex inferior functions, calling
 @item print @var{expr}
-Evaluate the expression @var{expr} and display the resuling value.
+Evaluate the expression @var{expr} and display the resulting value.
 @var{expr} may include calls to functions in the program being
 debugged.
 
@@ -11422,8 +11443,9 @@ Out of @value{GDBN}}).
 Occasionally it is necessary to change to a different file during a
 @value{GDBN} session.  Or you may run @value{GDBN} and forget to
 specify a file you want to use.  Or you are debugging a remote target
-via @code{gdbserver} (@pxref{Server, file}).  In these situations the
-@value{GDBN} commands to specify new files are useful.
+via @code{gdbserver} (@pxref{Server, file, Using the gdbserver
+program}).  In these situations the @value{GDBN} commands to specify
+new files are useful.
 
 @table @code
 @cindex executable file
@@ -11483,7 +11505,7 @@ understands debugging information in whatever format is the standard
 generated for that environment; you may use either a @sc{gnu} compiler, or
 other compilers that adhere to the local conventions.
 Best results are usually obtained from @sc{gnu} compilers; for example,
-using @code{@value{GCC}} you can generate debugging information for
+using @code{@value{NGCC}} you can generate debugging information for
 optimized code.
 
 For most kinds of object files, with the exception of old SVR3 systems
@@ -11757,7 +11779,7 @@ memory footprint by preventing it from automatically loading the
 symbols from shared libraries.  To that end, type @kbd{set
 auto-solib-add off} before running the inferior, then load each
 library whose debug symbols you do need with @kbd{sharedlibrary
-@var{regexp}}, where @var{regexp} is a regular expresion that matches
+@var{regexp}}, where @var{regexp} is a regular expression that matches
 the libraries whose symbols you want to be loaded.
 
 @kindex show auto-solib-add
@@ -11828,33 +11850,45 @@ to specify the search directories for target libraries.
 
 @table @code
 @cindex prefix for shared library file names
+@cindex system root, alternate
 @kindex set solib-absolute-prefix
-@item set solib-absolute-prefix @var{path}
-If this variable is set, @var{path} will be used as a prefix for any
-absolute shared library paths; many runtime loaders store the absolute
-paths to the shared library in the target program's memory.  If you use
-@samp{solib-absolute-prefix} to find shared libraries, they need to be laid
-out in the same way that they are on the target, with e.g.@: a
-@file{/usr/lib} hierarchy under @var{path}.
-
-@cindex default value of @samp{solib-absolute-prefix}
+@kindex set sysroot
+@item set sysroot @var{path}
+Use @var{path} as the system root for the program being debugged.  Any
+absolute shared library paths will be prefixed with @var{path}; many
+runtime loaders store the absolute paths to the shared library in the
+target program's memory.  If you use @code{set sysroot} to find shared
+libraries, they need to be laid out in the same way that they are on
+the target, with e.g.@: a @file{/lib} and @file{/usr/lib} hierarchy
+under @var{path}.
+
+The @code{set solib-absolute-prefix} command is an alias for @code{set
+sysroot}.
+
+@cindex default system root
 @cindex @samp{--with-sysroot}
-You can set the default value of @samp{solib-absolute-prefix} by using the
-configure-time @samp{--with-sysroot} option.
-
-@kindex show solib-absolute-prefix
-@item show solib-absolute-prefix
+You can set the default system root by using the configure-time
+@samp{--with-sysroot} option.  If the system root is inside
+@value{GDBN}'s configured binary prefix (set with @samp{--prefix} or
+@samp{--exec-prefix}), then the default system root will be updated
+automatically if the installed @value{GDBN} is moved to a new
+location.
+
+@kindex show sysroot
+@item show sysroot
 Display the current shared library prefix.
 
 @kindex set solib-search-path
 @item set solib-search-path @var{path}
-If this variable is set, @var{path} is a colon-separated list of directories
-to search for shared libraries.  @samp{solib-search-path} is used after
-@samp{solib-absolute-prefix} fails to locate the library, or if the path to
-the library is relative instead of absolute.  If you want to use
-@samp{solib-search-path} instead of @samp{solib-absolute-prefix}, be sure to
-set @samp{solib-absolute-prefix} to a nonexistant directory to prevent
-@value{GDBN} from finding your host's libraries.
+If this variable is set, @var{path} is a colon-separated list of
+directories to search for shared libraries.  @samp{solib-search-path}
+is used after @samp{sysroot} fails to locate the library, or if the
+path to the library is relative instead of absolute.  If you want to
+use @samp{solib-search-path} instead of @samp{sysroot}, be sure to set
+@samp{sysroot} to a nonexistent directory to prevent @value{GDBN} from
+finding your host's libraries.  @samp{sysroot} is preferred; setting
+it to a nonexistent directory may interfere with automatic loading
+of shared library symbols.
 
 @kindex show solib-search-path
 @item show solib-search-path
@@ -12469,7 +12503,7 @@ Send an arbitrary @var{command} string to the remote monitor.
 @section Connecting to a remote target
 
 On the @value{GDBN} host machine, you will need an unstripped copy of
-your program, since @value{GDBN} needs symobl and debugging information.
+your program, since @value{GDBN} needs symbol and debugging information.
 Start up @value{GDBN} as usual, using the name of the local copy of your
 program as the first argument.
 
@@ -12695,25 +12729,57 @@ You can debug processes by name instead of process ID if your target has the
 @code{pidof} utility:
 
 @smallexample
-target> gdbserver @var{comm} --attach `pidof @var{PROGRAM}`
+target> gdbserver @var{comm} --attach `pidof @var{program}`
 @end smallexample
 
-In case more than one copy of @var{PROGRAM} is running, or @var{PROGRAM}
+In case more than one copy of @var{program} is running, or @var{program}
 has multiple threads, most versions of @code{pidof} support the
 @code{-s} option to only return the first process ID.
 
 @item On the host machine,
-connect to your target (@pxref{Connecting,,Connecting to a remote target}).
+first make sure you have the necessary symbol files.  Load symbols for
+your application using the @code{file} command before you connect.  Use
+@code{set sysroot} to locate target libraries (unless your @value{GDBN}
+was compiled with the correct sysroot using @code{--with-system-root}).
+
+The symbol file and target libraries must exactly match the executable
+and libraries on the target, with one exception: the files on the host
+system should not be stripped, even if the files on the target system
+are.  Mismatched or missing files will lead to confusing results
+during debugging.  On @sc{gnu}/Linux targets, mismatched or missing
+files may also prevent @code{gdbserver} from debugging multi-threaded
+programs.
+
+Connect to your target (@pxref{Connecting,,Connecting to a remote target}).
 For TCP connections, you must start up @code{gdbserver} prior to using
 the @code{target remote} command.  Otherwise you may get an error whose
 text depends on the host system, but which usually looks something like
 @samp{Connection refused}.  You don't need to use the @code{load}
 command in @value{GDBN} when using @code{gdbserver}, since the program is
-already on the target.  However, if you want to load the symbols (as
-you normally would), do that with the @code{file} command, and issue
-it @emph{before} connecting to the server; otherwise, you will get an
-error message saying @code{"Program is already running"}, since the
-program is considered running after the connection.
+already on the target.
+
+@end table
+
+@subsection Monitor commands for @code{gdbserver}
+@cindex monitor commands, for @code{gdbserver}
+
+During a @value{GDBN} session using @code{gdbserver}, you can use the
+@code{monitor} command to send special requests to @code{gdbserver}.
+Here are the available commands; they are only of interest when
+debugging @value{GDBN} or @code{gdbserver}.
+
+@table @code
+@item monitor help
+List the available monitor commands.
+
+@item monitor set debug 0
+@itemx monitor set debug 1
+Disable or enable general debugging messages.
+
+@item monitor set remote-debug 0
+@itemx monitor set remote-debug 1
+Disable or enable specific debugging messages associated with the remote
+protocol (@pxref{Remote Protocol}).
 
 @end table
 
@@ -12729,7 +12795,7 @@ system-call-allowed}.
 
 @table @code
 @item set remoteaddresssize @var{bits}
-@cindex adress size for remote targets
+@cindex address size for remote targets
 @cindex bits in remote address
 Set the maximum size of address in a memory packet to the specified
 number of bits.  @value{GDBN} will mask off the address bits above
@@ -13139,7 +13205,7 @@ either obtain it from your hardware manufacturer, or write your own.
 If you do not use the GNU C compiler, you may need other standard
 library subroutines as well; this varies from one stub to another,
 but in general the stubs are likely to use any of the common library
-subroutines which @code{@value{GCC}} generates as inline code.
+subroutines which @code{@value{NGCC}} generates as inline code.
 
 
 @node Debug Session
@@ -13616,7 +13682,7 @@ 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.
+about the six segment registers.
 
 @kindex info dll
 @item info dll
@@ -13745,8 +13811,8 @@ Note that the internal name of the DLL may be all upper-case, even
 though the file name of the DLL is lower-case, or vice-versa. Since
 symbols within @value{GDBN} are @emph{case-sensitive} this may cause
 some confusion. If in doubt, try the @code{info functions} and
-@code{info variables} commands or even @code{maint print msymbols} (see
-@pxref{Symbols}). Here's an example:
+@code{info variables} commands or even @code{maint print msymbols}
+(@pxref{Symbols}). Here's an example:
 
 @smallexample
 (@value{GDBP}) info function CreateFileA
@@ -13959,7 +14025,7 @@ only the current thread.
 This command shows the state of current thread suspension.
 
 @item set thread run
-This comamnd sets whether the current thread is allowed to run.
+This command sets whether the current thread is allowed to run.
 
 @item show thread run
 Show whether the current thread is allowed to run.
@@ -14222,7 +14288,7 @@ acceptable commands.
 * MIPS Embedded::               MIPS Embedded
 * OpenRISC 1000::               OpenRisc 1000
 * PA::                          HP PA Embedded
-* PowerPC:                      PowerPC
+* PowerPC::                     PowerPC
 * SH::                          Renesas SH
 * Sparclet::                    Tsqware Sparclet
 * Sparclite::                   Fujitsu Sparclite
@@ -14627,7 +14693,7 @@ The following @value{GDBN} commands are specific to the M32R monitor:
 @item set download-path @var{path}
 @kindex set download-path
 @cindex find downloadable @sc{srec} files (M32R)
-Set the default path for finding donwloadable @sc{srec} files.
+Set the default path for finding downloadable @sc{srec} files.
 
 @item show download-path
 @kindex show download-path
@@ -14971,7 +15037,7 @@ When triggered, it can capture low level data, like: @code{PC}, @code{LSEA},
 @table @code
 @kindex hwatch
 @item hwatch @var{conditional}
-Set hardware watchpoint on combination of Load/Store Effecive Address(es)
+Set hardware watchpoint on combination of Load/Store Effective Address(es)
 or Data.  For example:
 
 @code{hwatch ($LEA == my_var) && ($LDATA < 50) || ($SEA == my_var) && ($SDATA >= 50)}
@@ -15036,7 +15102,7 @@ SDS monitor, running on a PowerPC board (such as Motorola's ADS).
 @end table
 
 @cindex SDS protocol
-The following commands specifi to the SDS protocol are supported
+The following commands specific to the SDS protocol are supported
 by@value{GDBN}:
 
 @table @code
@@ -15658,13 +15724,13 @@ Show the current setting of MIPS debugging messages.
 @subsection HPPA
 @cindex HPPA support
 
-When @value{GDBN} is debugging te HP PA architecture, it provides the
+When @value{GDBN} is debugging the HP PA architecture, it provides the
 following special commands:
 
 @table @code
 @item set debug hppa
 @kindex set debug hppa
-THis command determines whether HPPA architecture specific debugging
+This command determines whether HPPA architecture specific debugging
 messages are to be displayed.
 
 @item show debug hppa
@@ -16283,6 +16349,11 @@ info. The default is off.
 @item show debugvarobj
 Displays the current state of displaying @value{GDBN} variable object
 debugging info.
+@item set debug xml
+@cindex XML parser debugging
+Turns on or off debugging messages for built-in XML parsers.
+@item show debug xml
+Displays the current state of XML debugging messages.
 @end table
 
 @node Sequences
@@ -16458,11 +16529,11 @@ handle SIGALRM pass
 end
 
 define hook-continue
-handle SIGLARM pass
+handle SIGALRM pass
 end
 @end smallexample
 
-As a further example, to hook at the begining and end of the @code{echo}
+As a further example, to hook at the beginning and end of the @code{echo}
 command, and to add extra text to the beginning and end of the message,
 you could define:
 
@@ -17670,6 +17741,10 @@ New MI commands may be added.
 @item
 New fields may be added to the output of any MI command.
 
+@item
+The range of values for fields with specified values, e.g.,
+@code{in_scope} (@pxref{-var-update}) may be extended.
+
 @c The format of field's content e.g type prefix, may change so parse it
 @c   at your own risk.  Yes, in general?
 
@@ -17691,7 +17766,7 @@ end is to make your project known to @value{GDBN} developers and
 follow development on @email{gdb@@sourceware.org} and
 @email{gdb-patches@@sourceware.org}.  There is also the mailing list
 @email{dmi-discuss@@lists.freestandards.org}, hosted by the Free Standards
-Group, which has the aim of creating a more general MI protocol
+Group, which has the aim of creating a more general MI protocol
 called Debugger Machine Interface (DMI) that will become a standard
 for all debuggers, not just @value{GDBN}.
 @cindex mailing lists
@@ -17829,7 +17904,7 @@ the @sc{gdb/mi} interface.  In these examples, @samp{->} means that the
 following line is passed to @sc{gdb/mi} as input, while @samp{<-} means
 the output received from @sc{gdb/mi}.
 
-Note the the line breaks shown in the examples are here only for
+Note the line breaks shown in the examples are here only for
 readability, they don't appear in the real output.
 
 @subheading Setting a breakpoint
@@ -18190,7 +18265,7 @@ Initialize the @var{ignore-count}.
 @item -r
 Insert a regular breakpoint in all the functions whose names match the
 given regular expression.  Other flags are not applicable to regular
-expresson.
+expressions.
 @end table
 
 @subsubheading Result
@@ -18338,12 +18413,12 @@ body=[]@}
 @end smallexample
 
 Create a watchpoint.  With the @samp{-a} option it will create an
-@dfn{access} watchpoint, i.e. a watchpoint that triggers either on a
+@dfn{access} watchpoint, i.e., a watchpoint that triggers either on a
 read from or on a write to the memory location.  With the @samp{-r}
-option, the watchpoint created is a @dfn{read} watchpoint, i.e. it will
+option, the watchpoint created is a @dfn{read} watchpoint, i.e., it will
 trigger only when the memory location is accessed for reading.  Without
 either of the options, the watchpoint created is a regular watchpoint,
-i.e. it will trigger when the memory location is accessed for writing.
+i.e., it will trigger when the memory location is accessed for writing.
 @xref{Set Watchpoints, , Setting watchpoints}.
 
 Note that @samp{-break-list} will report a single list of watchpoints and
@@ -18365,7 +18440,8 @@ Setting a watchpoint on a variable in the @code{main} function:
 (gdb)
 -exec-continue
 ^running
-^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
+(gdb)
+*stopped,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
 value=@{old="-268439212",new="55"@},
 frame=@{func="main",args=[],file="recursive2.c",
 fullname="/home/foo/bar/recursive2.c",line="5"@}
@@ -18383,7 +18459,8 @@ for the watchpoint going out of scope.
 (gdb)
 -exec-continue
 ^running
-^done,reason="watchpoint-trigger",
+(gdb)
+*stopped,reason="watchpoint-trigger",
 wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
 frame=@{func="callee4",args=[],
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
@@ -18391,7 +18468,8 @@ fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
 (gdb)
 -exec-continue
 ^running
-^done,reason="watchpoint-scope",wpnum="5",
+(gdb)
+*stopped,reason="watchpoint-scope",wpnum="5",
 frame=@{func="callee3",args=[@{name="strarg",
 value="0x11940 \"A string argument.\""@}],
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
@@ -18425,7 +18503,8 @@ enabled="y",addr="",what="C",times="0"@}]@}
 (gdb)
 -exec-continue
 ^running
-^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
+(gdb)
+*stopped,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
 value=@{old="-276895068",new="3"@},
 frame=@{func="callee4",args=[],
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
@@ -18562,7 +18641,7 @@ search path in the same order they were presented in the command.
 If blanks are needed as
 part of a directory name, double-quotes should be used around
 the name.  In the command output, the path will show up separated
-by the system directory-separator character.  The directory-seperator
+by the system directory-separator character.  The directory-separator
 character must not be used
 in any directory name.
 If no directories are specified, the current search path is displayed.
@@ -18612,7 +18691,7 @@ search path in the same order they were presented in the command.
 If blanks are needed as
 part of a directory name, double-quotes should be used around
 the name.  In the command output, the path will show up separated
-by the system directory-separator character.  The directory-seperator
+by the system directory-separator character.  The directory-separator
 character must not be used
 in any directory name.
 If no directories are specified, the current path is displayed.
@@ -19378,7 +19457,7 @@ following info:
 
 @table @samp
 @item @var{level}
-The frame number, 0 being the topmost frame, i.e. the innermost function.
+The frame number, 0 being the topmost frame, i.e., the innermost function.
 @item @var{addr}
 The @code{$pc} value for that frame.
 @item @var{func}
@@ -19479,7 +19558,7 @@ values; and if it is 2 or @code{--simple-values}, print the name,
 type and value for simple data types and the name and type for arrays,
 structures and unions.  In this last case, a frontend can immediately
 display the value of simple data types and create variable objects for
-other data types when the the user wishes to explore their values in
+other data types when the user wishes to explore their values in
 more detail.
 
 @subsubheading @value{GDBN} Command
@@ -19533,6 +19612,7 @@ The corresponding @value{GDBN} commands are @samp{frame}, @samp{up},
 @node GDB/MI Variable Objects
 @section @sc{gdb/mi} Variable Objects
 
+@ignore
 
 @subheading Motivation for Variable Objects in @sc{gdb/mi}
 
@@ -19567,26 +19647,42 @@ least, the following operations:
 @item @code{-stack-select-frame}
 @end itemize
 
-@subheading Introduction to Variable Objects in @sc{gdb/mi}
+@end ignore
+
+@subheading Introduction to Variable Objects
 
 @cindex variable objects in @sc{gdb/mi}
-The basic idea behind variable objects is the creation of a named object
-to represent a variable, an expression, a memory location or even a CPU
-register.  For each object created, a set of operations is available for
-examining or changing its properties.
-
-Furthermore, complex data types, such as C structures, are represented
-in a tree format.  For instance, the @code{struct} type variable is the
-root and the children will represent the struct members.  If a child
-is itself of a complex type, it will also have children of its own.
-Appropriate language differences are handled for C, C@t{++} and Java.
-
-When returning the actual values of the objects, this facility allows
-for the individual selection of the display format used in the result
-creation.  It can be chosen among: binary, decimal, hexadecimal, octal
-and natural.  Natural refers to a default format automatically
-chosen based on the variable type (like decimal for an @code{int}, hex
-for pointers, etc.).
+
+Variable objects are "object-oriented" MI interface for examining and
+changing values of expressions.  Unlike some other MI interfaces that
+work with expressions, variable objects are specifically designed for
+simple and efficient presentation in the frontend.  A variable object
+is identified by string name.  When a variable object is created, the
+frontend specifies the expression for that variable object.  The
+expression can be a simple variable, or it can be an arbitrary complex
+expression, and can even involve CPU registers.  After creating a
+variable object, the frontend can invoke other variable object
+operations---for example to obtain or change the value of a variable
+object, or to change display format.
+
+Variable objects have hierarchical tree structure.  Any variable object
+that corresponds to a composite type, such as structure in C, has
+a number of child variable objects, for example corresponding to each
+element of a structure.  A child variable object can itself have 
+children, recursively.  Recursion ends when we reach 
+leaf variable objects, which always have built-in types.
+
+For a leaf variable object it is possible to obtain its value as a
+string, or set the value from a string.  String value can be also
+obtained for a non-leaf variable object, but it's generally a string
+that only indicates the type of the object, and does not list its
+contents.  Assignment to a non-leaf variable object is not allowed.
+A frontend does not need to read the values of all variable objects each time
+the program stops.  Instead, MI provides an update command that lists all
+variable objects whose values has changed since the last update
+operation.  This considerably reduces the amount of data that must
+be transferred to the frontend.
 
 The following is the complete set of @sc{gdb/mi} operations defined to
 access this functionality:
@@ -19598,7 +19694,7 @@ access this functionality:
 @item @code{-var-create}
 @tab create a variable object
 @item @code{-var-delete}
-@tab delete the variable object and its children
+@tab delete the variable object and/or its children
 @item @code{-var-set-format}
 @tab set the display format of this variable
 @item @code{-var-show-format}
@@ -19681,10 +19777,11 @@ the @value{GDBN} CLI:
 @subsubheading Synopsis
 
 @smallexample
- -var-delete @var{name}
+ -var-delete [ -c ] @var{name}
 @end smallexample
 
 Deletes a previously created variable object and all of its children.
+With the @samp{-c} option, just deletes the children.
 
 Returns an error if the object @var{name} is not found.
 
@@ -19708,6 +19805,12 @@ The syntax for the @var{format-spec} is as follows:
  @{binary | decimal | hexadecimal | octal | natural@}
 @end smallexample
 
+The natural format is the default format choosen automatically
+based on the variable type (like decimal for an @code{int}, hex
+for pointers, etc.).
+
+For a variable with children, the format is set only on the 
+variable itself, and the children are not affected.  
 
 @subheading The @code{-var-show-format} Command
 @findex -var-show-format
@@ -19839,8 +19942,8 @@ where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}.
 @end smallexample
 
 Evaluates the expression that is represented by the specified variable
-object and returns its value as a string in the current format specified
-for the object:
+object and returns its value as a string.  The format of the
+string can be changed using the @code{-var-set-format} command.
 
 @smallexample
  value=@var{value}
@@ -19884,12 +19987,19 @@ subsequent @code{-var-update} list.
  -var-update [@var{print-values}] @{@var{name} | "*"@}
 @end smallexample
 
-Update the value of the variable object @var{name} by evaluating its
-expression after fetching all the new values from memory or registers.
-A @samp{*} causes all existing variable objects to be updated.  The
-option @var{print-values} determines whether names both and values, or
-just names are printed in the manner described for
-@code{-var-list-children} (@pxref{-var-list-children}).
+Reevaluate the expressions corresponding to the variable object
+@var{name} and all its direct and indirect children, and return the
+list of variable objects whose values have changed; @var{name} must
+be a root variable object.  Here, ``changed'' means that the result of
+@code{-var-evaluate-expression} before and after the
+@code{-var-update} is different.  If @samp{*} is used as the variable
+object names, all existing variable objects are updated.  The option
+@var{print-values} determines whether both names and values, or just
+names are printed.  The possible values of this options are the same
+as for @code{-var-list-children} (@pxref{-var-list-children}).  It is
+recommended to use the @samp{--all-values} option, to reduce the
+number of MI commands needed on each program stop.
+
 
 @subsubheading Example
 
@@ -19904,6 +20014,29 @@ type_changed="false"@}]
 (gdb)
 @end smallexample
 
+@anchor{-var-update} 
+The field in_scope may take three values:
+
+@table @code
+@item "true"
+The variable object's current value is valid.
+
+@item "false"
+The variable object does not currently hold a valid value but it may
+hold one in the future if its associated expression comes back into
+scope.
+
+@item "invalid"
+The variable object no longer holds a valid value.
+This can occur when the executable file being debugged has changed,
+either through recompilation or by using the @value{GDBN} @code{file}
+command.  The front end should normally choose to delete these variable
+objects.
+@end table
+
+In the future new values may be added to this list so the front should
+be prepared for this possibility.  @xref{GDB/MI Development and Front Ends, ,@sc{GDB/MI} Development and Front Ends}.
+
 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 @node GDB/MI Data Manipulation
 @section @sc{gdb/mi} Data Manipulation
@@ -19946,7 +20079,7 @@ is the name of the file to disassemble
 @item @var{linenum}
 is the line number to disassemble around
 @item @var{lines}
-is the the number of disassembly lines to be produced.  If it is -1,
+is the number of disassembly lines to be produced.  If it is -1,
 the whole function will be disassembled, in case no @var{end-addr} is
 specified.  If @var{end-addr} is specified as a non-zero value, and
 @var{lines} is lower than the number of disassembly lines between
@@ -19971,7 +20104,7 @@ The output for each instruction is composed of four fields:
 @end itemize
 
 Note that whatever included in the instruction field, is not manipulated
-directely by @sc{gdb/mi}, i.e. it is not possible to adjust its format.
+directly by @sc{gdb/mi}, i.e., it is not possible to adjust its format.
 
 @subsubheading @value{GDBN} Command
 
@@ -20954,9 +21087,9 @@ The corresponding @value{GDBN} command is @samp{detach}.
 
 @subsubheading Synopsis
 
-@example
+@smallexample
  -target-disconnect
-@end example
+@end smallexample
 
 Disconnect from the remote target.  There's no output and the target is
 generally not resumed.
@@ -21415,6 +21548,50 @@ The corresponding @value{GDBN} command is @samp{show inferior-tty}.
 (gdb)
 @end smallexample
 
+@subheading The @code{-enable-timings} Command
+@findex -enable-timings
+
+@subheading Synopsis
+
+@smallexample
+-enable-timings [yes | no]
+@end smallexample
+
+Toggle the printing of the wallclock, user and system times for an MI
+command as a field in its output.  This command is to help frontend
+developers optimize the performance of their code.  No argument is
+equivalent to @samp{yes}.
+
+@subheading @value{GDBN} Command
+
+No equivalent.
+
+@subheading Example
+
+@smallexample
+(gdb)
+-enable-timings
+^done
+(gdb)
+-break-insert main
+^done,bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+addr="0x080484ed",func="main",file="myprog.c",
+fullname="/home/nickrob/myprog.c",line="73",times="0"@},
+time=@{wallclock="0.05185",user="0.00800",system="0.00000"@}
+(gdb)
+-enable-timings no
+^done
+(gdb)
+-exec-run
+^running
+(gdb)
+*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",
+frame=@{addr="0x080484ed",func="main",args=[@{name="argc",value="1"@},
+@{name="argv",value="0xbfb60364"@}],file="myprog.c",
+fullname="/home/nickrob/myprog.c",line="73"@}
+(gdb)
+@end smallexample
+
 @node Annotations
 @chapter @value{GDBN} Annotations
 
@@ -21423,7 +21600,7 @@ designed to interface @value{GDBN} to graphical user interfaces or other
 similar programs which want to interact with @value{GDBN} at a
 relatively high level.
 
-The annotation mechanism has largely been superseeded by @sc{gdb/mi}
+The annotation mechanism has largely been superseded by @sc{gdb/mi}
 (@pxref{GDB/MI}).
 
 @ignore
@@ -21463,7 +21640,7 @@ The annotation @var{level}, which is specified using the
 @option{--annotate} command line option (@pxref{Mode Options}), controls
 how much information @value{GDBN} prints together with its prompt,
 values of expressions, source lines, and other types of output.  Level 0
-is for no anntations, level 1 is for use when @value{GDBN} is run as a
+is for no annotations, level 1 is for use when @value{GDBN} is run as a
 subprocess of @sc{gnu} Emacs, level 3 is the maximum annotation suitable
 for programs that control @value{GDBN}, and level 2 annotations have
 been made obsolete (@pxref{Limitations, , Limitations of the Annotation
@@ -21792,7 +21969,7 @@ distribution.
 @c should add a web page ref...
 
 In any event, we also recommend that you submit bug reports for
-@value{GDBN}.  The prefered method is to submit them directly using
+@value{GDBN}.  The preferred 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.
@@ -21857,7 +22034,7 @@ What compiler (and its version) was used to compile @value{GDBN}---e.g.@:
 @item
 What compiler (and its version) was used to compile the program you are
 debugging---e.g.@:  ``@value{GCC}--2.8.1'', or ``HP92453-01 A.10.32.03 HP
-C Compiler''.  For GCC, you can say @code{gcc --version} to get this
+C Compiler''.  For @value{NGCC}, you can say @kbd{gcc --version} to get this
 information; for other compilers, see the documentation for those
 compilers.
 
@@ -22045,7 +22222,7 @@ and is located in the @file{gdb-@var{version-number}/texinfo}
 directory.
 
 If you have @TeX{} and a @sc{dvi} printer program installed, you can
-typeset and print this manual.  First switch to the the @file{gdb}
+typeset and print this manual.  First switch to the @file{gdb}
 subdirectory of the main source directory (for example, to
 @file{gdb-@value{GDBVN}/gdb}) and type:
 
@@ -22085,6 +22262,7 @@ working C90 compiler, e.g.@: GCC.
 @heading Tools/packages optional for building @value{GDBN}
 @table @asis
 @item Expat
+@anchor{Expat}
 @value{GDBN} can use the Expat XML parsing library.  This library may be
 included with your operating system distribution; if it is not, you
 can get the latest version from @url{http://expat.sourceforge.net}.
@@ -22092,8 +22270,8 @@ The @code{configure} script will search for this library in several
 standard locations; if it is installed in an unusual path, you can
 use the @option{--with-libexpat-prefix} option to specify its location.
 
-Expat is used currently only used to implement some remote-specific
-features.
+Expat is used for remote protocol memory maps (@pxref{Memory map format})
+and for target descriptions (@pxref{Target Descriptions}).
 
 @end table
 
@@ -22448,7 +22626,7 @@ Print the list of possible C@t{++} namespaces.
 
 @kindex maint demangle
 @item maint demangle @var{name}
-Demangle a C@t{++} or Objective-C manled @var{name}.
+Demangle a C@t{++} or Objective-C mangled @var{name}.
 
 @kindex maint deprecate
 @kindex maint undeprecate
@@ -22482,7 +22660,7 @@ either quit @value{GDBN} or create a core file of the current
 These commands take an optional parameter @var{message-text} that is
 used as the text of the error or warning message.
 
-Here's an example of using @code{indernal-error}:
+Here's an example of using @code{internal-error}:
 
 @smallexample
 (@value{GDBP}) @kbd{maint internal-error testing, 1, 2}
@@ -22585,7 +22763,7 @@ and symtabs.
 This command prints, for each object file in the program, various data
 about that object file followed by the byte cache (@dfn{bcache})
 statistics for the object file.  The objfile data includes the number
-of minimal, partical, full, and stabs symbols, the number of types
+of minimal, partial, full, and stabs symbols, the number of types
 defined by the objfile, the number of as yet unexpanded psym tables,
 the number of line tables and string tables, and the amount of memory
 used by the various tables.  The bcache statistics include the counts,
@@ -22594,6 +22772,19 @@ average, and median entry size, total memory used and its overhead and
 savings, and various measures of the hash table size and chain
 lengths.
 
+@kindex maint print target-stack
+@cindex target stack description
+@item maint print target-stack
+A @dfn{target} is an interface between the debugger and a particular
+kind of file or process.  Targets can be stacked in @dfn{strata},
+so that more than one target can potentially respond to a request.
+In particular, memory accesses will walk down the stack of targets
+until they find a target that is interested in handling that particular
+address.
+
+This command prints a short description of each layer that was pushed on
+the @dfn{target stack}, starting from the top layer down to the bottom one.
+
 @kindex maint print type
 @cindex type chain of a data type
 @item maint print type @var{expr}
@@ -23192,7 +23383,7 @@ Reply:
 
 @item vCont?
 @cindex @samp{vCont?} packet
-Request a list of actions supporetd by the @samp{vCont} packet.
+Request a list of actions supported by the @samp{vCont} packet.
 
 Reply:
 @table @samp
@@ -23658,6 +23849,7 @@ Reply: see @code{remote.c:remote_unpack_thread_info_response()}.
 @item QPassSignals: @var{signal} @r{[};@var{signal}@r{]}@dots{}
 @cindex pass signals to inferior, remote request
 @cindex @samp{QPassSignals} packet
+@anchor{QPassSignals}
 Each listed @var{signal} should be passed directly to the inferior process. 
 Signals are numbered identically to continue packets and stop replies
 (@pxref{Stop Reply Packets}).  Each @var{signal} list item should be
@@ -23824,6 +24016,11 @@ These are the currently defined stub features and their properties:
 @tab @samp{-}
 @tab Yes
 
+@item @samp{qXfer:features:read}
+@tab No
+@tab @samp{-}
+@tab Yes
+
 @item @samp{qXfer:memory-map:read}
 @tab No
 @tab @samp{-}
@@ -23854,6 +24051,18 @@ byte in its buffer for the NUL.  If this stub feature is not supported,
 The remote stub understands the @samp{qXfer:auxv:read} packet
 (@pxref{qXfer auxiliary vector read}).
 
+@item qXfer:features:read
+The remote stub understands the @samp{qXfer:features:read} packet
+(@pxref{qXfer target description read}).
+
+@item qXfer:memory-map:read
+The remote stub understands the @samp{qXfer:memory-map:read} packet
+(@pxref{qXfer memory map read}).
+
+@item QPassSignals
+The remote stub understands the @samp{QPassSignals} packet
+(@pxref{QPassSignals}).
+
 @end table
 
 @item qSymbol::
@@ -23950,9 +24159,16 @@ auxiliary vector}.  Note @var{annex} must be empty.
 
 This packet is not probed by default; the remote stub must request it,
 by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}).
-@end table
 
-@table @samp
+@item qXfer:features:read:@var{annex}:@var{offset},@var{length}
+@anchor{qXfer target description read}
+Access the @dfn{target description}.  @xref{Target Descriptions}.  The
+annex specifies which XML document to access.  The main description is
+always loaded from the @samp{target.xml} annex.
+
+This packet is not probed by default; the remote stub must request it,
+by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}).
+
 @item qXfer:memory-map:read::@var{offset},@var{length}
 @anchor{qXfer memory map read}
 Access the target's @dfn{memory-map}.  @xref{Memory map format}.  The
@@ -24526,7 +24742,7 @@ or the full action has been completed.
 @subsection Console I/O
 @cindex console i/o as part of file-i/o
 
-By default and if not explicitely closed by the target system, the file
+By default and if not explicitly closed by the target system, the file
 descriptors 0, 1 and 2 are connected to the @value{GDBN} console.  Output
 on the @value{GDBN} console is handled as any other file output operation
 (@code{write(1, @dots{})} or @code{write(2, @dots{})}).  Console input is handled
@@ -25527,6 +25743,372 @@ The formal DTD for memory map format is given below:
 
 @include agentexpr.texi
 
+@node Target Descriptions
+@appendix Target Descriptions
+@cindex target descriptions
+
+@strong{Warning:} target descriptions are still under active development,
+and the contents and format may change between @value{GDBN} releases.
+The format is expected to stabilize in the future.
+
+One of the challenges of using @value{GDBN} to debug embedded systems
+is that there are so many minor variants of each processor
+architecture in use.  It is common practice for vendors to start with
+a standard processor core --- ARM, PowerPC, or MIPS, for example ---
+and then make changes to adapt it to a particular market niche.  Some
+architectures have hundreds of variants, available from dozens of
+vendors.  This leads to a number of problems:
+
+@itemize @bullet
+@item
+With so many different customized processors, it is difficult for
+the @value{GDBN} maintainers to keep up with the changes.
+@item
+Since individual variants may have short lifetimes or limited
+audiences, it may not be worthwhile to carry information about every
+variant in the @value{GDBN} source tree.
+@item
+When @value{GDBN} does support the architecture of the embedded system
+at hand, the task of finding the correct architecture name to give the
+@command{set architecture} command can be error-prone.
+@end itemize
+
+To address these problems, the @value{GDBN} remote protocol allows a
+target system to not only identify itself to @value{GDBN}, but to
+actually describe its own features.  This lets @value{GDBN} support
+processor variants it has never seen before --- to the extent that the
+descriptions are accurate, and that @value{GDBN} understands them.
+
+@value{GDBN} must be compiled with Expat support to support XML target
+descriptions.  @xref{Expat}.
+
+@menu
+* Retrieving Descriptions::         How descriptions are fetched from a target.
+* Target Description Format::       The contents of a target description.
+* Predefined Target Types::         Standard types available for target
+                                    descriptions.
+* Standard Target Features::        Features @value{GDBN} knows about.
+@end menu
+
+@node Retrieving Descriptions
+@section Retrieving Descriptions
+
+Target descriptions can be read from the target automatically, or
+specified by the user manually.  The default behavior is to read the
+description from the target.  @value{GDBN} retrieves it via the remote
+protocol using @samp{qXfer} requests (@pxref{General Query Packets,
+qXfer}).  The @var{annex} in the @samp{qXfer} packet will be
+@samp{target.xml}.  The contents of the @samp{target.xml} annex are an
+XML document, of the form described in @ref{Target Description
+Format}.
+
+Alternatively, you can specify a file to read for the target description.
+If a file is set, the target will not be queried.  The commands to
+specify a file are:
+
+@table @code
+@cindex set tdesc filename
+@item set tdesc filename @var{path}
+Read the target description from @var{path}.
+
+@cindex unset tdesc filename
+@item unset tdesc filename
+Do not read the XML target description from a file.  @value{GDBN}
+will use the description supplied by the current target.
+
+@cindex show tdesc filename
+@item show tdesc filename
+Show the filename to read for a target description, if any.
+@end table
+
+
+@node Target Description Format
+@section Target Description Format
+@cindex target descriptions, XML format
+
+A target description annex is an @uref{http://www.w3.org/XML/, XML}
+document which complies with the Document Type Definition provided in
+the @value{GDBN} sources in @file{gdb/features/gdb-target.dtd}.  This
+means you can use generally available tools like @command{xmllint} to
+check that your feature descriptions are well-formed and valid.
+However, to help people unfamiliar with XML write descriptions for
+their targets, we also describe the grammar here.
+
+Target descriptions can identify the architecture of the remote target
+and (for some architectures) provide information about custom register
+sets.  @value{GDBN} can use this information to autoconfigure for your
+target, or to warn you if you connect to an unsupported target.
+
+Here is a simple target description:
+
+@smallexample
+<target>
+  <architecture>i386:x86-64</architecture>
+</target>
+@end smallexample
+
+@noindent
+This minimal description only says that the target uses
+the x86-64 architecture.
+
+A target description has the following overall form, with [ ] marking
+optional elements and @dots{} marking repeatable elements.  The elements
+are explained further below.
+
+@smallexample
+<?xml version="1.0"?>
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+  @r{[}@var{architecture}@r{]}
+  @r{[}@var{feature}@dots{}@r{]}
+</target>
+@end smallexample
+
+@noindent
+The description is generally insensitive to whitespace and line
+breaks, under the usual common-sense rules.  The XML version
+declaration and document type declaration can generally be omitted
+(@value{GDBN} does not require them), but specifying them may be
+useful for XML validation tools.
+
+@subsection Inclusion
+@cindex target descriptions, inclusion
+@cindex XInclude
+@ifnotinfo
+@cindex <xi:include>
+@end ifnotinfo
+
+It can sometimes be valuable to split a target description up into
+several different annexes, either for organizational purposes, or to
+share files between different possible target descriptions.  You can
+divide a description into multiple files by replacing any element of
+the target description with an inclusion directive of the form:
+
+@smallexample
+<xi:include href="@var{document}"/>
+@end smallexample
+
+@noindent
+When @value{GDBN} encounters an element of this form, it will retrieve
+the named XML @var{document}, and replace the inclusion directive with
+the contents of that document.  If the current description was read
+using @samp{qXfer}, then so will be the included document;
+@var{document} will be interpreted as the name of an annex.  If the
+current description was read from a file, @value{GDBN} will look for
+@var{document} as a file in the same directory where it found the
+original description.
+
+@subsection Architecture
+@cindex <architecture>
+
+An @samp{<architecture>} element has this form:
+
+@smallexample
+  <architecture>@var{arch}</architecture>
+@end smallexample
+
+@var{arch} is an architecture name from the same selection
+accepted by @code{set architecture} (@pxref{Targets, ,Specifying a
+Debugging Target}).
+
+@subsection Features
+@cindex <feature>
+
+Each @samp{<feature>} describes some logical portion of the target
+system.  Features are currently used to describe available CPU
+registers and the types of their contents.  A @samp{<feature>} element
+has this form:
+
+@smallexample
+<feature name="@var{name}">
+  @r{[}@var{type}@dots{}@r{]}
+  @var{reg}@dots{}
+</feature>
+@end smallexample
+
+@noindent
+Each feature's name should be unique within the description.  The name
+of a feature does not matter unless @value{GDBN} has some special
+knowledge of the contents of that feature; if it does, the feature
+should have its standard name.  @xref{Standard Target Features}.
+
+@subsection Types
+
+Any register's value is a collection of bits which @value{GDBN} must
+interpret.  The default interpretation is a two's complement integer,
+but other types can be requested by name in the register description.
+Some predefined types are provided by @value{GDBN} (@pxref{Predefined
+Target Types}), and the description can define additional composite types.
+
+Each type element must have an @samp{id} attribute, which gives
+a unique (within the containing @samp{<feature>}) name to the type.
+Types must be defined before they are used.
+
+@cindex <vector>
+Some targets offer vector registers, which can be treated as arrays
+of scalar elements.  These types are written as @samp{<vector>} elements,
+specifying the array element type, @var{type}, and the number of elements,
+@var{count}:
+
+@smallexample
+<vector id="@var{id}" type="@var{type}" count="@var{count}"/>
+@end smallexample
+
+@cindex <union>
+If a register's value is usefully viewed in multiple ways, define it
+with a union type containing the useful representations.  The
+@samp{<union>} element contains one or more @samp{<field>} elements,
+each of which has a @var{name} and a @var{type}:
+
+@smallexample
+<union id="@var{id}">
+  <field name="@var{name}" type="@var{type}"/>
+  @dots{}
+</union>
+@end smallexample
+
+@subsection Registers
+@cindex <reg>
+
+Each register is represented as an element with this form:
+
+@smallexample
+<reg name="@var{name}"
+     bitsize="@var{size}"
+     @r{[}regnum="@var{num}"@r{]}
+     @r{[}save-restore="@var{save-restore}"@r{]}
+     @r{[}type="@var{type}"@r{]}
+     @r{[}group="@var{group}"@r{]}/>
+@end smallexample
+
+@noindent
+The components are as follows:
+
+@table @var
+
+@item name
+The register's name; it must be unique within the target description.
+
+@item bitsize
+The register's size, in bits.
+
+@item regnum
+The register's number.  If omitted, a register's number is one greater
+than that of the previous register (either in the current feature or in
+a preceeding feature); the first register in the target description
+defaults to zero.  This register number is used to read or write
+the register; e.g.@: it is used in the remote @code{p} and @code{P}
+packets, and registers appear in the @code{g} and @code{G} packets
+in order of increasing register number.
+
+@item save-restore
+Whether the register should be preserved across inferior function
+calls; this must be either @code{yes} or @code{no}.  The default is
+@code{yes}, which is appropriate for most registers except for
+some system control registers; this is not related to the target's
+ABI.
+
+@item type
+The type of the register.  @var{type} may be a predefined type, a type
+defined in the current feature, or one of the special types @code{int}
+and @code{float}.  @code{int} is an integer type of the correct size
+for @var{bitsize}, and @code{float} is a floating point type (in the
+architecture's normal floating point format) of the correct size for
+@var{bitsize}.  The default is @code{int}.
+
+@item group
+The register group to which this register belongs.  @var{group} must
+be either @code{general}, @code{float}, or @code{vector}.  If no
+@var{group} is specified, @value{GDBN} will not display the register
+in @code{info registers}.
+
+@end table
+
+@node Predefined Target Types
+@section Predefined Target Types
+@cindex target descriptions, predefined types
+
+Type definitions in the self-description can build up composite types
+from basic building blocks, but can not define fundamental types.  Instead,
+standard identifiers are provided by @value{GDBN} for the fundamental
+types.  The currently supported types are:
+
+@table @code
+
+@item int8
+@itemx int16
+@itemx int32
+@itemx int64
+Signed integer types holding the specified number of bits.
+
+@item uint8
+@itemx uint16
+@itemx uint32
+@itemx uint64
+Unsigned integer types holding the specified number of bits.
+
+@item code_ptr
+@itemx data_ptr
+Pointers to unspecified code and data.  The program counter and
+any dedicated return address register may be marked as code
+pointers; printing a code pointer converts it into a symbolic
+address.  The stack pointer and any dedicated address registers
+may be marked as data pointers.
+
+@item arm_fpa_ext
+The 12-byte extended precision format used by ARM FPA registers.
+
+@end table
+
+@node Standard Target Features
+@section Standard Target Features
+@cindex target descriptions, standard features
+
+A target description must contain either no registers or all the
+target's registers.  If the description contains no registers, then
+@value{GDBN} will assume a default register layout, selected based on
+the architecture.  If the description contains any registers, the
+default layout will not be used; the standard registers must be
+described in the target description, in such a way that @value{GDBN}
+can recognize them.
+
+This is accomplished by giving specific names to feature elements
+which contain standard registers.  @value{GDBN} will look for features
+with those names and verify that they contain the expected registers;
+if any known feature is missing required registers, or if any required
+feature is missing, @value{GDBN} will reject the target
+description.  You can add additional registers to any of the
+standard features --- @value{GDBN} will display them just as if
+they were added to an unrecognized feature.
+
+This section lists the known features and their expected contents.
+Sample XML documents for these features are included in the
+@value{GDBN} source tree, in the directory @file{gdb/features}.
+
+Names recognized by @value{GDBN} should include the name of the
+company or organization which selected the name, and the overall
+architecture to which the feature applies; so e.g.@: the feature
+containing ARM core registers is named @samp{org.gnu.gdb.arm.core}.
+
+The names of registers are not case sensitive for the purpose
+of recognizing standard features, but @value{GDBN} will only display
+registers using the capitalization used in the description.
+
+@subsection ARM Features
+@cindex target descriptions, ARM features
+
+The @samp{org.gnu.gdb.arm.core} feature is required for ARM targets.
+It should contain registers @samp{r0} through @samp{r13}, @samp{sp},
+@samp{lr}, @samp{pc}, and @samp{cpsr}.
+
+The @samp{org.gnu.gdb.arm.fpa} feature is optional.  If present, it
+should contain registers @samp{f0} through @samp{f7} and @samp{fps}.
+
+The @samp{org.gnu.gdb.xscale.iwmmxt} feature is optional.  If present,
+it should contain at least registers @samp{wR0} through @samp{wR15} and
+@samp{wCGR0} through @samp{wCGR3}.  The @samp{wCID}, @samp{wCon},
+@samp{wCSSF}, and @samp{wCASF} registers are optional.
+
 @include gpl.texi
 
 @raisesections
This page took 0.053398 seconds and 4 git commands to generate.