mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 07:46:00 +02:00
Adapt TSigContext to structure found by debugging
git-svn-id: trunk@22482 -
This commit is contained in:
parent
5deddaec8c
commit
abef064786
@ -18,38 +18,44 @@
|
|||||||
procedure SignalToRunerror(sig : longint; SigInfo: PSigInfo; SigContext: PSigContext);public name '_FPC_DEFAULTSIGHANDLER';cdecl;
|
procedure SignalToRunerror(sig : longint; SigInfo: PSigInfo; SigContext: PSigContext);public name '_FPC_DEFAULTSIGHANDLER';cdecl;
|
||||||
var
|
var
|
||||||
res : word;
|
res : word;
|
||||||
addr : pointer;
|
addr, framebp : pointer;
|
||||||
begin
|
begin
|
||||||
res:=0;
|
res:=0;
|
||||||
addr:=nil;
|
addr:=nil;
|
||||||
|
framebp:=nil;
|
||||||
case sig of
|
case sig of
|
||||||
SIGFPE :
|
SIGFPE :
|
||||||
begin
|
begin
|
||||||
addr := siginfo^._sifields._sigfault._addr;
|
if assigned(siginfo) then
|
||||||
case siginfo^.si_code of
|
begin
|
||||||
FPE_INTDIV:
|
addr := siginfo^._sifields._sigfault._addr;
|
||||||
res:=200;
|
case siginfo^.si_code of
|
||||||
FPE_INTOVF:
|
FPE_INTDIV:
|
||||||
res:=215;
|
res:=200;
|
||||||
FPE_FLTDIV:
|
FPE_INTOVF:
|
||||||
res:=200;
|
res:=215;
|
||||||
FPE_FLTOVF:
|
FPE_FLTDIV:
|
||||||
res:=205;
|
res:=200;
|
||||||
FPE_FLTUND:
|
FPE_FLTOVF:
|
||||||
res:=206;
|
res:=205;
|
||||||
else
|
FPE_FLTUND:
|
||||||
res:=207;
|
res:=206;
|
||||||
end;
|
else
|
||||||
|
res:=207;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
SIGBUS :
|
SIGBUS :
|
||||||
begin
|
begin
|
||||||
addr := siginfo^._sifields._sigfault._addr;
|
if assigned(siginfo) then
|
||||||
|
addr := siginfo^._sifields._sigfault._addr;
|
||||||
res:=214;
|
res:=214;
|
||||||
end;
|
end;
|
||||||
SIGILL,
|
SIGILL,
|
||||||
SIGSEGV :
|
SIGSEGV :
|
||||||
begin
|
begin
|
||||||
addr := siginfo^._sifields._sigfault._addr;
|
if assigned(siginfo) then
|
||||||
|
addr := siginfo^._sifields._sigfault._addr;
|
||||||
res:=216;
|
res:=216;
|
||||||
end;
|
end;
|
||||||
SIGINT:
|
SIGINT:
|
||||||
@ -58,9 +64,16 @@ begin
|
|||||||
res:=233;
|
res:=233;
|
||||||
end;
|
end;
|
||||||
reenable_signal(sig);
|
reenable_signal(sig);
|
||||||
|
|
||||||
|
if assigned(sigcontext) then
|
||||||
|
begin
|
||||||
|
addr:=pointer(sigcontext^.sigc_pc);
|
||||||
|
framebp:=pointer(sigcontext^.sigc_gregs[SIG_SP]);
|
||||||
|
end;
|
||||||
|
|
||||||
{ give runtime error at the position where the signal was raised }
|
{ give runtime error at the position where the signal was raised }
|
||||||
if res<>0 then
|
if res<>0 then
|
||||||
HandleErrorAddrFrame(res,addr,nil);
|
HandleErrorAddrFrame(res,addr,framebp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user