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