Error handler patch

John Tytgat John.Tytgat at aaug.net
Sat Apr 17 06:56:41 PDT 2004


In message <200404162136.16080 at zamez.strcprstskrzkrk.co.uk>
          James Bursa <bursa at users.sourceforge.net> wrote:

> This patch makes some improvements to the handler for RISC OS errors.
> 
> [...]
> 3. Dump floating point registers for FP errors.
> [...]
> +	if (signo == SIGOSERROR || signo == SIGFPE || signo == SIGEMT)
> +	  {
> +	    fprintf(stderr, "\nError 0x%x: %s\n pc: %8x\n", __ul_errbuf.errnum,
> +			    __ul_errbuf.errmess, __ul_errbuf.pc);
> +	  }
> +	if (signo == SIGFPE)
> +	  {
> +	    fprintf(stderr, " f0: %f  f1: %f  f2: %f  f3: %f\n"
> +			    " f4: %f  f5: %f  f6: %f  f7: %f  fpsr: %x\n",
> +			    __ul_fp_registers.f[0], __ul_fp_registers.f[1],
> +			    __ul_fp_registers.f[2], __ul_fp_registers.f[3],
> +			    __ul_fp_registers.f[4], __ul_fp_registers.f[5],
> +			    __ul_fp_registers.f[5], __ul_fp_registers.f[7],
> +			    __ul_fp_registers.fpsr);
> +	  }

Not sure if this is a real problem but suppose SIGFPE gets raised because
of doing an operation with an illegal floating point value (I think this can
happen, could someone confirm ?), aren't we here in the situation that the
the fprintf("%f") will raise again ? And potentionally loop forever ?

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven




More information about the gcc mailing list