aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/unix/cerl.src
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2019-01-10 11:18:19 +0100
committerLukas Larsson <[email protected]>2019-02-05 14:34:44 +0100
commit9ad981a6184ee9b111f7526c4c9fc9c77d235241 (patch)
treea88dab58c1f09679c702334715f8df7710b3be38 /erts/etc/unix/cerl.src
parente7b3656bae68d14435eca2de9a7efbdb62b83f07 (diff)
downloadotp-9ad981a6184ee9b111f7526c4c9fc9c77d235241.tar.gz
otp-9ad981a6184ee9b111f7526c4c9fc9c77d235241.tar.bz2
otp-9ad981a6184ee9b111f7526c4c9fc9c77d235241.zip
erts: Expand rr support in cerl and etp
Diffstat (limited to 'erts/etc/unix/cerl.src')
-rw-r--r--erts/etc/unix/cerl.src29
1 files changed, 27 insertions, 2 deletions
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index 2e034513b0..bcd64d242e 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -224,7 +224,13 @@ while [ $# -gt 0 ]; do
shift
cargs="$cargs -rr"
run_rr=yes
- skip_erlexec=yes
+ case "$1" in
+ "replay"|"ps")
+ ;;
+ *)
+ skip_erlexec=yes
+ ;;
+ esac
;;
*)
break
@@ -307,7 +313,26 @@ if [ "x$GDB" = "x" ]; then
exec $taskset1 valgrind $valgrind_xml $valgrind_log $valgrind_misc_flags $BINDIR/$EMU_NAME $sched_arg $emu_xargs "$@"
elif [ $run_rr = yes ]; then
- exec rr record --ignore-nested $BINDIR/$EMU_NAME $emu_xargs "$@"
+ if [ $1 = replay ]; then
+ shift
+ cmdfile="/tmp/.cerlgdb.$$"
+ echo "set \$etp_beam_executable = \"$BINDIR/$EMU_NAME\"" > $cmdfile
+ if [ "$1" = "-p" ]; then
+ echo 'set $etp_rr_run_until_beam = 1' >> $cmdfile
+ fi
+ cat $ROOTDIR/erts/etc/unix/etp-commands.in >> $cmdfile
+ exec rr replay -x $cmdfile $*
+ elif [ $1 = ps ]; then
+ shift
+ rr ps $* | head -1
+ ChildSetup=`rr ps $* | grep 'erl_child_setup' | awk '{ print $2 }'`
+ for CS in $ChildSetup; do
+ rr ps $* | grep -E "^$CS"
+ done
+ exit 0
+ else
+ exec rr record --ignore-nested $BINDIR/$EMU_NAME $emu_xargs "$@"
+ fi
else
exec $EXEC $xargs ${1+"$@"}
fi