Chapter 27.
gdb Annotations
This chapter describes annotations in gdb. Annotations are designed to interface gdb to graphical user
interfaces or other similar programs which want to interact with gdb at a relatively high level.
27.1. What is an Annotation?
To produce annotations, start gdb with the
-annotate=2
option.
Annotations start with a newline character, two
control-z
characters, and the name of the annota-
tion. If there is no additional information associated with this annotation, the name of the annotation
is followed immediately by a newline. If there is additional information, the name of the annotation
is followed by a space, the additional information, and a newline. The additional information cannot
contain newline characters.
Any output not beginning with a newline and two
control-z
characters denotes literal output from
gdb. Currently there is no need for gdb to output a newline followed by two
control-z
characters,
but if there was such a need, the annotations could be extended with an
escape
annotation which
means those three characters as output.
A simple example of starting up gdb with annotations is:
$ gdb --annotate=2
GNU GDB 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.
Type "show warranty"
for details.
This GDB was configured as "sparc-sun-sunos4.1.3"
^Z^Zpre-prompt
(gdb)
^Z^Zprompt
quit
^Z^Zpost-prompt
$
Here
quit
is input to gdb; the rest is output from gdb. The three lines beginning
^Z^Z
(where
^Z
denotes a
control-z
character) are annotations; the rest is output from gdb.
27.2. The Server Prefix
To issue a command to gdb without affecting certain aspects of the state which is seen by users, prefix
it with
server
. This means that this command will not affect the command history, nor will it affect
gdb’s notion of which command to repeat if [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
output
command instead of the
command.
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......