From d4bb99a5fbfd04f6eb8e792da3ba99e81249f8bd Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 3 Oct 2005 08:25:20 +0000 Subject: [PATCH] + runerror 214: bus error/data misaligment git-svn-id: trunk@1263 - --- rtl/linux/arm/sighnd.inc | 3 ++- rtl/linux/powerpc/sighnd.inc | 3 ++- rtl/linux/powerpc64/sighnd.inc | 3 ++- rtl/linux/sparc/sighnd.inc | 6 +++++- rtl/objpas/sysconst.pp | 2 ++ rtl/objpas/sysutils/sysutilh.inc | 5 +++-- rtl/objpas/sysutils/sysutils.inc | 15 ++++++++------- rtl/wince/system.pp | 5 +++-- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/rtl/linux/arm/sighnd.inc b/rtl/linux/arm/sighnd.inc index a04044806b..fa45f7e0b9 100644 --- a/rtl/linux/arm/sighnd.inc +++ b/rtl/linux/arm/sighnd.inc @@ -29,9 +29,10 @@ begin res := 207; end; SIGILL, - SIGBUS, SIGSEGV : res:=216; + SIGBUS: + res:=214; end; reenable_signal(sig); { give runtime error at the position where the signal was raised } diff --git a/rtl/linux/powerpc/sighnd.inc b/rtl/linux/powerpc/sighnd.inc index 9019f6b3b0..808c65b6ae 100644 --- a/rtl/linux/powerpc/sighnd.inc +++ b/rtl/linux/powerpc/sighnd.inc @@ -40,8 +40,9 @@ begin } res := 207; end; + SIGBUS : + res:=214; SIGILL, - SIGBUS, SIGSEGV : res:=216; end; diff --git a/rtl/linux/powerpc64/sighnd.inc b/rtl/linux/powerpc64/sighnd.inc index 0f4b00881c..2558386cbd 100644 --- a/rtl/linux/powerpc64/sighnd.inc +++ b/rtl/linux/powerpc64/sighnd.inc @@ -40,8 +40,9 @@ begin } res := 207; end; + SIGBUS : + res:=214; SIGILL, - SIGBUS, SIGSEGV : res:=216; end; diff --git a/rtl/linux/sparc/sighnd.inc b/rtl/linux/sparc/sighnd.inc index 3f469a7110..b63966a1a3 100644 --- a/rtl/linux/sparc/sighnd.inc +++ b/rtl/linux/sparc/sighnd.inc @@ -57,8 +57,12 @@ begin res:=207; end; end; + SIGBUS : + begin + addr := siginfo^._sifields._sigfault._addr; + res:=214; + end; SIGILL, - SIGBUS, SIGSEGV : begin addr := siginfo^._sifields._sigfault._addr; diff --git a/rtl/objpas/sysconst.pp b/rtl/objpas/sysconst.pp index 1140598102..f3e6f0b4d5 100644 --- a/rtl/objpas/sysconst.pp +++ b/rtl/objpas/sysconst.pp @@ -28,6 +28,7 @@ resourcestring SArgumentMissing = 'Missing argument in format "%s"'; SAssertError = '%s (%s, line %d)'; SAssertionFailed = 'Assertion failed'; + SBusError = 'Bus error or misaligned data access'; SCannotCreateEmptyDir = 'Cannot create empty directory'; SControlC = 'Control-C hit'; SDiskFull = 'Disk Full'; @@ -182,6 +183,7 @@ begin 206 : Result:=SUnderFlow; 207 : Result:=SInvalidOp; 211 : Result:=SAbstractError; + 214 : Result:=SBusError; 215 : Result:=SIntOverFlow; 216 : Result:=SAccessViolation; 217 : Result:=SPrivilege; diff --git a/rtl/objpas/sysutils/sysutilh.inc b/rtl/objpas/sysutils/sysutilh.inc index b02f439903..b563fe442b 100644 --- a/rtl/objpas/sysutils/sysutilh.inc +++ b/rtl/objpas/sysutils/sysutilh.inc @@ -121,6 +121,7 @@ type EVariantError = Class(Exception); EAccessViolation = Class(EExternal); + EBusError = Class(EAccessViolation); EPrivilege = class(EExternal); EStackOverflow = class(EExternal); EControlC = class(EExternal); @@ -170,13 +171,13 @@ Type Var OnCreateGUID : TCreateGUIDFunc = Nil; - + Function CreateGUID(out GUID : TGUID) : Integer; type TTerminateProc = Function: Boolean; - + procedure AddTerminateProc(TermProc: TTerminateProc); function CallTerminateProcs: Boolean; diff --git a/rtl/objpas/sysutils/sysutils.inc b/rtl/objpas/sysutils/sysutils.inc index 85ad94e149..7ec811b4d2 100644 --- a/rtl/objpas/sysutils/sysutils.inc +++ b/rtl/objpas/sysutils/sysutils.inc @@ -56,10 +56,10 @@ {$ifndef OS_FILESETDATEBYNAME} Function FileSetDate (Const FileName : String;Age : Longint) : Longint; - + Var fd : longint; - + begin fd:=FileOpen(FileName,fmOpenRead); If (Fd>=0) then @@ -69,8 +69,8 @@ FileClose(fd); end else - Result:=Fd; - end; + Result:=Fd; + end; {$endif} { Read String Handling functions implementation } @@ -93,7 +93,7 @@ { threading stuff } {$i sysuthrd.inc} - + { CPU Specific code } {$i sysutilp.inc} @@ -257,6 +257,7 @@ begin 206 : E:=EOverflow.Create(SUnderflow); 207 : E:=EInvalidOp.Create(SInvalidOp); 211 : E:=EAbstractError.Create(SAbstractError); + 214 : E:=EBusError.Create(SBusError); 215 : E:=EIntOverflow.Create(SIntOverflow); 216 : E:=EAccessViolation.Create(SAccessViolation); 217 : E:=EPrivilege.Create(SPrivilege); @@ -533,9 +534,9 @@ begin {$IFDEF HASCREATEGUID} Result:=SysCreateGUID(GUID); {$ELSE} - GetRandomBytes(GUID,SizeOf(Guid)); + GetRandomBytes(GUID,SizeOf(Guid)); Result:=0; - {$ENDIF} + {$ENDIF} end; end; diff --git a/rtl/wince/system.pp b/rtl/wince/system.pp index 4461658e6b..a20fe3e1fd 100644 --- a/rtl/wince/system.pp +++ b/rtl/wince/system.pp @@ -1316,9 +1316,10 @@ begin res := 215; STATUS_ILLEGAL_INSTRUCTION: res := 216; - STATUS_ACCESS_VIOLATION, - STATUS_DATATYPE_MISALIGNMENT: + STATUS_ACCESS_VIOLATION: res := 216; + STATUS_DATATYPE_MISALIGNMENT: + res := 214; STATUS_CONTROL_C_EXIT: res := 217; STATUS_PRIVILEGED_INSTRUCTION: