aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/unix
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-11-07 12:01:30 +0100
committerLukas Larsson <[email protected]>2013-11-07 12:01:30 +0100
commitd8657d0bbdf4db7a018b9a614b472120a810689e (patch)
treef5874287db5981195b29b2ba21c6088b6c727b21 /erts/etc/unix
parent945c8083c17f6f1d474aa26f5643174767f5bb76 (diff)
parent5bddfc9a002f27df1228182ac170e7e4a7023fc0 (diff)
downloadotp-d8657d0bbdf4db7a018b9a614b472120a810689e.tar.gz
otp-d8657d0bbdf4db7a018b9a614b472120a810689e.tar.bz2
otp-d8657d0bbdf4db7a018b9a614b472120a810689e.zip
Merge branch 'lukas/cerl_dump/OTP-11468' into maint
* lukas/cerl_dump/OTP-11468: erts: Add cerl -dump and dumping in z_SUITE
Diffstat (limited to 'erts/etc/unix')
-rw-r--r--erts/etc/unix/cerl.src28
1 files changed, 27 insertions, 1 deletions
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index 41baa323ed..38c6dd037f 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -33,6 +33,7 @@
# You have to start beam in gdb using "run".
# -rgdb Run the debug compiled emulator in gdb.
# You have to start beam in gdb using "run".
+# -dump Dump the bt of all threads in a core.
# -break F Run the debug compiled emulator in emacs and gdb and set break.
# The session is started, i.e. "run" is already don for you.
# -xxgdb FIXME currently disabled
@@ -178,6 +179,12 @@ while [ $# -gt 0 ]; do
cargs="$cargs -frmptr"
TYPE=.frmptr
;;
+ "-dump")
+ shift
+ GDB=dump
+ core="$1"
+ shift
+ ;;
"-gdb")
shift
GDB=egdb
@@ -331,7 +338,7 @@ elif [ "x$GDB" = "xgdb" ]; then
echo "source $ROOTDIR/erts/etc/unix/etp-commands" > $cmdfile
# Fire up gdb in emacs...
exec gdb $GDBBP -x $cmdfile $gdbcmd
-else
+elif [ "x$GDB" = "xegdb" ]; then
if [ "x$EMACS" = "x" ]; then
EMACS=emacs
fi
@@ -372,4 +379,23 @@ else
(comint-send-input)"
# Fire up gdb in emacs...
exec $EMACS --eval "(progn (gdb \"gdb $GDBARGS$EMU_NAME\") $gdbcmd)"
+elif [ "x$GDB" = "xdump" ]; then
+ cmdfile="/tmp/.cerlgdb.$$"
+ case "x$core" in
+ x/*)
+ gdbcmd="$EMU_NAME ${core}"
+ ;;
+ *)
+ dir=`pwd`
+ gdbcmd="$EMU_NAME ${dir}/${core}"
+ ;;
+ esac
+ echo "set width 0
+set height 0
+set verbose off
+
+source $ROOTDIR/erts/etc/unix/etp-commands
+thread apply all bt
+" > $cmdfile
+ exec gdb --batch --command=$cmdfile $gdbcmd
fi