aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/unix/cerl.src
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-10-23 17:56:16 +0200
committerSverker Eriksson <[email protected]>2012-10-23 17:56:16 +0200
commit49b7b5d5158f89fb4bee068719d000d6c753fdcd (patch)
tree6677ca88f4f62d2a9bf4ca41f1288680db1a07d8 /erts/etc/unix/cerl.src
parent5f3a7727464522da88d07a3012aa87b8703e3f3a (diff)
parent9548270009eb2fbe06840e1cf2ed428650d9d04a (diff)
downloadotp-49b7b5d5158f89fb4bee068719d000d6c753fdcd.tar.gz
otp-49b7b5d5158f89fb4bee068719d000d6c753fdcd.tar.bz2
otp-49b7b5d5158f89fb4bee068719d000d6c753fdcd.zip
Merge branch 'sverk/valgrind-quoting'
* sverk/valgrind-quoting: Make cerl -valgrind work with quoted spaces in command line
Diffstat (limited to 'erts/etc/unix/cerl.src')
-rw-r--r--erts/etc/unix/cerl.src15
1 files changed, 10 insertions, 5 deletions
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index e0d7404de7..651452e531 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -267,11 +267,16 @@ if [ "x$GDB" = "x" ]; then
valgrind_misc_flags="$VALGRIND_MISC_FLAGS"
fi
beam_args=`$EXEC -emu_args_exit ${1+"$@"}`
- # Ahhhh... Need to quote $PROGNAME...
- early_beam_args=`echo $beam_args | sed "s|^\(.*-progname\).*$|\1|g"`
- late_beam_args=`echo $beam_args | sed "s|^$pre_beam_args.*\(-- -home.*\)$|\1|g"`
-
- exec valgrind $valgrind_xml $valgrind_log $valgrind_misc_flags $BINDIR/$EMU_NAME $emu_xargs $early_beam_args "$PROGNAME" $late_beam_args -pz $PRELOADED
+
+ # Time for some argument passing voodoo:
+ # $beam_args is a list of command line arguments separated by newlines.
+ # Make "$@" represent those arguments verbatim (including spaces and quotes).
+ SAVE_IFS="$IFS"
+ IFS='
+'
+ set -- $beam_args
+ IFS="$SAVE_IFS"
+ exec valgrind $valgrind_xml $valgrind_log $valgrind_misc_flags $BINDIR/$EMU_NAME $emu_xargs "$@" -pz $PRELOADED
else
exec $EXEC $eeargs $xargs ${1+"$@"}
fi