Thank you so much. I didn't know about layouts at all! The source code and disassembly layout is amazing and it's exactly what I want to see when I launch a debugger. I wonder why it's not the default. GDB has a huge number of features but it's quite hard to use. That'd go a long way towards making it easier.
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...
One thing I think is sorely lacking is approachable documentation for writing python extensions to GDB.
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.
Funny you say that. Literally the first thing I tried to get ChatGPT to do for me was to give me an example gdb extension written in Python. It hallucinated badly and as I pushed it, it produced increasingly erroneous errors. That was about 6-8 months ago though. It might be better now.
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.
I wrote https://github.com/daym/idea-native2-debugger as a stop-gap. It uses gdb and works in IntelliJ IDEA Community edition. Setting it up the first time is kinda weird since you need to add a new run/debug configuration "Native2Debugger". I could not figure out how to hook this directly into the existing run configuration that you use to run your program to begin with. Otherwise, I like how it turned out.
I'll preface this with 'it might not be what you're looking for, but I've found useful in this space', but gdb has multiple interfaces built in to the normal binary. It's not just the raw gdb command prompt, but it has a pretty nice curses mode that'll display registers, asm, source with breakpoints, etc. that you expect from a debugger interface. It's very much a hidden gem of gdb.
Qt Creator is not terrible. I've yet to come across a GDB front-end I would qualify as "good".
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).
For some reason, I initially read the title as “…Guide to PBJ” and I got really excited about a potential guide to better indulgent sandwiches… but nope.
Very lightly toasting the bread makes them tastier. That's just a general sandwich tip, really. But with a PBJ you want it to stay soft enough that the filling doesn't squeeze out the side.
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...