Boost-Pretty-Printer
Boost-Pretty-Printer copied to clipboard
Nothing works on Debian Bullseye unless I disable version limitations
I don't know what's wrong with gdb in Debian Bullseye... it just keeps saying that python isn't supported. I moved on and compiled gdb myself.
Then I tried to use this repo, and this is my ~/.gdbinit
:
python
import sys
sys.path.insert(0, '/usr/share/gcc/python')
sys.path.insert(1, '/home/username/Boost-Pretty-Printer')
import boost
boost.register_printers(boost_version=(1,5,5))
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers(None)
end
Then when I run gdb, I noticed that always, no matter what version I put up there (even if I don't specify a version, I keep getting the error No boost printers are available for boost version x.y.z
. So, I went ahead to util.py
and change this line:
supported_printers = [printer for printer in boost_printer_list
if printer.min_supported_version <= boost_version <= printer.max_supported_version]
to
supported_printers = boost_printer_list
So now, there's no filtering... and it just works.
I don't really know why the filters are just filtering everything. But there seems to be a problem there.
I think this is simply the library is perhaps a bit overly cautious and makes no promises on versions newer than the blessed version given here: https://github.com/ruediger/Boost-Pretty-Printer/blob/60da4b46b0fe8812fcc3e407ac2fbbfb50c3af88/boost/utils.py#L781
I simply changed this tuple to (1, 999, 0).