Re: Questions

"Bill Clementson" <[email protected]> Mon, 4 Jun 2007 21:54:36 -0700
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Hi Kirill,

On 6/4/07, Bill Clementson <[email protected]> wrote:
> On 6/3/07, Kirill Zaborski <[email protected]> wrote:
> > On 6/4/07, Bill Clementson <[email protected]> wrote:
> > On 6/2/07, Kirill Zaborski <[email protected]> wrote:
> > > >
> > > >
> > > > On 6/1/07, Bill Clementson <[email protected]> wrote:
> > > > > "Kirill Zaborski" <[email protected]> writes:
> > > > >
> > > > > Since it wants to connect to the "emacs@..." node, it looks like
> > > > > you've followed the same naming convention that I used to specify the
> > > > > node for the Erlang Shell in Emacs. Since it's giving a "nodedown"
> > > > > error message, that means that it can't communicate with it. Perhaps
> > > > > you might have deleted the Erlang Shell buffer (breaking the
> > > > > connection). If you closed the shell and re-started it, you will
> > > > > probably need to reconnect to the node with "C-c C-d n".
> > > >
> > > > Tried this at home and it looks  like everything  works OK.
> > > >  The thing that I do not understand is - how do I stop debugging? I press
> > > > 'c', see the result in shell but some number of buffers appear... Should I
> > > > close them manually? I'm a newbie to emacs so maybe it's a dumb question for
> > > > you :)
> > >
> > > I'm not sure I understand the question. Once your program runs to
> > > completion (in debug mode), the breakpoints are still active so you
> > > can re-run the program again and hit the same breakpoints. You can
> > > toggle debug interpreting with "C-c C-d i" if you don't want the
> > > breakpoints to be active.
> > >
> > > If you don't want to debug anymore, then you can just toggle off debug
> > > interpreting and close the edb buffer.
> > >
> > > Does that answer your question?
> >
> > Something weird happens: tried debugging at work - says 'nodedown'.
> > Erlang shell runs OK. Setup is almost identical.
>
> The debugger seems to be very "touchy" - I had to play around with it
> a lot till I found a sequence of actions that appeared to consistently
> work. However, I upgraded to R11B-4 last night and I'm experiencing
> problems with it again. I'm traveling at the moment, but will try to
> experiment with it a bit more.

I think I've found the problem (at least, the problem I was
experiencing). Apply the attached patch to distel/elisp/edb.el and let
me know if this helps matters for you. Please do the following steps
to see if it works:

1. Open an erlang file (say "myfile.erl") in an emacs buffer and start
up an erlang shell. In the erlang node (shell), do: c("myfile.erl",
[debug_info]).
2. In your emacs myfile.erl buffer, press "C-c C-d n" and specify the node
3. In your emacs myfile.erl buffer, press "C-c C-d L" to reload
4. In your emacs myfile.erl buffer, press "C-c C-d i" to toggle
interpreting. If it says that interpreting is stopped, press "C-c C-d
i" 1 more time to start interpreting. However, if it says that
interpreting is started, press "C-c C-d i" 2 more times to stop and
re-start interpreting.
5. In your emacs myfile.erl buffer, put the cursor on a source line
and press "C-x SPC" to set a breakpoint. If the breakpoint is
highlighted in orange - GREAT! If it's highlighted in blue - press
"C-c C-d s" to sync the breakpoint.
6. In the erlang node (shell), run an erlang function that will hit
the breakpoint.

At this point (hopefully), you should be debugging erlang code in
emacs. There are probably some things that can be done to streamline
the above process; however, if you try the steps exactly as I outlined
them above, that should tell me whether the fix is working for you.

> > So I'm not sure about your answer (can not try it at the moment).
> > But even with debugging broken I get a couple of buffers (*edb*
> > *edbproc*) - do I have to kill them manually?
>
> Yes, it does leave around a few buffers. It would be nice if the "q"
> command cleared those up.

After playing around with the debugger a bit, it would appear that
most debug buffers are handled ok by Distel (e.g. - it deletes ones
that should be deleted - others it leaves as it doesn't necessarily
know when an "entire" debug session has ended as opposed to just the
debug session for a single process).

Let me know how you get on with debugging after you've applied the patch.

- Bill

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Distel-hackers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/distel-hackers
patch (application/octet-stream, 566 B) - not displayed