This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH libstdc++ v3] - Add xmethods for std::vector and std::unique_ptr
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Siva Chandra <sivachandra at google dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Doug Evans <dje at google dot com>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 26 Aug 2014 18:58:06 +0100
- Subject: Re: [PATCH libstdc++ v3] - Add xmethods for std::vector and std::unique_ptr
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gzd5vne8B4f-u5k98QqwJB23rv3M_WgxqJL-sY6RoQAsA at mail dot gmail dot com> <CAH6eHdQNWPibS1dbPGBSydg3QnMbB3g6HG7QGLaTs7HbZdNjig at mail dot gmail dot com> <CAGyQ6gyKTY+K+RM0cYmWVUAwpH4u1KdTSa_HjXLAgGg=iAP26w at mail dot gmail dot com> <CAH6eHdRE3_18WgyUtyfCDV_TgNfvRjLEbdcdeivO607DrXmGqQ at mail dot gmail dot com> <CAGyQ6gxOT2BG5hqb=y1ztJeFUcTCEK2a82D2=T7VjVed9SsCyw at mail dot gmail dot com>
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?
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 ())