Kaynağa Gözat

+ runerror 214: bus error/data misaligment

git-svn-id: trunk@1263 -
florian 20 yıl önce
ebeveyn
işleme
d4bb99a5fb

+ 2 - 1
rtl/linux/arm/sighnd.inc

@@ -29,9 +29,10 @@ begin
           res := 207;
           res := 207;
         end;
         end;
     SIGILL,
     SIGILL,
-    SIGBUS,
     SIGSEGV :
     SIGSEGV :
         res:=216;
         res:=216;
+    SIGBUS:
+        res:=214;
   end;
   end;
   reenable_signal(sig);
   reenable_signal(sig);
   { give runtime error at the position where the signal was raised }
   { give runtime error at the position where the signal was raised }

+ 2 - 1
rtl/linux/powerpc/sighnd.inc

@@ -40,8 +40,9 @@ begin
 }
 }
             res := 207;
             res := 207;
         end;
         end;
+    SIGBUS :
+        res:=214;
     SIGILL,
     SIGILL,
-    SIGBUS,
     SIGSEGV :
     SIGSEGV :
         res:=216;
         res:=216;
   end;
   end;

+ 2 - 1
rtl/linux/powerpc64/sighnd.inc

@@ -40,8 +40,9 @@ begin
 }
 }
             res := 207;
             res := 207;
         end;
         end;
+    SIGBUS :
+        res:=214;
     SIGILL,
     SIGILL,
-    SIGBUS,
     SIGSEGV :
     SIGSEGV :
         res:=216;
         res:=216;
   end;
   end;

+ 5 - 1
rtl/linux/sparc/sighnd.inc

@@ -57,8 +57,12 @@ begin
               res:=207;
               res:=207;
           end;
           end;
         end;
         end;
+    SIGBUS :
+        begin
+          addr := siginfo^._sifields._sigfault._addr;
+          res:=214;
+        end;
     SIGILL,
     SIGILL,
-    SIGBUS,
     SIGSEGV :
     SIGSEGV :
         begin
         begin
           addr := siginfo^._sifields._sigfault._addr;
           addr := siginfo^._sifields._sigfault._addr;

+ 2 - 0
rtl/objpas/sysconst.pp

@@ -28,6 +28,7 @@ resourcestring
   SArgumentMissing       = 'Missing argument in format "%s"';
   SArgumentMissing       = 'Missing argument in format "%s"';
   SAssertError           = '%s (%s, line %d)';
   SAssertError           = '%s (%s, line %d)';
   SAssertionFailed       = 'Assertion failed';
   SAssertionFailed       = 'Assertion failed';
+  SBusError              = 'Bus error or misaligned data access';
   SCannotCreateEmptyDir  = 'Cannot create empty directory';
   SCannotCreateEmptyDir  = 'Cannot create empty directory';
   SControlC              = 'Control-C hit';
   SControlC              = 'Control-C hit';
   SDiskFull              = 'Disk Full';
   SDiskFull              = 'Disk Full';
@@ -182,6 +183,7 @@ begin
      206 : Result:=SUnderFlow;
      206 : Result:=SUnderFlow;
      207 : Result:=SInvalidOp;
      207 : Result:=SInvalidOp;
      211 : Result:=SAbstractError;
      211 : Result:=SAbstractError;
+     214 : Result:=SBusError;
      215 : Result:=SIntOverFlow;
      215 : Result:=SIntOverFlow;
      216 : Result:=SAccessViolation;
      216 : Result:=SAccessViolation;
      217 : Result:=SPrivilege;
      217 : Result:=SPrivilege;

+ 3 - 2
rtl/objpas/sysutils/sysutilh.inc

@@ -121,6 +121,7 @@ type
    EVariantError = Class(Exception);
    EVariantError = Class(Exception);
 
 
    EAccessViolation = Class(EExternal);
    EAccessViolation = Class(EExternal);
+   EBusError = Class(EAccessViolation);
    EPrivilege = class(EExternal);
    EPrivilege = class(EExternal);
    EStackOverflow = class(EExternal);
    EStackOverflow = class(EExternal);
    EControlC = class(EExternal);
    EControlC = class(EExternal);
@@ -170,13 +171,13 @@ Type
 
 
 Var
 Var
    OnCreateGUID : TCreateGUIDFunc = Nil;
    OnCreateGUID : TCreateGUIDFunc = Nil;
-  
+
    Function CreateGUID(out GUID : TGUID) : Integer;
    Function CreateGUID(out GUID : TGUID) : Integer;
 
 
 type
 type
   TTerminateProc = Function: Boolean;
   TTerminateProc = Function: Boolean;
 
 
-  
+
 
 
   procedure AddTerminateProc(TermProc: TTerminateProc);
   procedure AddTerminateProc(TermProc: TTerminateProc);
   function CallTerminateProcs: Boolean;
   function CallTerminateProcs: Boolean;

+ 8 - 7
rtl/objpas/sysutils/sysutils.inc

@@ -56,10 +56,10 @@
 
 
   {$ifndef OS_FILESETDATEBYNAME}
   {$ifndef OS_FILESETDATEBYNAME}
   Function FileSetDate (Const FileName : String;Age : Longint) : Longint;
   Function FileSetDate (Const FileName : String;Age : Longint) : Longint;
-  
+
   Var
   Var
     fd : longint;
     fd : longint;
-    
+
   begin
   begin
     fd:=FileOpen(FileName,fmOpenRead);
     fd:=FileOpen(FileName,fmOpenRead);
     If (Fd>=0) then
     If (Fd>=0) then
@@ -69,8 +69,8 @@
         FileClose(fd);
         FileClose(fd);
       end
       end
     else
     else
-      Result:=Fd;  
-  end;  
+      Result:=Fd;
+  end;
   {$endif}
   {$endif}
 
 
   { Read String Handling functions implementation }
   { Read String Handling functions implementation }
@@ -93,7 +93,7 @@
 
 
   { threading stuff }
   { threading stuff }
   {$i sysuthrd.inc}
   {$i sysuthrd.inc}
-  
+
   { CPU Specific code }
   { CPU Specific code }
   {$i sysutilp.inc}
   {$i sysutilp.inc}
 
 
@@ -257,6 +257,7 @@ begin
   206 : E:=EOverflow.Create(SUnderflow);
   206 : E:=EOverflow.Create(SUnderflow);
   207 : E:=EInvalidOp.Create(SInvalidOp);
   207 : E:=EInvalidOp.Create(SInvalidOp);
   211 : E:=EAbstractError.Create(SAbstractError);
   211 : E:=EAbstractError.Create(SAbstractError);
+  214 : E:=EBusError.Create(SBusError);
   215 : E:=EIntOverflow.Create(SIntOverflow);
   215 : E:=EIntOverflow.Create(SIntOverflow);
   216 : E:=EAccessViolation.Create(SAccessViolation);
   216 : E:=EAccessViolation.Create(SAccessViolation);
   217 : E:=EPrivilege.Create(SPrivilege);
   217 : E:=EPrivilege.Create(SPrivilege);
@@ -533,9 +534,9 @@ begin
     {$IFDEF HASCREATEGUID}
     {$IFDEF HASCREATEGUID}
     Result:=SysCreateGUID(GUID);
     Result:=SysCreateGUID(GUID);
     {$ELSE}
     {$ELSE}
-    GetRandomBytes(GUID,SizeOf(Guid));  
+    GetRandomBytes(GUID,SizeOf(Guid));
     Result:=0;
     Result:=0;
-    {$ENDIF}    
+    {$ENDIF}
     end;
     end;
 end;
 end;
 
 

+ 3 - 2
rtl/wince/system.pp

@@ -1316,9 +1316,10 @@ begin
       res := 215;
       res := 215;
     STATUS_ILLEGAL_INSTRUCTION:
     STATUS_ILLEGAL_INSTRUCTION:
       res := 216;
       res := 216;
-    STATUS_ACCESS_VIOLATION,
-    STATUS_DATATYPE_MISALIGNMENT:
+    STATUS_ACCESS_VIOLATION:
       res := 216;
       res := 216;
+    STATUS_DATATYPE_MISALIGNMENT:
+      res := 214;
     STATUS_CONTROL_C_EXIT:
     STATUS_CONTROL_C_EXIT:
       res := 217;
       res := 217;
     STATUS_PRIVILEGED_INSTRUCTION:
     STATUS_PRIVILEGED_INSTRUCTION: