[erlang-questions] Debugging embedded Erlang system

Kaiduan Xie kaiduanx@REDACTED
Sun Oct 23 07:31:45 CEST 2011

I like and use trace, but my fellow developers are hard-cored JAVA
developers, they want to be able to step through the code.


On Sun, Oct 23, 2011 at 1:27 AM, Chandru
<chandrashekhar.mullaparthi@REDACTED> wrote:
> On 21 October 2011 17:30, Kaiduan Xie <kaiduanx@REDACTED> wrote:
>> Hi,
>> We need to debug an Erlang server running in an embedded system where
>> no GUI is available. We can attach an Erlang shell to the server from
>> a remote box with GUI. Can we use debugger on GUI box to remote debug
>> the server on embedded system? Can someone share the experience?
> You can use the in built trace facilities? I personally use dbg whenever I
> need to look at a running system and figure out what is happening. Some care
> is needed on what parts of the system you trace to make sure you don't swamp
> the system with traces. I have rendered a few systems unsuable because of
> the volume of tracing if the wrong trace pattern is chosen :) I typically
> use something like this:
> dbg:tracer(port, dbg:trace_port(file, "trace_file.dbg")).
> dbg:p(all,call).
> dbg:tp(module, function, dbg:fun2ms(fun(_) -> return_trace() end)).
> Traces will now start to be written to the file trace_file.dbg
> Once you've collected enough traces:
> dbg:ctp().
> dbg:flush_trace_port().
> You can then examine the trace file (binary file) using commands in dbg. I
> use the attached module to convert it to plain text.
> Or you can take a look at redbug: https://code.google.com/p/eper/
> cheers
> Chandru

More information about the erlang-questions mailing list