make nim-gdb compatible with BSD systems (#14700)
This commit is contained in:
parent
bb62feff72
commit
99ad65fdd6
1 changed files with 4 additions and 6 deletions
12
bin/nim-gdb
12
bin/nim-gdb
|
|
@ -5,17 +5,15 @@ set -e
|
||||||
|
|
||||||
which nim > /dev/null || (echo "nim not in PATH"; exit 1)
|
which nim > /dev/null || (echo "nim not in PATH"; exit 1)
|
||||||
which gdb > /dev/null || (echo "gdb not in PATH"; exit 1)
|
which gdb > /dev/null || (echo "gdb 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
|
|
||||||
else
|
|
||||||
which readlink > /dev/null || (echo "readlink not in PATH."; exit 1)
|
which readlink > /dev/null || (echo "readlink not in PATH."; exit 1)
|
||||||
READLINK=readlink
|
|
||||||
|
if [[ "$(uname -s)" == "Darwin" || "(uname -s)" == *"BSD" ]]; then
|
||||||
|
NIM_SYSROOT=$(dirname $(dirname $($READLINK -f $(which nim))))
|
||||||
|
else
|
||||||
|
NIM_SYSROOT=$(dirname $(dirname $($READLINK -e $(which nim))))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find out where the pretty printer Python module is
|
# 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"
|
GDB_PYTHON_MODULE_PATH="$NIM_SYSROOT/tools/nim-gdb.py"
|
||||||
|
|
||||||
# Run GDB with the additional arguments that load the pretty printers
|
# Run GDB with the additional arguments that load the pretty printers
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue