user202729 / gdb-custom-printers

My custom gdb pretty-printers. Improvements over the default ones.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GDB custom pretty printers

Taken from the default gdb's libstdcxx pretty printers, with some modifications.

Improvements

  • Implement end-iterator detection for StdDebugIteratorPrinter
  • Better output for std::bitset / std::set (default: [0]: 1,[1]: 2, improved: {1, 2}, like an array)
  • Remove some __debug from output, in debug compilation (for example std::__debug::vectorstd::vector)
  • Add std::array printer (the default one shows the internal member name _M_elems in the output)
  • Hide capacity data for vector

Installation

Follow the instruction in c++ - How to pretty-print STL containers in GDB? - Stack Overflow.

Change sys.path to point to the correct location.

Original source

The original ones can be found somewhere in /usr/share/gcc-11.1.0/python/libstdcxx/ (specific path depends on distribution).

Also see gdb source code.

About

My custom gdb pretty-printers. Improvements over the default ones.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%