On Tue, 27 Aug 2002, Alexander Sirotkin wrote:
I decided I will try to debug the problems I've reported
on this mailing list, but I need some directions. What is the general
approach of debugging emacs? Debugging emacs lisp modules?
If it's a bug in XEmacs itself -- the C code side -- you generally ask
on the beta list. If it's in Lisp, it's actually pretty easy to do if
you understand the basics of Emacs Lisp.
Good old printf or there is some kind of debugger?
I find that both of these are useful. There is `message' which puts a
little message into the logs, and can be useful. If you call `debug' as
a form, though, you drop into the simple lisp debugger.
I generally insert '(debug)' into the top of a function I am debugging,
hit C-A-x to eval it, then trigger the action.
C-h b shows the bindings, which are pretty easy to figure out.
edebug is highly spoken of by others but, personally, I never got it to
work right. OTOH I /like/ the gdb command line, so you can't judge much
from that. :)
Any tips worth mentioning ?
Make sure that you have the source files (.el) installed. You don't get
much debugging information or ability to step in to code that is byte
P.S. The problems I was referring to are: 1. clearcase.el hangs on
That may be solved with the debugger, or at least may show you where the
2. filename tabs sometimes disappear
...you may be lucky.
3. xemacs hangs (I think it only happens when x-debug-mode is NOT
The C code isn't that hard to pick up. :)
A stupid man's report of what a clever man says can never be accurate, because
he unconsciously translates what he hears into something he can understand.
-- Bertrand Russell