Copy bin/erl into e.g. bin/erldbg and edit this script. Change:
exec $BINDIR/erlexec ${1+"$@"}to
gdb --annotate=3 $BINDIR/erlexec --args $BINDIR/erlexec ${1+"$@"}Now fire up Emacs, do "M-x gdb" and use your bin/erldbg as gdb runner. Now you have an erlexec under debugger and can do whatever you do debugging.
To start the shell, just do:
(gdb) r RETURNEtc. etc. etc. You're welcome.