diff mbox

[libstdc++,v3] - Add xmethods for std::vector and std::unique_ptr

Message ID 20140826175806.GA6689@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Aug. 26, 2014, 5:58 p.m. UTC
Shouldn't there be a change to python/Makefile.am so that xmethods.py
gets installed alongside printers.py? Otherwise you can use these new
xmethods in the libstdc++ testssuite, but they're not available to
users.

I'd also expect something to call the register_libstdcxx_xmethods
function automatically, as in the attached patch, although this
doesn't work for me.

How am I expected to use these xmethods?
diff mbox

Patch

commit 3b04eb18e94cace91cfbc2cd80c0acd0bf7d7d86
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Aug 26 18:52:39 2014 +0100

    	* python/Makefile.am (nobase_python_DATA): Add xmethods.py.
    	* python/Makefile.in: Regenerate.
    	* python/hook.in: Load the xmethods.

diff --git a/libstdc++-v3/python/Makefile.am b/libstdc++-v3/python/Makefile.am
index ac7341a..c34c860 100644
--- a/libstdc++-v3/python/Makefile.am
+++ b/libstdc++-v3/python/Makefile.am
@@ -33,6 +33,7 @@  all-local: gdb.py
 
 nobase_python_DATA = \
     libstdcxx/v6/printers.py \
+    libstdcxx/v6/xmethods.py \
     libstdcxx/v6/__init__.py \
     libstdcxx/__init__.py
 
diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
index 21d74a90..7d0c8ac 100644
--- a/libstdc++-v3/python/Makefile.in
+++ b/libstdc++-v3/python/Makefile.in
@@ -316,6 +316,7 @@  AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
 @ENABLE_PYTHONDIR_TRUE@pythondir = $(prefix)/$(python_mod_dir)
 nobase_python_DATA = \
     libstdcxx/v6/printers.py \
+    libstdcxx/v6/xmethods.py \
     libstdcxx/v6/__init__.py \
     libstdcxx/__init__.py
 
diff --git a/libstdc++-v3/python/hook.in b/libstdc++-v3/python/hook.in
index 3620523..29c0f3c 100644
--- a/libstdc++-v3/python/hook.in
+++ b/libstdc++-v3/python/hook.in
@@ -58,3 +58,8 @@  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 ())
+
+if hasattr(gdb, 'xmethod'):
+    # Load the xmethods
+    from libstdcxx.v6.xmethods import register_libstdcxx_xmethods
+    register_libstdcxx_xmethods (gdb.current_objfile ())