| }, |
| meat = 0x54 "Pork" |
| } |
set print pretty off | Cause GDB to print structures in a compact |
| format, like this: |
| $1 = {next = 0x0, flags = {sweet = 1, |
| sour = 1}, \ |
| meat = 0x54 "Pork"} |
| This is the default format. |
show print pretty | Show which format GDB is using to print |
| structures. |
set print | Print using only |
on | option is set, GDB displays any |
| characters (in strings or character values) using |
| the notation \nnn. This setting is best if you are |
| working in English (ASCII) and you use the |
| |
| bit. |
set print | Print full |
off | of more international character sets, and is the |
| default. |
show print | Show whether or not GDB is printing only |
| |
set print union on | Tell GDB to print unions which are contained in |
| structures. This is the default setting. |
set print union off | Tell GDB not to print unions which are contained |
| in structures. |
show print union | Ask GDB whether or not it will print unions |
| which are contained in structures. |
| For example, given the declarations |
| typedef enum {Tree, Bug} Species; |
| typedef enum {Big_tree, Acorn, Seedling} |
| Tree_forms; |
| typedef enum {Caterpillar, Cocoon, |
| Butterfly} |
| Bug_forms; |
| struct thing { |
| Species it; |
| union { |
| Tree_forms tree; |
| Bug_forms bug; |
8.7 Print settings | 93 |