On 21 October 2011 17:30, Kaiduan Xie <span dir="ltr"><<a href="mailto:kaiduanx@gmail.com" target="_blank">kaiduanx@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi,<br>
<br>
We need to debug an Erlang server running in an embedded system where<br>
no GUI is available. We can attach an Erlang shell to the server from<br>
a remote box with GUI. Can we use debugger on GUI box to remote debug<br>
the server on embedded system? Can someone share the experience?<br>
<br></blockquote><div><br>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:<br>


<br>dbg:tracer(port, dbg:trace_port(file, "trace_file.dbg")).<br>dbg:p(all,call).<br>dbg:tp(module, function, dbg:fun2ms(fun(_) -> return_trace() end)).<br><br>Traces will now start to be written to the file trace_file.dbg<br>


<br>Once you've collected enough traces:<br>dbg:ctp().<br>dbg:flush_trace_port().<br><br>You can then examine the trace file (binary file) using commands in dbg. I use the attached module to convert it to plain text.<br>


<br>Or you can take a look at redbug: <a href="https://code.google.com/p/eper/" target="_blank">https://code.google.com/p/eper/</a><br><br>cheers<br>Chandru<br><br></div></div>