[erlang-questions] Debugging embedded Erlang system
Sun Oct 23 15:41:51 CEST 2011
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.
>> 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
More information about the erlang-questions