mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-21 17:25:24 +02:00
morphos: implement StackTop to get the stack top from the OS. stack boundaries are detected more precisely now, this fixes stack backtraces with shallow stack, among others
git-svn-id: trunk@36696 -
This commit is contained in:
parent
c66daeb69f
commit
cca38c9f08
@ -78,9 +78,17 @@ var
|
||||
|
||||
implementation
|
||||
|
||||
{$define FPC_SYSTEM_HAS_STACKTOP}
|
||||
|
||||
{$I system.inc}
|
||||
{$I osdebug.inc}
|
||||
|
||||
function StackTop: pointer;
|
||||
begin
|
||||
StackTop:=PETask(FindTask(nil)^.tc_ETask)^.PPCSPUpper;
|
||||
end;
|
||||
|
||||
|
||||
{$IFDEF MOSFPC_FILEDEBUG}
|
||||
{$WARNING Compiling with file debug enabled!}
|
||||
{$ENDIF}
|
||||
@ -245,7 +253,7 @@ end;
|
||||
begin
|
||||
IsConsole := TRUE;
|
||||
StackLength := CheckInitialStkLen(InitialStkLen);
|
||||
StackBottom := Sptr - StackLength;
|
||||
StackBottom := StackTop - StackLength;
|
||||
{ OS specific startup }
|
||||
MOS_ambMsg:=nil;
|
||||
ASYS_origDir:=0;
|
||||
|
Loading…
Reference in New Issue
Block a user