Debugging with GDB (September 2007)

Chapter 20: GDB Annotations 261
^Z^Zdisplay-number-end
number-separator
^Z^Zdisplay-format
format
^Z^Zdisplay-expression
expression
^Z^Zdisplay-expression-end
expression-separator
^Z^Zdisplay-value
value
^Z^Zdisplay-end
where number is the number of the display, number-separator is intended to separate the
numb e r from what follows for the user, format includes information such as the size, format,
or other information about how the value is being displayed, expression is the expression
being displayed, expression-separator is intended to separate the e xpression from the text
that follows for the user,and value is the actual value being displayed.
20.6 Annotation for GDB input
When GDB prompts for input, it annotates this fact so it is possible to know when to
send output, when the output from a give n comm and is over, etc.
Different kinds of input each have a different input type. Each input type has three
annotations: a pre- annotation, which denotes the beginning of any prompt which is being
output, a plain annotation, which denotes the end of the prompt, and then a post- anno-
tation which denotes the end of any echo which may (or may not) be associated with the
input. For example, the prompt input type features the following annotations:
^Z^Zpre-prompt
^Z^Zprompt
^Z^Zpost-prompt
The input typ e s are
prompt When GDB is prompting for a command (the main GDB prompt).
commands When GDB prompts for a set of commands, like in the commands command.
The annotations are repeated for each command which is input.
overload-choice
When GDB wants the user to select between various ove rloaded functions.
query When GDB wants the user to confirm a potentially dangerous operation.
prompt-for-continue
When GDB is asking the user to press return to continue. Note: Don’t expect
this to work well; instead use set height 0 to disable prompting. This is
because the counting of lines is buggy in the presence of annotations.
20.7 Errors
^Z^Zquit
This annotation occurs right b e fore GDB responds to an interrupt.