summaryrefslogtreecommitdiff
path: root/libstdc++-v3/python/hook.in
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2014-09-10 13:18:04 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2014-09-10 14:18:04 +0100
commite9e08827bf931aba511a928a0feccbc328f2a927 (patch)
tree99b6859d870823eec6a19c39fa4d7c997524e91b /libstdc++-v3/python/hook.in
parentf15b287f2dcdf5284a2abb3e5c727f26c11cc064 (diff)
downloadgcc-e9e08827bf931aba511a928a0feccbc328f2a927.tar.gz
hook.in: Load the xmethods.
2014-09-10 Siva Chandra Reddy <sivachandra@google.com> * python/hook.in: Load the xmethods. * python/Makefile.am (nobase_python_DATA): Add xmethods.py. * python/Makefile.in: Regenerated. * python/libstdcxx/v6/xmethods.py: New file. * testsuite/lib/gdb-test.exp (gdb_version_check_xmethods): New function. (gdb-test): New optional argument LOAD_XMETHODS. Load xmethods python script if LOAD_XMETHODS is true. * testsuite/libstdc++-xmethods/unique_ptr.cc: New file. * testsuite/libstdc++-xmethods/vector.cc: New file. * testsuite/libstdc++-xmethods/xmethods.exp: New file. From-SVN: r215128
Diffstat (limited to 'libstdc++-v3/python/hook.in')
-rw-r--r--libstdc++-v3/python/hook.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/libstdc++-v3/python/hook.in b/libstdc++-v3/python/hook.in
index 3620523b595..aeb1cdbc91a 100644
--- a/libstdc++-v3/python/hook.in
+++ b/libstdc++-v3/python/hook.in
@@ -58,3 +58,15 @@ if gdb.current_objfile () is not None:
# Load the pretty-printers.
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (gdb.current_objfile ())
+
+# Load the xmethods if GDB supports them.
+def gdb_has_xmethods():
+ try:
+ import gdb.xmethod
+ return True
+ except ImportError:
+ return False
+
+if gdb_has_xmethods():
+ from libstdcxx.v6.xmethods import register_libstdcxx_xmethods
+ register_libstdcxx_xmethods (gdb.current_objfile ())