> Simply trapping doesn't tell you anything about caused the trap. > There are at least two distinct possibilities: NULL pointer > dereference and integer division by zero. There should be some way to > distinguish those two cases. It's reasonably easy to do so in a > signal handler. When should we do if the compiler generate a call to > __builtin_throw?
You would use the fallback code in the signal handler, throwing the exception used when you don't know the precise cause of the erroneous execution. Or else we could pass an argument to __builtin_throw, but we would need some low- level convention to pass it on to the handler. -- Eric Botcazou