HP gnu source-level debugger 5992-4701 User Manual

Page 93

Advertising
background image

},
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 sevenbit-strings

on

Print using only seven-bit characters; if this
option is set, GDB displays any eight-bit
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
high-order bit of characters as a marker or “meta”
bit.

set print sevenbit-strings

off

Print full eight-bit characters. This allows the use
of more international character sets, and is the
default.

show print sevenbit-strings

Show whether or not GDB is printing only
seven-bit characters.

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

Advertising