aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJan Kratochvil <jkratoch@gcc.gnu.org>2015-11-20 19:00:51 +0000
committerJan Kratochvil <jkratoch@gcc.gnu.org>2015-11-20 19:00:51 +0000
commitcdccafd922b36a07fe0f4118c07293fd595ffd3e (patch)
tree503821057663083e83da3da89562fe800d770075 /libstdc++-v3
parenteed905e9f236f7b7eaba946232851de9d4b27de8 (diff)
downloadgcc-cdccafd922b36a07fe0f4118c07293fd595ffd3e.zip
gcc-cdccafd922b36a07fe0f4118c07293fd595ffd3e.tar.gz
gcc-cdccafd922b36a07fe0f4118c07293fd595ffd3e.tar.bz2
re PR libstdc++/68448 (Python Pretty Printers get disabled on libstdc++ reload by GDB)
PR libstdc++/68448 * python/hook.in: Call register_libstdcxx_printers. * python/libstdcxx/v6/__init__.py: Wrap it to register_libstdcxx_printers. From-SVN: r230669
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/python/hook.in5
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/__init__.py15
3 files changed, 20 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d865255..85b0383 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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>
diff --git a/libstdc++-v3/python/hook.in b/libstdc++-v3/python/hook.in
index 07fe4c6..703b6a7 100644
--- a/libstdc++-v3/python/hook.in
+++ b/libstdc++-v3/python/hook.in
@@ -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())
diff --git a/libstdc++-v3/python/libstdcxx/v6/__init__.py b/libstdc++-v3/python/libstdcxx/v6/__init__.py
index de3aa72..d8e060c 100644
--- a/libstdc++-v3/python/libstdcxx/v6/__init__.py
+++ b/libstdc++-v3/python/libstdcxx/v6/__init__.py
@@ -15,10 +15,6 @@
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)