voltron
A half-arsed UI module for GDB.
I got sick of GDB's (lack of) UI, so I built this. fG!'s gdbinit makes GDB slightly more bearable, and this does a similar job in a different way. voltron
allows you to attach views running in other terminal windows to a GDB session, resulting in a more modular and flexible UI like you get in a GUI debugger like WinDbg, Immunity Debugger, OllyDbg, etc. It's not in the same league as a proper GUI debugger, but it does make GDB more bearable.
It's basically held together by sticky tape, so don't expect too much.
Requirements
voltron
only works with GDB version 7 and later as it uses the Python API. If you're using Apple's GDB v6 you're out of luck; however, there is a project in the works to port some of Apple's hacks to version 7, so keep an eye out for that.
Usage
-
Put the following in your .gdbinit (or .gdbinit.local if you're using fG!'s gdbinit):
source /path/to/voltron.py
-
Fire up GDB and start the
voltron
server thread (you could also put this in your .gdbinit)$ gdb whatever gdb$ voltron start
-
In another terminal (I use iTerm panes) start one of the UI views
$ voltron.py reg -v $ voltron.py stack $ voltron.py disasm $ voltron.py bt
-
The UI view code will attach to the server (via a domain socket) and refresh every time the debugger is stopped. So, set a break point and let the debugger hit it and everything should be updated.
-
Before you exit GDB, execute the following command or GDB will hang since the domain socket will still be open.
gdb$ voltron stop
Bugs
If you don't voltron stop
before you try to exit GDB the domain socket remains open, and GDB will hang. I couldn't see a hook in the python API to get a notification when GDB is about to exit. It's probably there, but I'll fix it later. Maybe.
There are probably others.
Development
I hacked this together in a night and I don't have the motivation to do any further work on it at this stage, but I may add to it as I use it more.
Things I probably will do at some stage in the not too distant future:
- Better colour support throughout all views like in the register view
- Move a bunch of the colour and template stuff to a config file
- Do something better than use Pygments with the sucky GDB lexer
Feel free to add to it and send a pull request.
If you want to add a new view type you'll just need to add a new subclass of VoltronView
(see the others for examples) that registers and renders data your own message type, and add some code to VoltronCommand.stop_handler
to grab the necessary data and cram it into a message with that type.
License
This software is released under the "Buy snare a beer" license. If you use this and don't hate it, buy me a beer at a conference some time.
FAQ
Q: Dude, why don't you just use X?
A: IDA's debugger doesn't work with Y, LLDB doesn't work with Z, none of the GDB UIs are any good for assembly-level debugging, and I don't use Windows.