[erlang-questions] Debugger

Bryan Fink bryan.fink@REDACTED
Tue May 5 05:21:17 CEST 2009


On Mon, May 4, 2009 at 5:09 PM, Mark Selby <mark@REDACTED> wrote:
> Any way to add a "debugger()" function to something
> (webmachine/yaws/mochiweb/whatever) to get a (bash) console in the
> current context?

This time I have just two answers for you, assuming that by "context"
you meant the context of the request currently being processed.
Neither involves a console, but does involve a debugger of sorts:

Answer 1: Webmachine has a trace utility built in, so you can inspect
what happened in your resource post-mortem.

http://bitbucket.org/justin/webmachine/wiki/WebmachineDebugging

Answer 2: You can always fire up the Erlang debugger
(debugger:start/0) and place a breakpoint in any of your code.  Issue
your request, and the debugger will stop at the breakpoint, allowing
you to step through the code.

http://erlang.org/doc/apps/debugger/index.html

On the other hand, if by "context", you really just meant the context
of the webserver in general, then you're in luck - the shell prompt
you're sitting at when you fire up the server is connected to the
erlang node of that server.  If that shell is disconnected, you can
always connect with another one by passing the "-remsh" argument to
erl.

-Bryan



More information about the erlang-questions mailing list