[libcxx-commits] [libcxx] [libc++] Update GDB pretty-printer to work with GDB 17 (PR #142106)

Dmitry Chestnykh via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 5 11:34:19 PDT 2025


https://github.com/chestnykh updated https://github.com/llvm/llvm-project/pull/142106

>From 21ca28d3729cb03dce0081599c7c8bb4ebc7a93e Mon Sep 17 00:00:00 2001
From: kotborealis <kotborealis at awooo.ru>
Date: Fri, 30 May 2025 11:18:04 +0300
Subject: [PATCH] fix: update pretty-printer to work with gdb 17

Fixed an issue in `libcxx/utils/gdb/libcxx/printers.py`.

With gdb 17 (binutils 2_44) pretty-printers do not work anymore because calls to `gdb.printing` require `import gdb.printing` statement, which was missing from the printers.py

Broken after commit https://github.com/bminor/binutils-gdb/commit/fc14343205d3a68db1fc139e4af9796be208fab4,
and `importgdb.printing` was first referenced in https://github.com/bminor/binutils-gdb/commit/ee06c79b0fefd5e4ed5e7a1171dc3440130e41da
---
 libcxx/utils/gdb/libcxx/printers.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcxx/utils/gdb/libcxx/printers.py b/libcxx/utils/gdb/libcxx/printers.py
index e3d5d87aca325..90bc54d987ee8 100644
--- a/libcxx/utils/gdb/libcxx/printers.py
+++ b/libcxx/utils/gdb/libcxx/printers.py
@@ -14,6 +14,7 @@
 
 import re
 import gdb
+import gdb.printing
 
 # One under-documented feature of the gdb pretty-printer API
 # is that clients can call any other member of the API



More information about the libcxx-commits mailing list