ruediger / Boost-Pretty-Printer

GDB Pretty Printers for Boost
197 stars 61 forks source link

fixes, reorganization, updates #23

Closed mateidavid closed 7 years ago

mateidavid commented 9 years ago

I spent some time merging my printers back into the package. I also reorganized the package, fixed python2-python3 issues, and added 2 days worth of a hacking document.

  1. I reorganized the package into separate modules primarily to allow printers for the same types to easily coexist. Now import boost.latest pulls in only the latest printers, but import boost.some_printer allows one to load specific ones.
  2. I changed the way the top-level printer generator selects printers to using a hashtable of template names. Each printer specifies which template names it should be called on. This allows us to avoid cycling through an increasing list of printers when printing a non-printable types.
  3. I fixed all python2 vs python3 issues I could find. Currently only one printer uses python2-only syntax.
  4. I added a long and windy HACKING document, including examples of dealing with the python API in general, but also notes about the internal organization of the package. I even went through an example rewritng a printer for std::list. Hopefully somebody who wants to contribute can find it useful. I know that when I first needed printers, it took a long time to find all this information.
  5. Please review the contributors in SUPPORTED.
ruediger commented 9 years ago

Thanks for your fixes. Sorry, I can't fully review all of them. But from a few quick looks they seem ok. I've added you as a collaborator to the project and you should be able to push and merge pull requests.

davidshepherd7 commented 9 years ago

Hey, some possibly useful information for any future users:

On Ubuntu 14.04 I when using the master branch I get the error:

Traceback (most recent call last):
File "<string>", line 12, in <module>
File "/home/david/.gdb_pretty_printers/Boost-Pretty-Printer/boost/printers.py", line 1223
return long(str(parse_and_eval('*((void**)' + str(node_ptr) + ')')), 16) & (~1L)
                                                                              ^
SyntaxError: invalid syntax
/home/david/.gdbinit:16: Error in sourced command file:
Error while executing Python code.

(presumably a python 2 vs 3 issue).

Using the branch from this pull request instead fixes the problem. Note that you will need to slightly change your .gdbinit file as documented here.

paulharris commented 8 years ago

Sounds like great work! But I don't see these changes pushed back up to ruediger's repo... @mateidavid, you aren't going to push these up?

cleeland commented 7 years ago

I just dropped a pull request yesterday, but it's based on what's in master rather than this branch. Any plans to bring this back in, or should I just pull this into my fork, merge in my changes, and call it a day?