in reply to determining the line# of code when an alarm() trips?
I don't know. The information is surely available somewhere (since the program needs to resume after the handler exits), but it might not be easy to obtain.
You could trace the code using a debugger. Tracing displays each executed line as it is executed.
Alternatively, you could do some manual tracing. Put a few print statements in strategic locations — don't forget to turn off buffering — and run the program. Now that you have a better idea where the problem is, put more print statements in that area and run the program again. Repeat this process until you locate the problem. This is the same idea behind binary searches.
|
|---|