Beej's Quick Guide to GDB (2009)
beej.us
beej.us
Is there's a data structure explorer panel? I went to rather insane lengths to develop pretty printing scripts for my data structures. It's got support for 3 scripting languages: Python, Guile Scheme and its very own GDB command file language. The first two require libc. My project was freestanding so I had to parse bits and bytes with GDB's arcane syntax. A proper structure visualizer would be so helpful...
You can toss something like this in ~/.config/gdb/gdbinit:
tui new-layout default regs 1 {-horizontal src 1 asm 1} 2 status 0 cmd 1
tui layout default
tui enableI these days use coredumpctl with gdb to debug seg faults.
So if a program crashes, I simply do:
$ coredumpctl debug
Now it launches gdb (or your default debugger) on the latest core dump. Then I use `bt` and others to debug the issue.
https://www.freedesktop.org/software/systemd/man/latest/core...
I've managed to cobble together a collection of data structure explorers written in Python but it is barely an improvement over straight gdb scripting due to the way all structs end up as dictionaries. Some higher level libraries for inspection might be nice. Automatic integration with something like graphviz would be amazing. For instance, it would be cool to just describe my data structure(specifying 'next' pointers or how to access edge lists for a graph) and just have a library dump a visual representation for me. That said, I wonder if half of that logic is best left in a debug module inside the application or library where it remains more tightly coupled to the actual layout.
I've had partial success in getting gpt4 to write rubocop cops (i.e. custom linting rules for ruby). I had to iterate a bit but eventually got something working and wouldn't have tried if I didn't have gpt helping me.
There's 3 years between them. Bit worried about 2026.
If you want a standalone frontend instead, https://github.com/epasveer/seer is extremely good.
And emacs has gdb integration. By now I tried it, and... I guess it's better than nothing.
https://sourceware.org/gdb/current/onlinedocs/gdb.html/TUI.h...
It is a full IDE for writing Qt apps, but it also works for non-Qt applications in C or C++ (cmake recommended), and it has some of the best GDB integration. It is also free (GPLv3).
I continue to find that knowledge useful in my day job working on distributed systems.
Huge shoutout to Beej!
Everyone knows the networking guide, but Beej also has: C, UNIX, Python, and many more.