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
Registered: 2012-09-03
Posts: 63,021

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
Registered: 2012-09-03
Posts: 63,021

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

Board footer

Powered by FluxBB