Contents|Index|Previous|Next
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 the following example declaration.
 

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.
 


Top|Contents|Index|Previous|Next