Name

print

Synopsis

set print print-opt
show printprint-opt

GDB lets you control the printing of many different aspects of the debuggee. Many of these options are enabled by typing either set print option-name or set print option-name on. Using off instead of on disables the particular printing option. You can use show print option-name to see if the option’s printing setting is on or off. The values for print-opt, and descriptions of GDB’s behavior when a particular print-opt is on, are presented in the following list.

set print address, show print address

Include the program counter in stack frame information.

set print array, show print array

Prettyprint arrays. This is easier to read but takes up more space. Default is off.

set print asm-demangle, show print asm-demangle

Demangle C++/Objective C names, even in disassembly listings.

set print demangle, show print demangle

Demangle C++/Objective C names in output.

set print elementscount, show print elements

Print no more than count elements from an array. The default is 200; a value of 0 means “unlimited.”

set print null-stop, show print null-stop

Stop printing array elements upon encountering one set to zero (ASCII NUL for character arrays, hence the name). Default is off.

set print object, show print object

For a pointer, print the pointed-to object’s actual type, which is derived from virtual function table information, instead of the declared type. The default is off, which prints the declared type.

set print pascal_static-members
show print ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.