sighnd.inc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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; SigContext: SigContextRec); 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. HandleError(res);
  33. // HandleErrorAddrFrame(res,pointer(SigContext.uc.uc_mcontext.pt_regs^.nip),pointer(SigContext.uc.uc_mcontext.pt_regs^.gpr[1]));
  34. end;
  35. {
  36. $Log$
  37. Revision 1.2 2003-11-06 16:28:52 peter
  38. * compile fix
  39. Revision 1.1 2003/11/06 16:22:01 peter
  40. * sparc
  41. Revision 1.1 2003/11/02 14:53:06 jonas
  42. + sighand and associated record definitions for ppc. Untested.
  43. Revision 1.2 2003/11/01 01:58:11 marco
  44. * more small fixes.
  45. Revision 1.1 2003/11/01 01:27:20 marco
  46. * initial version from 1.0.x branch
  47. }