sighnd.inc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt,
  5. member of the Free Pascal development team.
  6. Signal handler is arch dependant due to processor to language
  7. exception conversion.
  8. See the file COPYING.FPC, included in this distribution,
  9. for details about the copyright.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. **********************************************************************}
  14. procedure SignalToRunerror(Sig: longint; _a2,_a3,_a4 : dword; SigContext: PSigInfo; uContext : PuContext); cdecl;
  15. var
  16. res,fpustate : word;
  17. begin
  18. res:=0;
  19. case sig of
  20. SIGFPE :
  21. begin
  22. { don't know how to find the different causes, maybe via xer? }
  23. res := 207;
  24. end;
  25. SIGILL,
  26. SIGBUS,
  27. SIGSEGV :
  28. res:=216;
  29. end;
  30. { give runtime error at the position where the signal was raised }
  31. if res<>0 then
  32. HandleErrorAddrFrame(res,pointer(uContext^.uc_mcontext.arm_ip),pointer(uContext^.uc_mcontext.arm_fp));
  33. end;
  34. {
  35. $Log$
  36. Revision 1.3 2005-01-30 18:01:15 peter
  37. * signal cleanup for linux
  38. * sigactionhandler instead of tsigaction for bsds
  39. * sigcontext moved to cpu dir
  40. Revision 1.2 2004/03/27 19:20:11 florian
  41. * signal handling fixed
  42. Revision 1.1 2003/11/21 00:40:06 florian
  43. * some arm issues fixed
  44. }