re PR libstdc++/68448 (Python Pretty Printers get disabled on libstdc++ reload by...
authorJan Kratochvil <jkratoch@gcc.gnu.org>
Fri, 20 Nov 2015 19:00:51 +0000 (19:00 +0000)
committerJan Kratochvil <jkratoch@gcc.gnu.org>
Fri, 20 Nov 2015 19:00:51 +0000 (19:00 +0000)
PR libstdc++/68448
* python/hook.in: Call register_libstdcxx_printers.
* python/libstdcxx/v6/__init__.py: Wrap it to
register_libstdcxx_printers.

From-SVN: r230669

libstdc++-v3/ChangeLog
libstdc++-v3/python/hook.in
libstdc++-v3/python/libstdcxx/v6/__init__.py

index d865255ece22ca4786256f513f9dfc2d737bf876..85b0383b8a5a5dae7af93db3e2efdb72abd46e21 100644 (file)
@@ -1,6 +1,13 @@
+2015-11-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       PR libstdc++/68448
+       * python/hook.in: Call register_libstdcxx_printers.
+       * python/libstdcxx/v6/__init__.py: Wrap it to
+       register_libstdcxx_printers.
+
 2015-11-17  Jonathan Wakely  <jwakely@redhat.com>
 
-       PR libstdc++66059
+       PR libstdc++/66059
        * include/std/utility (_Build_index_tuple): Optimise.
 
 2015-11-16  Doug Evans  <dje@google.com>
index 07fe4c62417157712b7df7036521ae3947e8706a..703b6a744886a1aac44604e1539096712c1db1e8 100644 (file)
@@ -55,4 +55,7 @@ if gdb.current_objfile () is not None:
     if not dir_ in sys.path:
         sys.path.insert(0, dir_)
 
-import libstdcxx.v6
+# Call a function as a plain import would not execute body of the included file
+# on repeated reloads of this object file.
+from libstdcxx.v6 import register_libstdcxx_printers
+register_libstdcxx_printers(gdb.current_objfile())
index de3aa728cebb4827a85db27a693b327d0dd6a305..d8e060c809d9b140c98bbcb6e35cf3eec2dc2d9a 100644 (file)
 
 import gdb
 
-# Load the pretty-printers.
-from .printers import register_libstdcxx_printers
-register_libstdcxx_printers(gdb.current_objfile())
-
 # Load the xmethods if GDB supports them.
 def gdb_has_xmethods():
     try:
@@ -27,6 +23,11 @@ def gdb_has_xmethods():
     except ImportError:
         return False
 
-if gdb_has_xmethods():
-    from .xmethods import register_libstdcxx_xmethods
-    register_libstdcxx_xmethods(gdb.current_objfile())
+def register_libstdcxx_printers(obj):
+    # Load the pretty-printers.
+    from .printers import register_libstdcxx_printers
+    register_libstdcxx_printers(obj)
+
+    if gdb_has_xmethods():
+        from .xmethods import register_libstdcxx_xmethods
+        register_libstdcxx_xmethods(obj)