From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 8B4C73858430; Wed, 13 Oct 2021 19:42:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B4C73858430 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r9-9776] libstdc++: Install GDB pretty printers for debug library X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-9 X-Git-Oldrev: e4f3b1e502af237fbdb6ae3ce398fc79e9050d32 X-Git-Newrev: 6732e0e93d7528568085cd3cf8eaaed20ca003a3 Message-Id: <20211013194234.8B4C73858430@sourceware.org> Date: Wed, 13 Oct 2021 19:42:34 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2021 19:42:34 -0000 https://gcc.gnu.org/g:6732e0e93d7528568085cd3cf8eaaed20ca003a3 commit r9-9776-g6732e0e93d7528568085cd3cf8eaaed20ca003a3 Author: Jonathan Wakely Date: Thu Aug 12 19:56:14 2021 +0100 libstdc++: Install GDB pretty printers for debug library The additional libraries installed by --enable-libstdcxx-debug are built without optimization to aid debugging, but the Python pretty printers are not installed alongside them. This means that you can step through the unoptimized library code, but at the expense of pretty printing the library types. This remedies the situation by installing another copy of the GDB hooks alongside the debug version of libstdc++.so. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * python/Makefile.am [GLIBCXX_BUILD_DEBUG] (install-data-local): Install another copy of the GDB hook. * python/Makefile.in: Regenerate. (cherry picked from commit db853ff78a34fef25bc16133e0367a64526f9f4e) Diff: --- libstdc++-v3/python/Makefile.am | 12 +++++++++++- libstdc++-v3/python/Makefile.in | 8 +++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/python/Makefile.am b/libstdc++-v3/python/Makefile.am index 44d0b3e7fb4..c3dd4e8b406 100644 --- a/libstdc++-v3/python/Makefile.am +++ b/libstdc++-v3/python/Makefile.am @@ -29,6 +29,12 @@ else pythondir = $(datadir)/gcc-$(gcc_version)/python endif +if GLIBCXX_BUILD_DEBUG +debug_gdb_py = YES +else +debug_gdb_py = +endif + all-local: gdb.py nobase_python_DATA = \ @@ -61,4 +67,8 @@ install-data-local: gdb.py done; \ cd $$here; \ echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \ - $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py + $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py ; \ + if [ -n "$(debug_gdb_py)" ]; then \ + sed "/^libdir = /s;'$$;/debug';" gdb.py > debug-gdb.py ; \ + $(INSTALL_DATA) debug-gdb.py $(DESTDIR)$(toolexeclibdir)/debug/$$libname-gdb.py ; \ + fi diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in index 7b51946c49a..22dfc703e49 100644 --- a/libstdc++-v3/python/Makefile.in +++ b/libstdc++-v3/python/Makefile.in @@ -397,6 +397,8 @@ WARN_CXXFLAGS = \ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS) @ENABLE_PYTHONDIR_FALSE@pythondir = $(datadir)/gcc-$(gcc_version)/python @ENABLE_PYTHONDIR_TRUE@pythondir = $(prefix)/$(python_mod_dir) +@GLIBCXX_BUILD_DEBUG_FALSE@debug_gdb_py = +@GLIBCXX_BUILD_DEBUG_TRUE@debug_gdb_py = YES nobase_python_DATA = \ libstdcxx/v6/printers.py \ libstdcxx/v6/xmethods.py \ @@ -614,7 +616,11 @@ install-data-local: gdb.py done; \ cd $$here; \ echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \ - $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py + $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py ; \ + if [ -n "$(debug_gdb_py)" ]; then \ + sed "/^libdir = /s;'$$;/debug';" gdb.py > debug-gdb.py ; \ + $(INSTALL_DATA) debug-gdb.py $(DESTDIR)$(toolexeclibdir)/debug/$$libname-gdb.py ; \ + fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.