1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-09 12:03:49 -05:00

Install python-gdb.py.

The script in `Tools/gdb/libpython.py` has helper functions for
debugging Python processes under gdb. When installed to `{exe}-gdb.py`
it will automatically be loaded by gdb assuming it is in the safe path.

gdb resolves all symlinks, so having the single script is sufficient
regardless of how Python is invoked.

Since it is usually only included as part of a dbg/dev package, this
file is intentionally excluded from install by the CPython build
scripts. Like the packaging with EPEL/Debian, we opt to manually copy
it after the build/install.

To ensure this file gets picked up it is enough for users to put this in
their `~/.gdbinit`:

```
add-auto-load-safe-path ~/.pyenv
```

Fixes #1190.
This commit is contained in:
Chris Hunt
2019-02-18 11:05:38 -05:00
parent 99092d7fd1
commit 3018241aee
41 changed files with 78 additions and 68 deletions

View File

@@ -1813,6 +1813,16 @@ build_package_verify_py38() {
build_package_verify_py37 "$1" "${2:-3.8}"
}
# Copy Tools/gdb/libpython.py to pythonX.Y-gdb.py (#1190)
build_package_copy_python_gdb() {
if [ -e "$BUILD_PATH/$1/Tools/gdb/libpython.py" ]; then
local version_re='-([0-9]\.[0-9]+)'
[[ "$1" =~ $version_re ]]
local python_bin="$PREFIX_PATH/bin/python${BASH_REMATCH[1]}"
cp "$BUILD_PATH/$1/Tools/gdb/libpython.py" "$python_bin-gdb.py"
fi
}
build_package_ez_setup() {
local ez_setup="ez_setup.py"
rm -f "${ez_setup}"