Voltron
Voltron is a powerful python front-end for gdb.
References
How to customize/extend Voltron:
Install (manually)
This is the procedure to follow to install Voltron manually, for instance on a custom instance of gdb or on an offline pc. This procedure follows the file install.sh from voltron repository.
- Install apt dependencies
# From voltron/install.sh
sudo apt-get -y install libreadline6-dev python-dev python-setuptools python-yaml python-pip
# To fix error "missing library libncursesw.so.5"
sudo apt-get -y install libncursesw5 # On 32-bit python, use libncursesw5:i386
- Install python dependencies
Here we install in user local site (--user
).
# Extra dependency for requests_unixsocket
pip install --user pbr
# To fix error "ImportError: No module named pkg_resources" when importing scruffy
pip install --user setuptools
# From voltron/install.sh
pip install --user 'scruffington>=0.3.6' flask flask_restful blessed pygments requests requests_unixsocket six pysigset pygments
- Check dependencies
We can check some dependencies before installing voltron. Start your gdb and run the following commands. These should run without errors. If not, check the troubleshooting section.
>>> pi import scruffy
>>> pi import flask
- Install voltron module
Now, we are ready to install voltron module. We use --no-deps
since we installed the dependencies ourselves. Use developer mode if you plan to modify voltron.
cd path/to/voltron
pip install --user --no-deps .
pip install --user --no-deps -e . # To install in "developer mode"
Source voltron from ~/.gdbinit. For the path, either point to the site-package, or to the voltron repository if installed in developer mode.
source /path/to/your/voltron/entry.py
Finally, add the following to ~/.bashrc:
# set PATH to include users' .local/bin if it exists
if [ -d "${HOME}/.local/bin" ] ; then
PATH="${HOME}/.local/bin:${PATH}"
fi
Or alternatively:
alias voltron=~/.local/bin/voltron
- Installing on offline PC
- Use
apt-offline
to transfer apt packages. - Use
pip download
to download pip packages (see Python).
- Troubleshooting
- Error
ImportError: cannot import name md5
.
- This occurs on
import flask
. Looking at the `_hashlib.so` dependencies, we have:
locate _hashlib.so
ldd /path/to/your/_hashlib.so
# linux-gate.so.1 => (0xf77c3000)
# libssl.so.6 => not found
# libcrypto.so.6 => not found
# libpython2.7.so.1.0 => not found
# libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf776a000)
# libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf75b3000)
# /lib/ld-linux.so.2 (0x5659b000)
- Looking on the internet, we find reference of libssl.so.6 and {{file|libcrypto}.so.6} on RedHat 6, related to OpenSSL 0.9.8e. On Ubuntu, we find similar libraries in package libsslfrom Ubuntu Precise LTS 12.04 32-bit.
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.2_i386.deb
dpkg -x libssl0.9.8_0.9.8o-7ubuntu3.2_i386.deb tmp
sudo cp ./tmp/lib/i386-linux-gnu/libssl.so.0.9.8 /lib/i386-linux-gnu/libssl.so.6
sudo cp ./tmp/lib/i386-linux-gnu/libcrypto.so.0.9.8 /lib/i386-linux-gnu/libcrypto.so.6
- Error
ImportError: No module named pkg_resources
.
- Install python package setuptools (see Python).