help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to debug hang?


From: Perry Smith
Subject: Re: How to debug hang?
Date: Fri, 17 Nov 2006 22:13:33 -0600

On Nov 17, 2006, at 8:50 PM, David Abrahams wrote:


Hi,

I'm trying to debug some kind of a hang that occurs when I try to use
a font-lock mode I'm developing.  I can't get control back by hitting
`C-g'.  I suspected it was a bad (combinatoric) regexp, but I added
advice before and after re-search-forward that emitted enter/exit
messages, and when the hang occurs I am seeing an exit message, so I'm
guessing that's not it.  I'm quite stumped now; hoping someone can
offer a clue.

Check out debug-on-quit.  If that doesn't work, try debug-on-signal and then kill the emacs from a separate window.  I'm not sure what that will do to your context.

There is also debug-on-entry if you have a routine that is called during the hang but it doesn't sounds like you do.

The other thing you might try is run emacs from a "terminal" (xterm or similar).  It use to be that emacs would hook the quit signal to control-g would actually generate a quit unix signal so it happened immediately (via the tty code that I so know and love :-) and not via some polling process.  Its been a long time since I've used it and I don't know if it is still hooked up that way or not.

But, while that might get you into the debugger, usually I'm too lost to figure out why it is hanging, what is looping, why is it not finishing, etc.

There is a message facility that might help too -- good ole printf debug technology.  (The function is called "message".)  It puts lines into the ever present *Messages* buffer.  So, if you ever do get control back, you can see what happened.

Good luck.

Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems



reply via email to

[Prev in Thread] Current Thread [Next in Thread]