Fix pretty printers in _GLIBCXX_DEBUG mode

François Dumont frs.dumont@gmail.com
Mon Oct 1 19:51:00 GMT 2018


On 09/28/2018 02:01 PM, Jonathan Wakely wrote:
> On 25/09/18 22:11 +0200, François Dumont wrote:
>>
>> I guess it must have something to do with the [] but as I escaped 
>> both I don't understand what's wrong.
>
> You might need to escape them twice, or more ... so that TCL doesn't
> try to handle them as special characters, and then the regex engine
> doesn't treat them as special characters either.
>
>
Ok, with some additionals escape characters it now succeeds. So now the 
question is: ok to commit ?

It makes the tests a little bit more complicated so I would understand 
that you reject it. At the same time I regularly see those tests 
reported as in failure so I guess we want them to succeed and it is the 
only way I found to fix them. Another option would be to try to hide 
'__debug::' from a whatis call but I don't want to hide it from our 
users just to make our tests pass.

     * python/libstdcxx/v6/printers.py (add_one_template_type_printer):
     Add type printer for container types in std::__debug namespace.
     * testsuite/lib/gdb-test.exp (whatis-regexp-test): New.
     (gdb-tests): Use distinct parameters for the type of test and use 
regex.
     (gdb-test): Check for regex test even if 'whatis' test.
     * testsuite/libstdc++-prettyprinters/80276.cc: Adapt for _GLIBCXX_DEBUG
     mode.
     * testsuite/libstdc++-prettyprinters/cxx11.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.
     * testsuite/libstdc++-prettyprinters/whatis2.cc: Likewise.

Tested under Linux x86_64 debug and normal modes.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug_printers.patch
Type: text/x-patch
Size: 20942 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20181001/e38a6e30/attachment.bin>


More information about the Libstdc++ mailing list