Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/devel' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldome committed Mar 16, 2020
2 parents 2ccb00d + fe53f6e commit c27f5a0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
9 changes: 9 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
trigger:
branches:
include:
- '*'
pr:
branches:
include:
- '*'

jobs:
- job: packages

Expand Down
20 changes: 9 additions & 11 deletions bin/nim-gdb
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ 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 || which greadlink > /dev/null || (echo "readlink not in PATH. Please install coreutils from brew if on Mac."; exit 1)

nreadlink () {
(which greadlink > /dev/null && greadlink "$@") || (which readlink > /dev/null && readlink "$@") || echo "Readlink could not be found"
}
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)
READLINK=readlink
fi

# Find out where the pretty printer Python module is
NIM_SYSROOT=$(dirname $(dirname $(nreadlink -e $(which nim))))
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
# Set the environment variable `NIM_GDB` to overwrite the call to a
# different/specific command (defaults to `gdb`).
NIM_GDB="${NIM_GDB:-gdb}"

# This is needed for some reason. I can't get -eval-command to work ever
echo "source $GDB_PYTHON_MODULE_PATH" > gdbcommands.txt
# exec replaces the new process of bash with gdb. It is always good to
# have fewer processes.
exec ${NIM_GDB} --command="gdbcommands.txt" "$@"

rm gdbcommands.txt
exec "${NIM_GDB}" -eval-command="source $GDB_PYTHON_MODULE_PATH" "$@"
1 change: 1 addition & 0 deletions bin/nim-gdb.bash
6 changes: 1 addition & 5 deletions bin/nim-gdb.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ for %%i in ("%NIM_BIN%\..\") do (set NIM_ROOT=%%~fi)
set @GDB_PYTHON_MODULE_PATH=%NIM_ROOT%\tools\nim-gdb.py
set @NIM_GDB=gdb.exe

@echo source %@GDB_PYTHON_MODULE_PATH%> wingdbcommand.txt

%@NIM_GDB% --command="wingdbcommand.txt" %*

del wingdbcommand.txt /f /q
%@NIM_GDB% -eval-command="source %@GDB_PYTHON_MODULE_PATH%" %*

EXIT /B %ERRORLEVEL%
@echo on
2 changes: 1 addition & 1 deletion doc/nimc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ passed as a command line argument to the compiler.
The ``nim`` executable processes configuration files in the following
directories (in this order; later files overwrite previous settings):

1) ``$nim/config/nim.cfg``, ``/etc/nim/nim.cfg`` (UNIX) or ``<Nim's installation director>\config\nim.cfg`` (Windows). This file can be skipped with the ``--skipCfg`` command line option.
1) ``$nim/config/nim.cfg``, ``/etc/nim/nim.cfg`` (UNIX) or ``<Nim's installation directory>\config\nim.cfg`` (Windows). This file can be skipped with the ``--skipCfg`` command line option.
2) If environment variable ``XDG_CONFIG_HOME`` is defined, ``$XDG_CONFIG_HOME/nim/nim.cfg`` or ``~/.config/nim/nim.cfg`` (POSIX) or ``%APPDATA%/nim/nim.cfg`` (Windows). This file can be skipped with the ``--skipUserCfg`` command line option.
3) ``$parentDir/nim.cfg`` where ``$parentDir`` stands for any parent directory of the project file's path. These files can be skipped with the ``--skipParentCfg`` command line option.
4) ``$projectDir/nim.cfg`` where ``$projectDir`` stands for the project file's path. This file can be skipped with the ``--skipProjCfg`` command line option.
Expand Down

0 comments on commit c27f5a0

Please sign in to comment.