Make pretty printers version namespace dependant

Jonathan Wakely jwakely@redhat.com
Thu Apr 27 18:32:00 GMT 2017


On 27/04/17 20:12 +0200, François Dumont wrote:
>Hi
>
>    Here is the patch to registers Printers depending on activation of 
>versioned namespace.
>
>2017-04-27  François Dumont  <fdumont@gcc.gnu.org>
>
>    * python/Makefile.am [ENABLE_SYMVERS_GNU_NAMESPACE]
>    (user_versioned_namespace): New.
>    (gdb.py): Adapt target.
>    * python/Makefile.in: Regenerate.
>    * python/hook.in: Likewise.
>    * python/libstdcxx/v6/printers.py (add_one_template_type_printer):
>    Register only 1 Printer type depending on _versioned_namespace value.
>    (add_one_type_printer): Likewise.
>    (register_libstdcxx_printers): Add parameter use_versioned_namespace.
>    Adapt _versioned_namespace value based on it.
>    * testsuite/lib/gdb-test.exp (get_use_versioned_namespace): New.
>    (note-test): Detect if version namespace is active and pass the
>    information to register_libstdcxx_printers.
>    * testsuite/libstdc++-prettyprinters/48362.cc: Replace a regexp-test
>    by a note-test.
>
>Tested under Linux x86_64, with and without version namespace.
>
>Ok to commit to trunk ?

What's the advantage?

Again, the point of my patch was to optimise if needed. Is it needed?


>Are we going to wait for gcc 7.1 before bumping version namespace ?

Shouldn't we wait until we change something that would require bumping
it? :-)


>diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp
>index 0507837..5685161 100644
>--- a/libstdc++-v3/testsuite/lib/gdb-test.exp
>+++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
>@@ -50,6 +50,33 @@ proc get_line_number {filename marker} {
>     return $gdb_markers($filename,$marker)
> }
> 
>+# Detect either versioned namespace is active or not.

s/either/whether/

>+proc get_use_versioned_namespace { } {
>+    # Set up and preprocess a C++ test program that depends
>+    # on versioned namespace activation.

s/versioned namespace activation./versioned namespaces being active./



More information about the Libstdc++ mailing list