3 ms·
Print statements for small one-off programs. IDE with integrated debugger for larger programs (mostly C# and some Java experience here). gdb (or similar) for
by Jtsummers 5y ago
Print statements for small one-off programs.
IDE with integrated debugger for larger programs (mostly C# and some Java experience here).
gdb (or similar) for programs without an IDE and larger than a small one-off program.
Some languages also lend themselves (or their implementations do) to better debugging experiences. Common Lisp debugging, for instance, is almost a joy. For grins, I implemented the VM for the Synacor Challenge [0] in tandem with SBCL's debugger. After parsing the opcode, the program entered an ecase. If there was no entry for the opcode, it brought up the debugger, I extended the program, recompiled whatever needed to be recompiled, and resumed it. Wash, rinse, repeat. Once every opcode was implemented it then went on to run the image and I could finish the challenge.
[0] https://challenge.synacor.com/ https://challenge.synacor.com/
- auxym 5y agoDo you use plain terminal gdb or some sort of front end over it? Gdb is extremely powerful but UX is abysmal, I wish there was some interactive GUI that would expose most of its functionality in an interactive and intuitive way.
- Jtsummers 5y agoPlain gdb, or its TUI on occasion. EDIT: I originally wrote this on my phone and while in a bit of a rush. More relaxed today. I learned plain (CLI) gdb in college, it was taught as part of an exercise in the 3rd CS course and I found it useful during the course. Though I also still largely used printf debugging back then. At some point I had to debug embedded systems that I could connect to via a serial terminal that had gdb running on them. A GUI was not feasible, so I really learned gdb at that point and found I remembered it well enough to not need another interface. But yes, a GUI would be nice especially if it's a tool you use infrequently (like it would be for me now, I don't do much in the way of professional C or C++ programming that would benefit from gdb knowledge at this point, or not on systems where it can be used).