# python is already in virtual-env
$ which python
# /home/test5/.mypython/pwn/bin/python
$ git clone https://github.com/bminor/binutils-gdb.git gdb
$ cd gdb
$ mkdir build
$ ../configure --with-python=$(which python3)
$ make -j$(nproc)
gdb will be created under build/gdb/
$ cd gdb
$ ./gdb
issue::gdb/data-directory
Python Exception <class 'ModuleNotFoundError'> No module named 'gdb':
./gdb: warning:
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
GDB with venv-python
that gdb's plugins are not working well on venv-python is well known issue. see https://github.com/hugsy/gef/issues/88 https://github.com/pypa/virtualenv/issues/644
Build Own GDB
gdb
will be created underbuild/gdb/
issue::gdb/data-directory
solution run gdb with
-data-directory
Launch GDB