Mail Archives: djgpp/2000/07/04/13:30:32
Eli Zaretskii schrieb:
> > if I don't use FPE
> > double a=0;
> > double b=1;
> > double c=b/a;
> > double d=a*c;
> > printf("%g %g\n",c,d);
> > just prints 'Inf NaN'
>
> Even if you unmask numerical exceptions in the FPU? What about the
> FPU status word--does it have the corresponding exception bits set?
if I call the sigfpe() function I posted before, it behaves much like
how I intended: It throws the SIGABRT telling me [DIVBYZERO] or [INVALID].
The only odd thing is that I have to call symify manually. And of course
the fact tat I DO USE exceptions in that case.(as you discussed before/below)
> But you could place such checkpoints in strategic places and zero in
> on the problem. (IMHO, you will want to leave these safeguards in the
> production code anyway, whereas FP exceptions generally cannot remain
> unmasked beyond the debugging period.)
of course, I agree.
My actual intent is to use it (mainly) in the development phase.
> It's the exception itself, long before it gets converted into SIGFPE.
> (To do this, DJGPP startup code installs a handler for Int 75h in
> protected mode, and when the interrupt hits, it invalidates the DS
> selector, exactly like the keyboard handler does with Ctrl-C.)
>
> > print_symified_traceback(...); // anyone did that before ???
>
> Yes. See the docs for the function __djgpp_traceback_exit. However,
> SIGABRT is not your problem, so this won't help you.
Thanks for clarification.
a __djgpp_symified_traceback_exit() would be handy though :-)
--
Gruss Waldemar Schultz.
Technische Universität München, Zentrum Mathematik M1, D 80290 München
Tel: +49 (0)89 2892 8226 FAX: +49 (0)89 2892 8228
- Raw text -