The pretty-printing filter feature enables you to write filters in python which can transform a Value from one form to another. Python-based pretty-printers are only available on Oracle Solaris.
Filters are built in for select classes in 4 implementations of the C++ Standard Template Library. The following table specifies the library name and the compiler option for that library:
|
The following table specifies which classes filters can be used for in the C++ Standard Template Library and if index and slice can be printed:
|
The following output is an example of printing a list using the print command in dbx:
(dbx) print list10 list10 = { __buffer_size = 32U __buffer_list = { __data_ = 0x654a8 } __free_list = (nil) __next_avail = 0x67334 __last = 0x67448 __node = 0x48830 __length = 10U }
The following is the same list printed in dbx, but using pretty-printing filters:
(dbx) print -p list10 list10 = (200, 201, 202, 203, 204, 205, 206, 207, 208, 209) (dbx) print -p list10[5] list10[5] = 205 (dbx) print -p list10[1..100:2] list10[1..100:2] = [1] = 202 [3] = 204 [5] = 206 [7] = 208
Python pretty-print filters and the python command is available only on Oracle Solaris. To start the built-in Python interpreter, type python. To evaluate your Python code, type python python-code. A nascent Python plugin API is available. However, its primary purpose is for the writing of pretty-printer filters which that get invoked as callbacks. Therefore the python command mainly serves testing and diagnostic purposes.
To generate the python pretty-print API documentation, use the python-docs command. This command is only available on Oracle Solaris.