mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-30 18:11:37 +01: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
|
implementation
|
||||||
|
|
||||||
|
{$define FPC_SYSTEM_HAS_STACKTOP}
|
||||||
|
|
||||||
{$I system.inc}
|
{$I system.inc}
|
||||||
{$I osdebug.inc}
|
{$I osdebug.inc}
|
||||||
|
|
||||||
|
function StackTop: pointer;
|
||||||
|
begin
|
||||||
|
StackTop:=PETask(FindTask(nil)^.tc_ETask)^.PPCSPUpper;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$IFDEF MOSFPC_FILEDEBUG}
|
{$IFDEF MOSFPC_FILEDEBUG}
|
||||||
{$WARNING Compiling with file debug enabled!}
|
{$WARNING Compiling with file debug enabled!}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -245,7 +253,7 @@ end;
|
|||||||
begin
|
begin
|
||||||
IsConsole := TRUE;
|
IsConsole := TRUE;
|
||||||
StackLength := CheckInitialStkLen(InitialStkLen);
|
StackLength := CheckInitialStkLen(InitialStkLen);
|
||||||
StackBottom := Sptr - StackLength;
|
StackBottom := StackTop - StackLength;
|
||||||
{ OS specific startup }
|
{ OS specific startup }
|
||||||
MOS_ambMsg:=nil;
|
MOS_ambMsg:=nil;
|
||||||
ASYS_origDir:=0;
|
ASYS_origDir:=0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user