Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Pretty printers don't work on libc++ 17.0.2 #19

Open
petersohn opened this issue Feb 19, 2024 · 2 comments
Open

Pretty printers don't work on libc++ 17.0.2 #19

petersohn opened this issue Feb 19, 2024 · 2 comments

Comments

@petersohn
Copy link

petersohn commented Feb 19, 2024

Out of the box, nothing works. If I type info pretty-printers, gdb lists the printers, but when trying to print variables, it doesn't find the right printer.

After some debugging, I found out that the type names are std::_LIBCPP_ABI_NAMESPACE::.... The type name lookup regex is '^std::__[a-zA-Z0-9]+::'. I replacing it with '^std::[a-zA-Z0-9_]+::', it now finds a types, and can at least print a string. However, when I tried to print a map, I got the following error message:

MapPrinter.to_string
std::map (count=1)Traceback (most recent call last):
  File "/home/parallels/workspace/libcxx-pretty-printers/src/libcxx/v1/printers.py", line 736, in __next__
    result = ('[%d] %s' % (self.count, str(item['__cc']['first'])),
                                           ~~~~^^^^^^^^
gdb.error: There is no member or method named __cc.

I haven't tried any other types yet, but it looks like there is some serious discrepancy with this libc++ version.

@koutheir
Copy link
Owner

Thank you for your analysis. I am open to pull requests, if you would like to share your fixes with the community.

@koutheir
Copy link
Owner

This repository has been moved to codeberg.org.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants