[erlang-questions] Debugging embedded Erlang system

Daniel Goertzen <>
Mon Oct 24 20:43:06 CEST 2011


If you setup distributed erlang between your embedded system and PC, maybe
you could run and debug the problematic parts on your PC.

Erlide has a nice debugger interface.  The eclipse interface should be
comforting for your java-folk.

I should also add that I've given up on debugging and just use tracing for
everything now.

Dan.

On Sun, Oct 23, 2011 at 8:45 AM, Kaiduan Xie <> wrote:

> Sorry, clicking SEND to quick.
>
> Usually I just use log/printout to do the debug. But in order to sell
> Erlang to a group of Java developers, we need to find a comfortable
> way for them too.
> I will start using debugger more in the future to see how good it is :)
>
> /Kaiduan
>
> On Sun, Oct 23, 2011 at 9:41 AM, Kaiduan Xie <> wrote:
> > No, we do not need to pause the entire VM to debug a process, we just
> > pause the particular process.
> >
> > In C/C++/Java, we all can step-through an multi-thread program,
> >
> > On Sun, Oct 23, 2011 at 9:06 AM, Fred Hebert <> wrote:
> >> Stepping through the code works okay when you've got only sequential
> code,
> >> but if you have a lot of code sensitive to timers and concurrency, then
> >> stepping through the code of one process will mess with all the timers
> >> currently running for other processes. As far as I know, there is no
> >> debugging facility letting you pause the entire VM at once.
> >>
> >> On Sun, Oct 23, 2011 at 1:31 AM, Kaiduan Xie <>
> wrote:
> >>>
> >>> I like and use trace, but my fellow developers are hard-cored JAVA
> >>> developers, they want to be able to step through the code.
> >>>
> >>> /Kaiduan
> >>>
> >>> On Sun, Oct 23, 2011 at 1:27 AM, Chandru
> >>> <> wrote:
> >>> > On 21 October 2011 17:30, Kaiduan Xie <> 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
> >>> >
> >>> >
> >>> _______________________________________________
> >>> erlang-questions mailing list
> >>> 
> >>> http://erlang.org/mailman/listinfo/erlang-questions
> >>
> >>
> >
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
*Daniel Goertzen
Senior Software Engineer
*--
*Network Integrity Systems
*We Bring Security To Light™

1937 Tate Blvd. SE
Hickory, North Carolina 28602

Phone: 828.610.4596
Fax: 828.322.5294

http://www.networkintegritysystems.com/

Visit our Blog at:
http://sipreasy.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111024/eca9594e/attachment.html>


More information about the erlang-questions mailing list