diff options
author | Siva Chandra Reddy <sivachandra@google.com> | 2014-09-10 13:18:04 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2014-09-10 14:18:04 +0100 |
commit | e9e08827bf931aba511a928a0feccbc328f2a927 (patch) | |
tree | 99b6859d870823eec6a19c39fa4d7c997524e91b /libstdc++-v3/python/hook.in | |
parent | f15b287f2dcdf5284a2abb3e5c727f26c11cc064 (diff) | |
download | gcc-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.in | 12 |
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 ()) |