]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/testsuite/libstdc++-xmethods/shared_ptr.cc
Add GDB XMethods for shared_ptr and unique_ptr<T[]>
authorJonathan Wakely <jwakely@redhat.com>
Thu, 15 Dec 2016 12:45:42 +0000 (12:45 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 15 Dec 2016 12:45:42 +0000 (12:45 +0000)
commit0376e86bfc9cbf1fe7b15be65d4f8e183da6484a
treeae1599078d94ec2e2137bc68e7a9105f160f8870
parenta5aa934d0f22c06e4e2d2316aa6d48bd8a727243
Add GDB XMethods for shared_ptr and unique_ptr<T[]>

* python/libstdcxx/v6/xmethods.py (UniquePtrGetWorker.__init__): Use
correct element type for unique_ptr<T[]>.
(UniquePtrGetWorker._supports, UniquePtrDerefWorker._supports): New
functions to disable unsupported operators for unique_ptr<T[]>.
(UniquePtrSubscriptWorker): New worker for operator[].
(UniquePtrMethodsMatcher.__init__): Register UniquePtrSubscriptWorker.
(UniquePtrMethodsMatcher.match): Call _supports on the chosen worker.
(SharedPtrGetWorker, SharedPtrDerefWorker, SharedPtrSubscriptWorker)
(SharedPtrUseCountWorker, SharedPtrUniqueWorker): New workers.
(SharedPtrMethodsMatcher): New matcher for shared_ptr.
(register_libstdcxx_xmethods): Register SharedPtrMethodsMatcher.
* testsuite/libstdc++-xmethods/unique_ptr.cc: Test arrays.
* testsuite/libstdc++-xmethods/shared_ptr.cc: New test.

From-SVN: r243688
libstdc++-v3/ChangeLog
libstdc++-v3/python/libstdcxx/v6/xmethods.py
libstdc++-v3/testsuite/libstdc++-xmethods/shared_ptr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc