Thomas, Michael Tiemann, Tom Tromey, Ron Unrau, Jim Wilson, and David
Zuhn have made contributions both large and small.
+Andrew Cagney, Fernando Nasser, and Elena Zannoni, while working for
+Cygnus Solutions, implemented the original @sc{gdb/mi} interface.
+
Jim Blandy added support for preprocessor macros, while working for Red
Hat.
+Andrew Cagney designed @value{GDBN}'s architecture vector. Many
+people including Andrew Cagney, Stephane Carrez, Randolph Chung, Nick
+Duffek, Richard Henderson, Mark Kettenis, Grace Sainsbury, Kei
+Sakamoto, Yoshinori Sato, Michael Snyder, Andreas Schwab, Jason
+Thorpe, Corinna Vinschen, Ulrich Weigand, and Elena Zannoni, helped
+with the migration of old architectures to this new framework.
+
@node Sample Session
@chapter A Sample @value{GDBN} Session
@cindex @code{-d}
Add @var{directory} to the path to search for source files.
-@item -m
-@itemx -mapped
-@cindex @code{--mapped}
-@cindex @code{-m}
-@emph{Warning: this option depends on operating system facilities that are not
-supported on all systems.}@*
-If memory-mapped files are available on your system through the @code{mmap}
-system call, you can use this option
-to have @value{GDBN} write the symbols from your
-program into a reusable file in the current directory. If the program you are debugging is
-called @file{/tmp/fred}, the mapped symbol file is @file{/tmp/fred.syms}.
-Future @value{GDBN} debugging sessions notice the presence of this file,
-and can quickly map in symbol information from it, rather than reading
-the symbol table from the executable program.
-
-The @file{.syms} file is specific to the host machine where @value{GDBN}
-is run. It holds an exact image of the internal @value{GDBN} symbol
-table. It cannot be shared across multiple host platforms.
-
@item -r
@itemx -readnow
@cindex @code{--readnow}
@end table
-You typically combine the @code{-mapped} and @code{-readnow} options in
-order to build a @file{.syms} file that contains complete symbol
-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:
-
-@smallexample
-gdb -batch -nx -mapped -readnow programname
-@end smallexample
-
@node Mode Options
@subsection Choosing modes
@sc{gnu} Emacs, level 3 is the maximum annotation suitable for programs
that control @value{GDBN}, and level 2 has been deprecated.
-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}).
@item --args
@item
Reads the command history recorded in the @dfn{history file}.
-@xref{History}, for more details about the command history and the
+@xref{Command History}, for more details about the command history and the
files where @value{GDBN} records it.
@end enumerate
When you use the @code{tty} command or redirect input in the @code{run}
command, only the input @emph{for your program} is affected. The input
-for @value{GDBN} still comes from your terminal.
+for @value{GDBN} still comes from your terminal. @code{tty} is an alias
+for @code{set inferior-tty}.
+
+@cindex inferior tty
+@cindex set inferior controlling terminal
+You can use the @code{show inferior-tty} command to tell @value{GDBN} to
+display the name of the terminal that will be used for future runs of your
+program.
+
+@table @code
+@item set inferior-tty /dev/ttyb
+@kindex set inferior-tty
+Set the tty for the program being debugged to /dev/ttyb.
+
+@item show inferior-tty
+@kindex show inferior-tty
+Show the current tty for the program being debugged.
+@end table
@node Attach
@section Debugging an already-running process
threads.
@kindex thread apply
+@cindex apply command to several threads
@item thread apply [@var{threadno}] [@var{all}] @var{args}
The @code{thread apply} command allows you to apply a command to one or
more threads. Specify the numbers of the threads that you want affected
executes more slowly and reports the change in value at the next
@emph{statement}, not the instruction, after the change occurs.
-@vindex can-use-hw-watchpoints
@cindex use only software watchpoints
You can force @value{GDBN} to use only software watchpoints with the
@kbd{set can-use-hw-watchpoints 0} command. With this variable set to
stack frame consists of many bytes, each of which has its own address; each
kind of computer has a convention for choosing one byte whose
address serves as the address of the frame. Usually this address is kept
-in a register called the @dfn{frame pointer register} while execution is
-going on in that frame.
+in a register called the @dfn{frame pointer register}
+(@pxref{Registers, $fp}) while execution is going on in that frame.
@cindex frame number
@value{GDBN} assigns numbers to all existing stack frames, starting with
@cindex startup code, and backtrace
Most programs have a standard user entry point---a place where system
libraries and startup code transition into user code. For C this is
-@code{main}. When @value{GDBN} finds the entry function in a backtrace
+@code{main}@footnote{
+Note that embedded programs (the so-called ``free-standing''
+environment) are not required to have a @code{main} function as the
+entry point. They could even have multiple entry points.}.
+When @value{GDBN} finds the entry function in a backtrace
it will terminate the backtrace, to avoid tracing into highly
system-specific (and generally uninteresting) code.
On the 29k architecture, it needs three addresses: a register stack
pointer, a program counter, and a memory stack pointer.
-@c note to future updaters: this is conditioned on a flag
-@c SETUP_ARBITRARY_FRAME in the tm-*.h files. The above is up to date
-@c as of 27 Jan 1994.
@kindex up
@item up @var{n}
Some architectures have more than one commonly-used set of instruction
mnemonics or other syntax.
+For programs that were dynamically linked and use shared libraries,
+instructions that call functions or branch to locations in the shared
+libraries might show a seemingly bogus location---it's actually a
+location of the relocation table. On some architectures, @value{GDBN}
+might be able to resolve these to actual function names.
+
@table @code
@kindex set disassembly-flavor
@cindex Intel disassembly flavor
@xref{C, , Debugging C++}, for more info about debug info formats
that are best suited to C@t{++} programs.
+If you ask to print an object whose contents are unknown to
+@value{GDBN}, e.g., because its data type is not completely specified
+by the debug information, @value{GDBN} will say @samp{<incomplete
+type>}. @xref{Symbols, incomplete type}, for more about this.
+
@node Arrays
@section Artificial arrays
@xref{Symbols, info symbol}.
@item c
-Regard as an integer and print it as a character constant.
+Regard as an integer and print it as a character constant. This
+prints both the numerical value and its character representation. The
+character representation is replaced with the octal escape @samp{\nnn}
+for characters outside the 7-bit @sc{ascii} range.
@item f
Regard the bits of the value as a floating point number and print
@c 4.1.2.
@item @var{f}, the display format
-The display format is one of the formats used by @code{print},
-@samp{s} (null-terminated string), or @samp{i} (machine instruction).
-The default is @samp{x} (hexadecimal) initially.
-The default changes each time you use either @code{x} or @code{print}.
+The display format is one of the formats used by @code{print}
+(@samp{x}, @samp{d}, @samp{u}, @samp{o}, @samp{t}, @samp{a}, @samp{c},
+@samp{f}), and in addition @samp{s} (for null-terminated strings) and
+@samp{i} (for machine instructions). The default is @samp{x}
+(hexadecimal) initially. The default changes each time you use either
+@code{x} or @code{print}.
@item @var{u}, the unit size
The unit size is any of
the machine you are using, with or without the initial @samp{$}.
@end table
+@cindex stack pointer register
+@cindex program counter register
+@cindex process status register
+@cindex frame pointer register
+@cindex standard registers
@value{GDBN} has four ``standard'' register names that are available (in
expressions) on most machines---whenever they do not conflict with an
architecture's canonical mnemonics for registers. The register names
As with @code{whatis}, using @code{ptype} without an argument refers to
the type of @code{$}, the last value in the value history.
+@cindex incomplete type
+Sometimes, programs use opaque data types or incomplete specifications
+of complex data structure. If the debug information included in the
+program does not allow @value{GDBN} to display a full declaration of
+the data type, it will say @samp{<incomplete type>}. For example,
+given these declarations:
+
+@smallexample
+ struct foo;
+ struct foo *fooptr;
+@end smallexample
+
+@noindent
+but no definition for @code{struct foo} itself, @value{GDBN} will say:
+
+@smallexample
+ (gdb) ptype foo
+ $1 = <incomplete type>
+@end smallexample
+
+@noindent
+``Incomplete type'' is C terminology for data types that are not
+completely specified.
+
@kindex info types
@item info types @var{regexp}
@itemx info types
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. In these situations the @value{GDBN} commands
-to specify new files are useful.
+@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.
@table @code
@cindex executable file
to run. You can change the value of this variable, for both @value{GDBN}
and your program, using the @code{path} command.
-On systems with memory-mapped files, an auxiliary file named
-@file{@var{filename}.syms} may hold symbol table information for
-@var{filename}. If so, @value{GDBN} maps in the symbol table from
-@file{@var{filename}.syms}, starting up more quickly. See the
-descriptions of the file options @samp{-mapped} and @samp{-readnow}
-(available on the command line, see @ref{File Options, , -readnow},
-and with the commands @code{file}, @code{symbol-file}, or
-@code{add-symbol-file}, described below), for more information.
+@cindex unlinked object files
+@cindex patching object files
+You can load unlinked object @file{.o} files into @value{GDBN} using
+the @code{file} command. You will not be able to ``run'' an object
+file, but you can disassemble functions and inspect variables. Also,
+if the underlying BFD functionality supports it, you could use
+@kbd{gdb -write} to patch object files using this technique. Note
+that @value{GDBN} can neither interpret nor modify relocations in this
+case, so branches and some initialized variables will appear to go to
+the wrong place. But this feature is still handy from time to time.
@item file
@code{file} with no argument makes @value{GDBN} discard any information it
@kindex readnow
@cindex reading symbols immediately
@cindex symbols, reading immediately
-@kindex mapped
-@cindex memory-mapped symbol file
-@cindex saving symbol table
-@item symbol-file @var{filename} @r{[} -readnow @r{]} @r{[} -mapped @r{]}
-@itemx file @var{filename} @r{[} -readnow @r{]} @r{[} -mapped @r{]}
+@item symbol-file @var{filename} @r{[} -readnow @r{]}
+@itemx file @var{filename} @r{[} -readnow @r{]}
You can override the @value{GDBN} two-stage strategy for reading symbol
tables by using the @samp{-readnow} option with any of the commands that
load symbol table information, if you want to be sure @value{GDBN} has the
entire symbol table available.
-If memory-mapped files are available on your system through the
-@code{mmap} system call, you can use another option, @samp{-mapped}, to
-cause @value{GDBN} to write the symbols for your program into a reusable
-file. Future @value{GDBN} debugging sessions map in symbol information
-from this auxiliary symbol file (if the program has not changed), rather
-than spending time reading the symbol table from the executable
-program. Using the @samp{-mapped} option has the same effect as
-starting @value{GDBN} with the @samp{-mapped} command-line option.
-
-You can use both options together, to make sure the auxiliary symbol
-file has all the symbol information for your program.
-
-The auxiliary symbol file for a program called @var{myprog} is called
-@samp{@var{myprog}.syms}. Once this file exists (so long as it is newer
-than the corresponding executable), @value{GDBN} always attempts to use
-it when you debug @var{myprog}; no special options or commands are
-needed.
-
-The @file{.syms} file is specific to the host machine where you run
-@value{GDBN}. It holds an exact image of the internal @value{GDBN}
-symbol table. It cannot be shared across multiple host platforms.
-
@c FIXME: for now no mention of directories, since this seems to be in
@c flux. 13mar1992 status is that in theory GDB would look either in
@c current dir or in same dir as myprog; but issues like competing
@kindex add-symbol-file
@cindex dynamic linking
@item add-symbol-file @var{filename} @var{address}
-@itemx add-symbol-file @var{filename} @var{address} @r{[} -readnow @r{]} @r{[} -mapped @r{]}
+@itemx add-symbol-file @var{filename} @var{address} @r{[} -readnow @r{]}
@itemx add-symbol-file @var{filename} @r{-s}@var{section} @var{address} @dots{}
The @code{add-symbol-file} command reads additional symbol table
information from the file @var{filename}. You would use this command
@code{add-symbol-file} does not repeat if you press @key{RET} after using it.
-You can use the @samp{-mapped} and @samp{-readnow} options just as with
-the @code{symbol-file} command, to change how @value{GDBN} manages the symbol
-table information for @var{filename}.
-
@kindex add-symbol-file-from-memory
@cindex @code{syscall DSO}
@cindex load symbols from memory
copies on the target can be stripped as long as the copies on the host are
not.
-You need to tell @value{GDBN} where the target libraries are, so that it can
-load the correct copies---otherwise, it may try to load the host's libraries.
-@value{GDBN} has two variables to specify the search directories for target
-libraries.
+@cindex where to look for shared libraries
+For remote debugging, you need to tell @value{GDBN} where the target
+libraries are, so that it can load the correct copies---otherwise, it
+may try to load the host's libraries. @value{GDBN} has two variables
+to specify the search directories for target libraries.
@table @code
+@cindex prefix for shared library file names
@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
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}
+@cindex @samp{--with-sysroot}
You can set the default value of @samp{solib-absolute-prefix} by using the
configure-time @samp{--with-sysroot} option.
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 gdbserver, since the program is
-already on the target.
+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.
@end table
@table @code
@item set cris-version @var{ver}
@cindex CRIS version
-Set the current CRIS version to @var{ver}. The CRIS version affects
-register names and sizes. This command is useful in case
-autodetection of the CRIS version fails.
+Set the current CRIS version to @var{ver}, either @samp{10} or @samp{32}.
+The CRIS version affects register names and sizes. This command is useful in
+case autodetection of the CRIS version fails.
@item show cris-version
Show the current CRIS version.
@item set cris-dwarf2-cfi
@cindex DWARF-2 CFI and CRIS
-Set the usage of DWARF-2 CFI for CRIS debugging. The default is off
-if using @code{gcc-cris} whose version is below @code{R59}, otherwise
-on.
+Set the usage of DWARF-2 CFI for CRIS debugging. The default is @samp{on}.
+Change to @samp{off} when using @code{gcc-cris} whose version is below
+@code{R59}.
@item show cris-dwarf2-cfi
Show the current state of using DWARF-2 CFI.
+
+@item set cris-mode @var{mode}
+@cindex CRIS mode
+Set the current CRIS mode to @var{mode}. It should only be changed when
+debugging in guru mode, in which case it should be set to
+@samp{guru} (the default is @samp{normal}).
+
+@item show cris-mode
+Show the current CRIS mode.
@end table
@node Super-H
@menu
* Prompt:: Prompt
* Editing:: Command editing
-* History:: Command history
+* Command History:: Command history
* Screen Size:: Screen size
* Numbers:: Numbers
* ABI:: Configuring the current ABI
interface. Users unfamiliar with @sc{gnu} Emacs or @code{vi} are
encouraged to read that chapter.
-@node History
+@node Command History
@section Command history
@cindex command history
package, to provide the history facility. @xref{Using History
Interactively}, for the detailed description of the History library.
+To issue a command to @value{GDBN} without affecting certain aspects of
+the state which is seen by users, prefix it with @samp{server }. This
+means that this command will not affect the command history, nor will it
+affect @value{GDBN}'s notion of which command to repeat if @key{RET} is
+pressed on a line by itself.
+
+@cindex @code{server}, command prefix
+The server prefix does not affect the recording of values into the value
+history; to print a value without recording it into the value history,
+use the @code{output} command instead of the @code{print} command.
+
Here is the description of @value{GDBN} commands related to command
history.
You can always enter numbers in octal, decimal, or hexadecimal in
@value{GDBN} by the usual conventions: octal numbers begin with
@samp{0}, decimal numbers end with @samp{.}, and hexadecimal numbers
-begin with @samp{0x}. Numbers that begin with none of these are, by
-default, entered in base 10; likewise, the default display for
-numbers---when no particular format is specified---is base 10. You can
-change the default base for both input and output with the @code{set
-radix} command.
+begin with @samp{0x}. Numbers that neither begin with @samp{0} or
+@samp{0x}, nor end with a @samp{.} are, by default, entered in base
+10; likewise, the default display for numbers---when no particular
+format is specified---is base 10. You can change the default base for
+both input and output with the commands described below.
@table @code
@kindex set input-radix
@item set input-radix @var{base}
Set the default base for numeric input. Supported choices
for @var{base} are decimal 8, 10, or 16. @var{base} must itself be
-specified either unambiguously or using the current default radix; for
+specified either unambiguously or using the current input radix; for
example, any of
@smallexample
@noindent
sets the input base to decimal. On the other hand, @samp{set input-radix 10}
-leaves the input radix unchanged, no matter what it was.
+leaves the input radix unchanged, no matter what it was, since
+@samp{10}, being without any leading or trailing signs of its base, is
+interpreted in the current radix. Thus, if the current radix is 16,
+@samp{10} is interpreted in hex, i.e.@: as 16 decimal, which doesn't
+change the radix.
@kindex set output-radix
@item set output-radix @var{base}
Set the default base for numeric display. Supported choices
for @var{base} are decimal 8, 10, or 16. @var{base} must itself be
-specified either unambiguously or using the current default radix.
+specified either unambiguously or using the current input radix.
@kindex show input-radix
@item show input-radix
target activity (e.g., target stopped).
The following is a preliminary list of possible out-of-band records.
+In particular, the @var{exec-async-output} records.
+
+@table @code
+@item *stopped,reason="@var{reason}"
+@end table
+
+@var{reason} can be one of the following:
@table @code
-@item "*" "stop"
+@item breakpoint-hit
+A breakpoint was reached.
+@item watchpoint-trigger
+A watchpoint was triggered.
+@item read-watchpoint-trigger
+A read watchpoint was triggered.
+@item access-watchpoint-trigger
+An access watchpoint was triggered.
+@item function-finished
+An -exec-finish or similar CLI command was accomplished.
+@item location-reached
+An -exec-until or similar CLI command was accomplished.
+@item watchpoint-scope
+A watchpoint has gone out of scope.
+@item end-stepping-range
+An -exec-next, -exec-next-instruction, -exec-step, -exec-step-instruction or
+similar CLI command was accomplished.
+@item exited-signalled
+The inferior exited because of a signal.
+@item exited
+The inferior exited.
+@item exited-normally
+The inferior exited normally.
+@item signal-received
+A signal was received by the inferior.
@end table
-command @var{args}@dots{}
@end smallexample
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} CLI command.
-
@subsubheading Result
-@subsubheading Out-of-band
+@subsubheading @value{GDBN} Command
-@subsubheading Notes
+The corresponding @value{GDBN} CLI command(s), if any.
@subsubheading Example
-
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Breakpoint Table Commands
@section @sc{gdb/mi} Breakpoint table commands
(@value{GDBP})
@end smallexample
+@subheading The @code{-inferior-tty-set} Command
+@findex -inferior-tty-set
+
+@subheading Synopsis
+
+@smallexample
+-inferior-tty-set /dev/pts/1
+@end smallexample
+
+Set terminal for future runs of the program being debugged.
+
+@subheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{set inferior-tty /dev/pts/1}.
+
+@subheading Example
+
+@smallexample
+(@value{GDBP})
+-inferior-tty-set /dev/pts/1
+^done
+(@value{GDBP})
+@end smallexample
+
+@subheading The @code{-inferior-tty-show} Command
+@findex -inferior-tty-show
+
+@subheading Synopsis
+
+@smallexample
+-inferior-tty-show
+@end smallexample
+
+Show terminal for future runs of program being debugged.
+
+@subheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{show inferior-tty}.
+
+@subheading Example
+
+@smallexample
+(@value{GDBP})
+-inferior-tty-set /dev/pts/1
+^done
+(@value{GDBP})
+-inferior-tty-show
+^done,inferior_tty_terminal="/dev/pts/1"
+(@value{GDBP})
+@end smallexample
+
@ignore
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Kod Commands
-stack-info-frame
@end smallexample
-Get info on the current frame.
+Get info on the selected frame.
@subsubheading @value{GDBN} Command
(without arguments).
@subsubheading Example
-N.A.
+
+@smallexample
+(@value{GDBP})
+-stack-info-frame
+^done,frame=@{level="1",addr="0x0001076c",func="callee3",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@}
+(@value{GDBP})
+@end smallexample
@subheading The @code{-stack-info-depth} Command
@findex -stack-info-depth
-stack-list-locals @var{print-values}
@end smallexample
-Display the local variable names for the current frame. With an
-argument of 0 or @code{--no-values}, prints only the names of the variables.
-With argument of 1 or @code{--all-values}, prints also their values. With
-argument of 2 or @code{--simple-values}, prints the name, type and value for
-simple data types and the name and type for arrays, structures and
-unions. In this last case, the idea is that the user can see the
-value of simple data types immediately and he can create variable
-objects for other data types if he wishes to explore their values in
+Display the local variable names for the selected frame. If
+@var{print-values} is 0 or @code{--no-values}, print only the names of
+the variables; if it is 1 or @code{--all-values}, print also their
+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
more detail.
@subsubheading @value{GDBN} Command
-stack-select-frame @var{framenum}
@end smallexample
-Change the current frame. Select a different frame @var{framenum} on
+Change the selected frame. Select a different frame @var{framenum} on
the stack.
@subsubheading @value{GDBN} Command
@smallexample
-var-list-children [@var{print-values}] @var{name}
@end smallexample
+@anchor{-var-list-children}
-Returns a list of the children of the specified variable object. With
-just the variable object name as an argument or with an optional
-preceding argument of 0 or @code{--no-values}, prints only the names of the
-variables. With an optional preceding argument of 1 or @code{--all-values},
-also prints their values.
+Return a list of the children of the specified variable object and
+create variable objects for them, if they do not already exist. With
+a single argument or if @var{print-values} has a value for of 0 or
+@code{--no-values}, print only the names of the variables; if
+@var{print-values} is 1 or @code{--all-values}, also print their
+values; and if it is 2 or @code{--simple-values} print the name and
+value for simple data types and just the name for arrays, structures
+and unions.
@subsubheading Example
@smallexample
(@value{GDBP})
-var-list-children n
- numchild=@var{n},children=[@{name=@var{name},
+ ^done,numchild=@var{n},children=[@{name=@var{name},
numchild=@var{n},type=@var{type}@},@r{(repeats N times)}]
(@value{GDBP})
-var-list-children --all-values n
- numchild=@var{n},children=[@{name=@var{name},
+ ^done,numchild=@var{n},children=[@{name=@var{name},
numchild=@var{n},value=@var{value},type=@var{type}@},@r{(repeats N times)}]
@end smallexample
@subsubheading Synopsis
@smallexample
- -var-update @{@var{name} | "*"@}
+ -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.
+A @samp{*} causes all existing variable objects to be updated. The
+option @var{print-values} determines whether names and values, or just
+names are printed in the manner described for
+@code{@pxref{-var-list-children}}.
+
+@subsubheading Example
+@smallexample
+(@value{GDBP})
+-var-assign var1 3
+^done,value="3"
+(@value{GDBP})
+-var-update --all-values var1
+^done,changelist=[@{name="var1",value="3",in_scope="true",
+type_changed="false"@}]
+(@value{GDBP})
+@end smallexample
@node Annotations
@chapter @value{GDBN} Annotations
@menu
* Annotations Overview:: What annotations are; the general syntax.
-* Server Prefix:: Issuing a command without affecting user state.
* Prompting:: Annotations marking @value{GDBN}'s need for input.
* Errors:: Annotations for error messages.
* Invalidation:: Some annotations describe things now invalid.
@table @code
@kindex set annotate
@item set annotate @var{level}
-The @value{GDB} command @code{set annotate} sets the level of
+The @value{GDBN} command @code{set annotate} sets the level of
annotations to the specified @var{level}.
@item show annotate
denotes a @samp{control-z} character) are annotations; the rest is
output from @value{GDBN}.
-@node Server Prefix
-@section The Server Prefix
-@cindex server prefix for annotations
-
-To issue a command to @value{GDBN} without affecting certain aspects of
-the state which is seen by users, prefix it with @samp{server }. This
-means that this command will not affect the command history, nor will it
-affect @value{GDBN}'s notion of which command to repeat if @key{RET} is
-pressed on a line by itself.
-
-The server prefix does not affect the recording of values into the value
-history; to print a value without recording it into the value history,
-use the @code{output} command instead of the @code{print} command.
-
@node Prompting
@section Annotation for @value{GDBN} Input
Reply:
@table @samp
-@item @emph{no response}
-@value{GDBN} does not check for any response after sending this packet.
+@item OK
+for success
+@item E@var{NN}
+for an error
@end table
@item @code{e} --- reserved