Tom Tromey's been blogging recently about forthcoming Python support. So instead of GDB's old joke of "canned sequences of commands" (at least they had the decency not to claim it was anything more than it was), you can now use Python. I haven't used it, but it seems impressive, and a huge leap forward.
Here's a handy table of contents if you're interested:
- 1. Installing a Python-enabled debugger
- 2. Writing a new gdb command
- 3. gdb convenience functions
- 4. Parameters, and extending require
- 5. The filtering backtrace
- 6. Auto-loading Python code
- 7. Pretty printing, part 1
- 8. Pretty printing, part 2
- 9. Scripting gdb
- 10. Wacky stuff
- 11. The End
It's a shame to see the new features are Python-only. (But at least they're not Guile-only. Does anyone else remember when that was the "official" GNU scripting language? It's rare to see insanity that pure in public.)
I realize that supporting arbitrary languages is a non-trivial problem, but I'd love to see the Free world at least making an effort to solve this problem. Too often we see Python-only or Ruby-only or C-only or Java-only, where a useful aspect of genuine freedom would be "freedom to use whatever language you/your team are most comfortable with". I feel like applications are being used as battlegrounds to wage inter-language wars. Don't get me wrong: just because I'd rather use Ruby right now doesn't mean I won't need to use Python next year, or that I want to stop you using Java in the meantime.
Putting an end to this form of linguistic lock-in would be a huge leap forward for Free software, not just for GDB.
In the meantime, at the cost of learning Python, it looks like advanced GDB users just got a lot of interesting new opportunities.