If you have a pointer and you are not sure where it points, try 'set print
((gdb)) set print
((gdb)) p/a ptt
$4 = 0xe008 <t in hi2.c>
WARNING! For pointers that point to a local variable, 'p/a' does not show the symbol name and filename of the referent, even with the appropriate set print options turned on.
Other settings to control how different kinds of objects are printed:
set print array, set print | Pretty print arrays. This format is more |
array on | convenient to read, but uses more space. The |
| default is off. |
set print array off | Return to compressed format for arrays. |
show print array | Show whether compressed or pretty format is |
| selected for displaying arrays. |
set print elements | Set a limit on how many elements of an array |
GDB will print. If GDB is printing a large array, | |
| it stops printing after it has printed the number |
| of elements set by the set print elements |
| command. This limit also applies to the display |
| of strings. When GDB starts, this limit is set to |
| 200. Setting |
| means that the printing is unlimited. |
show print elements | Display the number of elements of a large array |
| that GDB will print. If the number is 0, then the |
| printing is unlimited. |
set print | Cause GDB to stop printing the characters of an |
| array when the first NULL is encountered. This |
| is useful when large arrays actually contain only |
| short strings. The default is off. |
set print pretty on | Cause GDB to print structures in an indented |
| format with one member per line, like this: |
| $1 = { |
| next = 0x0, |
| flags = { |
| sweet = 1, |
| sour = 1 |
92 Examining Data