Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-07

Stack overflow error

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Carsten Bager

I am using the FPC Arm compiler on a embedded system. To get the FPC complier to reported the actual error address when a Stack overflow error occurs. I have replaced the call to HandleError(202);
with
HandleErrorFrame(202,get_frame);
Otherwise the address reported is the
fpc_stackcheck address.

I think this problem will be the same on a normal system.

Regards Carsten.

------------------------
procedure
fpc_stackcheck(stack_size:SizeUInt);[public,alias:'FPC_STACKCHECK'];
var
  c : Pointer;
begin
  { Avoid recursive calls when called from the exit routines }
  if StackError then
   exit;
  c := Sptr - (stack_size + STACK_MARGIN);
  if (c <= StackBottom) then
   begin
     StackError:=true;
     HandleErrorFrame(202,get_frame);
   end;
end;
Med venlig hilsen
Carsten Bager

BEAS A/S
Brørupvænget 10
DK-7650 Bøvlingbjerg
Tlf. : +45 9788 5222 Fax : +45 9788 5434
www.beas.dk

Reply by email