Skip to content

Commit b65ed0d

Browse files
simarkpalves
authored andcommitted
Fix unexpected argument splitting
This doesn't work: $ isolate-gpu -d 2 ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.rocm/simple/simple -ex "with breakpoint pending on -- break do_an_addition" Excess command line arguments ignored. (pending ...) Reading symbols from testsuite/outputs/gdb.rocm/simple/simple... /home/smarchi/build/binutils-gdb-amd-staging/gdb/breakpoint: No such file or directory. Missing arguments. (gdb) The argument `"with breakpoint ..."` gets split along the way. Fix it by using "$@", which doesn't split the args that contain spaces. Change the "else" portion just to match the style of the "if" section. With this patch, I get the expected: $ isolate-gpu -d 2 ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.rocm/simple/simple -ex "with breakpoint pending on -- break do_an_addition" Reading symbols from testsuite/outputs/gdb.rocm/simple/simple... Function "do_an_addition" not defined. Breakpoint 1 (do_an_addition) pending. (gdb)
1 parent 1c5b4a6 commit b65ed0d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

entrypoint.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# SPDX-License-Identifier: GPL-3.0-or-later
33
# Author : Pedro Alves (pedro@palves.net)
44

5+
cd "$ISOLATE_GPU_CWD" || exit 1
6+
unset ISOLATE_GPU_CWD
7+
58
if [ $# -gt 0 ]; then
6-
exec sh -c "cd $ISOLATE_GPU_CWD && \
7-
unset ISOLATE_GPU_CWD && \
8-
$*"
9+
exec "$@"
910
else
10-
exec sh -c "cd $ISOLATE_GPU_CWD && \
11-
unset ISOLATE_GPU_CWD && \
12-
$SHELL --login"
11+
exec $SHELL --login
1312
fi

0 commit comments

Comments
 (0)