make nim-gdb compatible with BSD systems (#14700)

This commit is contained in:
BarrOff
2020-06-18 20:48:55 +02:00
committed by GitHub
parent bb62feff72
commit 99ad65fdd6

View File

@@ -5,17 +5,15 @@ set -e
which nim > /dev/null || (echo "nim not in PATH"; exit 1)
which gdb > /dev/null || (echo "gdb not in PATH"; exit 1)
which readlink > /dev/null || (echo "readlink not in PATH."; exit 1)
if [[ "$(uname -s)" == "Darwin" ]]; then
which greadlink > /dev/null || (echo "readlink not in PATH. Please install coreutils from homebrew."; exit 1)
READLINK=greadlink
if [[ "$(uname -s)" == "Darwin" || "(uname -s)" == *"BSD" ]]; then
NIM_SYSROOT=$(dirname $(dirname $($READLINK -f $(which nim))))
else
which readlink > /dev/null || (echo "readlink not in PATH."; exit 1)
READLINK=readlink
NIM_SYSROOT=$(dirname $(dirname $($READLINK -e $(which nim))))
fi
# Find out where the pretty printer Python module is
NIM_SYSROOT=$(dirname $(dirname $($READLINK -e $(which nim))))
GDB_PYTHON_MODULE_PATH="$NIM_SYSROOT/tools/nim-gdb.py"
# Run GDB with the additional arguments that load the pretty printers