Linked by Eugenia Loli-Queru on Thu 1st Dec 2005 17:24 UTC
Linux This is an interesting method of speeding up your debugging phase. This article gives a background on Linux signals with examples specifically tested on PPC Linux, then goes on to show how to design your handlers to output information that lets you quickly home in on failed portions of code.
Thread beginning with comment 68132
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: printf in a signal handler
by james_parker on Fri 2nd Dec 2005 22:52 UTC in reply to "printf in a signal handler"
james_parker
Member since:
2005-06-29

This is generally true, although a version of printf could be written that may be called safely. (I've done that before to get past such issues in code I've inherited before cleaning it up later).

I took its use to be "generally illustrative" rather than detailed recommended practice (I suspect the author wasn't considering the printf call to be part of the technique but used it as shorthand for saying "print information here").

The author should have recognized this, though; and included a warning about this practice, or simply left the print example as a comment.

Reply Parent Bookmark Score: 1