gdb: Annotations Overview

 
 28.1 What is an Annotation?
 ===========================
 
 Annotations start with a newline character, two 'control-z' characters,
 and the name of the annotation.  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.
 
    The annotation LEVEL, which is specified using the '--annotate'
 command line option (SeeMode Options), controls how much
 information GDB prints together with its prompt, values of expressions,
 source lines, and other types of output.  Level 0 is for no annotations,
 level 1 is for use when GDB is run as a subprocess of GNU Emacs, level 3
 is the maximum annotation suitable for programs that control GDB, and
 level 2 annotations have been made obsolete (SeeLimitations of the
 Annotation Interface (annotate)Limitations.).
 
 'set annotate LEVEL'
      The GDB command 'set annotate' sets the level of annotations to the
      specified LEVEL.
 
 'show annotate'
      Show the current annotation level.
 
    This chapter describes level 3 annotations.
 
    A simple example of starting up GDB with annotations is:
 
      $ gdb --annotate=3
      GNU gdb 6.0
      Copyright 2003 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 "i386-pc-linux-gnu"
 
      ^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.