Gradual Epiphany

Archive for December 2009

Running erl in a debugger

Let’s say you need to debug a port driver in Erlang. This typically involves gdb (unless you prefer the printf route). Go to where erlang is installed and edit the bin/erl script. Change the last line from:

exec $BINDIR/erlexec ${1+”$@”}

to:

if [ ! -z "$USE_GDB" ]; then
gdb [...]