public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: llvm-runtimes/libcxx/
Date: Fri, 15 Aug 2025 19:13:50 +0000 (UTC)	[thread overview]
Message-ID: <1755285222.8f5ca4a330e9d05b4a19432f0a57c0255d0fcac0.mgorny@gentoo> (raw)

commit:     8f5ca4a330e9d05b4a19432f0a57c0255d0fcac0
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Fri Aug 15 16:14:56 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug 15 19:13:42 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f5ca4a3

llvm-runtimes/libcxx: install GDB Pretty printers for libc++

https://github.com/llvm/llvm-project/blob/llvmorg-21.1.0-rc3/libcxx/docs/UserDocumentation.rst#gdb-pretty-printers-for-libc
describes the procedure to set up GDB printers for STL data structures
from libc++.

Since LLVM 21 these pretty printers work quite well, including MI-mode
(enabling visualization in IDEs like vscode).

In a way, similar to python, libgobject, libstdc++ and so on, file like
/usr/share/gdb/auto-load/usr/lib64/libc++.so.1.0-gdb.py enables
autoloading for pretty printers.

Closes: https://bugs.gentoo.org/961530
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43455
Closes: https://github.com/gentoo/gentoo/pull/43455
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild | 14 ++++++++++++++
 llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild | 14 ++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild b/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild
index aadd7774d65e..cb170c03ff83 100644
--- a/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild
+++ b/llvm-runtimes/libcxx/libcxx-21.1.0.9999.ebuild
@@ -191,6 +191,20 @@ multilib_src_install() {
 		dolib.so lib/libc++_shared.so
 		use static-libs && dolib.a lib/libc++_static.a
 	fi
+
+	local install_prefix=
+	is_crosspkg && install_prefix=/usr/${CTARGET}
+	insinto "${install_prefix}/usr/share/libc++/gdb"
+	doins ../libcxx/utils/gdb/libcxx/printers.py
+
+	local lib_version=$(sed -n -e 's/^LIBCXX_LIBRARY_VERSION:STRING=//p' CMakeCache.txt || die)
+	[[ -n ${lib_version} ]] || die "Could not determine LIBCXX_LIBRARY_VERSION from CMakeCache.txt"
+
+	insinto "${install_prefix}/usr/share/gdb/auto-load/usr/$(get_libdir)"
+	newins - "libc++.so.${lib_version}-gdb.py" <<-EOF
+		__import__("sys").path.insert(0, "${EPREFIX}/usr/share/libc++/gdb")
+		__import__("printers").register_libcxx_printer_loader()
+	EOF
 }
 
 # Usage: deps

diff --git a/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild b/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild
index aadd7774d65e..cb170c03ff83 100644
--- a/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild
+++ b/llvm-runtimes/libcxx/libcxx-22.0.0.9999.ebuild
@@ -191,6 +191,20 @@ multilib_src_install() {
 		dolib.so lib/libc++_shared.so
 		use static-libs && dolib.a lib/libc++_static.a
 	fi
+
+	local install_prefix=
+	is_crosspkg && install_prefix=/usr/${CTARGET}
+	insinto "${install_prefix}/usr/share/libc++/gdb"
+	doins ../libcxx/utils/gdb/libcxx/printers.py
+
+	local lib_version=$(sed -n -e 's/^LIBCXX_LIBRARY_VERSION:STRING=//p' CMakeCache.txt || die)
+	[[ -n ${lib_version} ]] || die "Could not determine LIBCXX_LIBRARY_VERSION from CMakeCache.txt"
+
+	insinto "${install_prefix}/usr/share/gdb/auto-load/usr/$(get_libdir)"
+	newins - "libc++.so.${lib_version}-gdb.py" <<-EOF
+		__import__("sys").path.insert(0, "${EPREFIX}/usr/share/libc++/gdb")
+		__import__("printers").register_libcxx_printer_loader()
+	EOF
 }
 
 # Usage: deps


             reply	other threads:[~2025-08-15 19:14 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 19:13 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-11-08 10:37 [gentoo-commits] repo/gentoo:master commit in: llvm-runtimes/libcxx/ Michał Górny
2025-11-04 20:19 Michał Górny
2025-11-01 12:02 Michał Górny
2025-10-28 11:37 Michał Górny
2025-10-22 19:12 Michał Górny
2025-10-21 18:43 Michał Górny
2025-10-11 19:54 Michał Górny
2025-10-09 16:17 Michał Górny
2025-10-08 17:29 Michał Górny
2025-10-04  9:16 Michał Górny
2025-10-03 11:43 Michał Górny
2025-10-01  6:35 Michał Górny
2025-09-24 16:18 Michał Górny
2025-09-24  2:27 Michał Górny
2025-09-23 19:14 Michał Górny
2025-09-10 11:47 Michał Górny
2025-09-07 19:47 Michał Górny
2025-09-02 14:29 Michał Górny
2025-08-31 13:28 Michał Górny
2025-08-27 12:28 Michał Górny
2025-08-27  5:50 Sam James
2025-08-26 19:38 Michał Górny
2025-08-26  8:56 Michał Górny
2025-08-24 19:02 Arthur Zamarin
2025-08-24 18:51 Arthur Zamarin
2025-08-24 18:51 Arthur Zamarin
2025-08-21  8:22 Michał Górny
2025-08-21  8:18 Michał Górny
2025-08-16 13:51 Michał Górny
2025-08-12 17:09 Michał Górny
2025-08-09  9:47 Michał Górny
2025-08-06 20:06 Michał Górny
2025-08-06 12:29 Michał Górny
2025-08-06 12:29 Michał Górny
2025-08-02 10:29 Michał Górny
2025-07-29 19:04 Michał Górny
2025-07-26 19:53 Michał Górny
2025-07-22  9:20 Michał Górny
2025-07-20 14:15 Michał Górny
2025-07-20  8:24 Sam James
2025-07-19  6:50 Michał Górny
2025-07-13 20:03 Michał Górny
2025-07-09 18:49 Michał Górny
2025-06-28 15:03 Michał Górny
2025-06-28 14:55 Michał Górny
2025-06-14 14:24 Sam James
2025-06-14 14:12 Michał Górny
2025-06-14 11:02 Arthur Zamarin
2025-06-14  7:15 Michał Górny
2025-06-07 18:05 Michał Górny
2025-06-04 19:53 Michał Górny
2025-05-29 20:22 Michał Górny
2025-05-29  4:22 Michał Górny
2025-05-28 11:54 Michał Górny
2025-05-28 11:54 Michał Górny
2025-05-28 10:50 Michał Górny
2025-05-24 11:56 Michał Górny
2025-05-17 12:59 Michał Górny
2025-05-17  5:31 Michał Górny
2025-05-10 13:03 Michał Górny
2025-05-03 19:42 Michał Górny
2025-05-03 10:07 Michał Górny
2025-04-26 15:59 Michał Górny
2025-04-20 11:50 Michał Górny
2025-04-19  6:29 Michał Górny
2025-04-16 18:34 Michał Górny
2025-04-15 10:15 Michał Górny
2025-04-12 10:21 Michał Górny
2025-04-12 10:19 Arthur Zamarin
2025-04-12  8:59 Michał Górny
2025-04-12  4:57 Michał Górny
2025-04-05 12:24 Michał Górny
2025-04-03 11:29 Michał Górny
2025-03-29 10:27 Michał Górny
2025-03-23 13:46 Arthur Zamarin
2025-03-22 10:43 Michał Górny
2025-03-20 16:50 Michał Górny
2025-03-17 20:13 Michał Górny
2025-03-17 16:29 Michał Górny
2025-03-17  6:22 Michał Górny
2025-03-16 17:41 Michał Górny
2025-03-11 14:56 Michał Górny
2025-03-05 10:13 Michał Górny
2025-03-05  6:25 Michał Górny
2025-03-01 12:58 Michał Górny
2025-03-01  8:34 Michał Górny
2025-02-26 18:55 Michał Górny
2025-02-25 14:03 Michał Górny
2025-02-22 15:19 Michał Górny
2025-02-15  7:19 Michał Górny
2025-02-13  7:53 Michał Górny
2025-02-11 11:29 Michał Górny
2025-02-08 11:51 Michał Górny
2025-02-07 20:08 Arthur Zamarin
2025-02-07 20:08 Arthur Zamarin
2025-02-02 18:25 Michał Górny
2025-02-01 13:15 Michał Górny
2025-02-01  8:05 Michał Górny
2025-01-31 21:51 Michał Górny
2025-01-25 13:33 Michał Górny
2025-01-22 19:15 Michał Górny
2025-01-18 15:09 Michał Górny
2025-01-18  8:21 Michał Górny
2025-01-15  4:24 Michał Górny
2025-01-11 18:12 Michał Górny
2025-01-04 15:28 Michał Górny
2024-12-28 19:35 Michał Górny
2024-12-27 21:25 Michał Górny
2024-12-21 10:28 Michał Górny
2024-12-17 21:37 Michał Górny
2024-12-16  5:57 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1755285222.8f5ca4a330e9d05b4a19432f0a57c0255d0fcac0.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox