You are not logged in.

#1 2025-03-31 10:46:12

EBADFD
Member
Registered: 2025-03-31
Posts: 11

[SOLVED] gdb prettyprinting is broken (16.2)

I installed arch on a new disk. I immediately noticed gdb pretty printing wasn't working. How do I fix this?

To test you can execute gdb then write

python print(gdb.printing)

On arch I get

> Error occurred in Python: module 'gdb' has no attribute 'printing'

On my other OS where it works I get the output "<module 'gdb.printing' from '/usr/share/gdb/python/gdb/printing.py'>"

You can also test by making a ~/.gdbinit file with

python
gdb.printing.RegexpCollectionPrettyPrinter
end

Starting gdb will report

> .gdbinit:3: Error in sourced command file:
> Error occurred in Python: module 'gdb' has no attribute 'printing'

Last edited by EBADFD (2025-03-31 17:03:46)

Offline

#2 2025-03-31 14:09:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: [SOLVED] gdb prettyprinting is broken (16.2)

python import gdb.printing

Edit: https://man.archlinux.org/man/extra/gdb/gdbinit.5.en

Last edited by seth (2025-03-31 14:11:43)

Offline

#3 2025-03-31 17:02:39

EBADFD
Member
Registered: 2025-03-31
Posts: 11

Re: [SOLVED] gdb prettyprinting is broken (16.2)

That worked. Thanks

Do you know if this was a breaking change from something arch did or was it gdb 16? I'm not sure why you linked to the man page it doesnt say anything about python or printing

Offline

#4 2025-03-31 20:08:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: [SOLVED] gdb prettyprinting is broken (16.2)

No idea whether that has changed at some point, but the mapage is for gdbinit what should™ allow you to automatize this (if you want to)

Offline

#5 Yesterday 08:42:21

davidhcefx
Member
Registered: 2018-02-12
Posts: 2

Re: [SOLVED] gdb prettyprinting is broken (16.2)

> No idea whether that has changed at some point

I can verify that 13.1 is OK without importing, but 14.1 complains with `gdb.printing` unless imported it first.

Last edited by davidhcefx (Yesterday 08:42:46)

Offline

#6 Yesterday 19:58:16

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,353

Re: [SOLVED] gdb prettyprinting is broken (16.2)

Please don't necro-bump

Moderator Note
closing this old thread.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB