[erlang-questions] Debugging embedded Erlang system
Chandru
chandrashekhar.mullaparthi@REDACTED
Sun Oct 23 07:27:29 CEST 2011
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111023/9a12d243/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dump_dbg.erl
Type: application/octet-stream
Size: 1115 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111023/9a12d243/attachment.obj>
More information about the erlang-questions
mailing list