12/29/2011

Debugging erl with gdb in Emacs

If you want to debug erl(exec) and use Emacs, you need just a few tricks. This short post is based upon @dizzyd's hint: http://dizzyd.com/blog/post/190

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 RETURN

Etc. etc. etc. You're welcome.

No comments: