[libcxx-commits] [libcxx] fix: update pretty-printer to work with gdb 17 (PR #142106)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 30 01:19:42 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: kotborealis (kotborealis)

<details>
<summary>Changes</summary>

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` requires `import gdb.printing` statement, which was missing from the `printers.py`.

Broken after commit [binutils-gdb/fc14343205d3a68db1fc139e4af9796be208fab4](https://github.com/bminor/binutils-gdb/commit/fc14343205d3a68db1fc139e4af9796be208fab4), and `import gdb.printing` was first referenced in [binutils-gdb/ee06c79b0fefd5e4ed5e7a1171dc3440130e41da](https://github.com/bminor/binutils-gdb/commit/ee06c79b0fefd5e4ed5e7a1171dc3440130e41da)

---
Full diff: https://github.com/llvm/llvm-project/pull/142106.diff


1 Files Affected:

- (modified) libcxx/utils/gdb/libcxx/printers.py (+1) 


``````````diff
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

``````````

</details>


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


More information about the libcxx-commits mailing list