target=loongarch-linux-gnueabihf
version=9.1
# Download and extract
cd /tmp
[ -e gdb-$version.tar.xz ] || wget https://ftp.gnu.org/gnu/gdb/gdb-$version.tar.xz
rm -rf gdb-$version
tar xf gdb-$version.tar.xz
mkdir -p gdb-$version/build
cd gdb-$version/build
# Get the Python executable and library directory, eg: /usr/lib
[ -z "${PYTHON}" ] && export PYTHON=python3
PYTHON_LIBDIR=$("${PYTHON}" -c \
"import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
# Configure GDB
../configure \
--prefix="$HOME/.local" \
--target=$target \
--with-python="${PYTHON}" \
LDFLAGS="-L${PYTHON_LIBDIR}"
# Build and install GDB
make -j$(nproc)
make -C gdb install
loongarch gdb can execute python script, rebuild native gdb
最新推荐文章于 2024-10-13 21:29:35 发布