JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: Debugging a Program With dbx     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information

Preface

1.  Getting Started With dbx

2.  Starting dbx

3.  Customizing dbx

4.  Viewing and Navigating To Code

5.  Controlling Program Execution

6.  Setting Breakpoints and Traces

7.  Using the Call Stack

8.  Evaluating and Displaying Data

Evaluating Variables and Expressions

Verifying Which Variable dbx Uses

Variables Outside the Scope of the Current Function

Printing the Value of a Variable, Expression, or Identifier

Printing C++ Pointers

Evaluating Unnamed Arguments in C++ Programs

Dereferencing Pointers

Monitoring Expressions

Turning Off Display (Undisplaying)

Assigning a Value to a Variable

Evaluating Arrays

Array Slicing

Array Slicing Syntax for C and C++

Array Slicing Syntax for Fortran

Using Slices

Using Strides

Using Pretty-Printing

9.  Using Runtime Checking

10.  Fixing and Continuing

11.  Debugging Multithreaded Applications

12.  Debugging Child Processes

13.  Debugging OpenMP Programs

14.  Working With Signals

15.  Debugging C++ With dbx

16.  Debugging Fortran Using dbx

17.  Debugging a Java Application With dbx

18.  Debugging at the Machine-Instruction Level

19.  Using dbx With the Korn Shell

20.  Debugging Shared Libraries

A.  Modifying a Program State

B.  Event Management

C.  Macros

D.  Command Reference

Index

Using Pretty-Printing

Pretty-printing lets your program provide its own rendition of an expression's value through a function call. If you specify the -p option to the print command, rprint command, display command, or watch command, dbx searches for a function of the form const chars *db_pretty_print(const T *, int flags, const char *fmt) and calls it, substituting the returned value for print or display.

The value passed in the flags argument of the function is bit-wise or one of the following:

FVERBOSE
0x1
Not currently implemented, always set
FDYNAMIC
0x2
-d
FRECURSE
0x4
-r
FFORMAT
0x8
-f (if set, fmt is the format part)
FLITERAL
0x10
-l

The db_pretty_print() function can be either a static member function or a standalone function.

If the dbx environment variable output_pretty_print is set to on, -p is passed to the print command, rprint command, or display command as the default. Use +p to override this behavior.

Consider also the following: