PR libstdc++/90945 Patch to have pretty printer for std::vector<bool> return bool intead of int for elements

Michael Weghorn m.weghorn@posteo.de
Wed Jun 19 17:05:00 GMT 2019


Hi everyone,

the Python pretty printer for a 'std::vector<bool>' currently returns
integers as values for the elements, which e.g. leads to the situation
that a 'gdb.Value' constructed from that doesn't have 'bool' type, but
an integer type ('long long' for my test with gdb 8.2.1 on Debian
testing, amd64). Returning bool values ('True'/'False') would make sure
that the type is clear and can thus help improve the displayed type.
More details in [1].

The attached patch changes the behaviour of the pretty printer accordingly.


I'd be glad to receive feedback on this and also notes in case anything
else is needed. (This is my first contribution.)

So far, I've tested this with GDB 8.2.1 on Debian testing.

ChangeLog:
* PR libstdc++/90945: Have pretty printer return bool instead of int for
  value of std::vector<bool> elements


Regards,
  Michael


[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90945
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Have-std-vector-printer-s-iterator-return-bool.patch
Type: text/x-patch
Size: 1548 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190619/53393b5f/attachment.bin>


More information about the Gcc-patches mailing list