HP (Hewlett-Packard) 5992-4701 Computer Hardware User Manual


 
available for use in expressions in the convenience variable $_. The contents of that
address, as examined, are available in the convenience variable $__.
If the x command has a repeat count, the address and contents saved are from the last
memory unit printed; this is not the same as the last address printed if several units
were printed on the last line of output.
8.6 Automatic display
If you find that you want to print the value of an expression frequently (to see how it
changes), you might want to add it to the automatic display list so that GDB prints its
value each time your program stops. Each expression added to the list is given a number
to identify it; to remove an expression from the list, you specify that number. The
automatic display looks like this:
2: foo = 38
3: bar[5] = (struct hack *) 0x3804
This display shows item numbers, expressions, and their current values. As with
displays you request manually using x or print, you can specify the output format
you prefer; in fact, display decides whether to use print or x depending on how
elaborate your format specification is―it uses x if you specify a unit size, or one of the
two formats ('i' and 's') that are only supported by x; otherwise it uses print.
display expr Add the expression expr to the list of expressions to display
each time your program stops. See “Expressions” (page 83).
display does not repeat if you press RET again after using
it.
display/fmt expr For fmt specifying only a display format and not a size or
count, add the expression expr to the auto-display list but
arrange to display it each time in the specified format fmt.
See“Output formats” (page 86).
display/fmt addr For fmt 'i' or 's', or including a unit-size or a number of
units, add the expression addr as a memory address to be
examined each time your program stops. Examining means
in effect doing 'x/fmt addr'. See “Examining memory”
(page 87).
For example, `display/i $pc' can be helpful, to view the machine instruction about
to be executed each time execution stops (`$pc' is a common name for the program
counter; see “Registers” (page 98)).
undisplay dnums..., delete
display dnums...
Remove item numbers dnums from the list of
expressions to display. undisplay does not
repeat if you press RET after using it. (Otherwise
you would just get the error 'No display number
...'.)
8.6 Automatic display 89