This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Is it possible to preserve flags for fetestexcept() inside signal handler


As a debugging aid, I use feenableexcept() and set a signal handler
that provides a trace. Unfortunately, calling fetestexcept() inside
the signal handler shows all flags unset so there is no way for the
user to know what kind of floating point exception occurred. The best
I've managed is to give the user directions for running the program in
gdb, how to call fetestexcept() themselves once the error has trapped,
and how to interpret the results [1].

Is this the best I can do or is there some way to make fetestexcept()
return the correct flags when called from the signal handler? Does the
kernel reset them unconditionally?


[1] This especially sucks because the numeric codes are a lot to
remember and the macros aren't visible to GDB; I should write a
utility function to be called from the debugger.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]